diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index e737bf40919c..77fff413307f 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -455,9 +455,17 @@ # PRLabel: %Event Hubs /sdk/eventhubs/microsoft-azure-eventhubs-extensions/ @sjkwak +# ServiceLabel: %Health Deidentification +# PRLabel: %Health Deidentification +/sdk/healthdataaiservices/ @GrahamMThomas @danielszaniszlo @billwert + # PRLabel: %Event Hubs /sdk/eventhubs/microsoft-azure-eventhubs/ @sjkwak +# ServiceLabel: %Cognitive - Face +# PRLabel: %Cognitive - Face +/sdk/face/azure-ai-vision-face/ @leareai + # ServiceLabel: %Functions # ServiceOwners: @ahmedelnably @fabiocav @@ -513,8 +521,6 @@ # PRLabel: %Load Testing /sdk/loadtesting/ @Harshan01 @prativen -/sdk/loganalytics/microsoft-azure-loganalytics/ @ischrei - # ServiceLabel: %Logic App # ServiceOwners: @Azure/azure-logicapps-team @@ -864,13 +870,14 @@ # ######## Eng Sys ######## /eng/ @hallipr @weshaggard @benbp @JimSuplizio +/eng/automation/ @weidongxu-microsoft @haolingdong-msft @XiaofeiCao @arthurma1978 @hallipr @weshaggard @benbp @JimSuplizio /eng/bomgenerator/ @vcolin7 @alzimmermsft @srnagar @jonathangiles /eng/code-quality-reports/ @mssfang @JonathanGiles @alzimmermsft @srnagar /eng/common/ @Azure/azure-sdk-eng -/eng/mgmt/ @weidongxu-microsoft @haolingdong-msft @XiaofeiCao @arthurma1978 @hallipr @weshaggard @benbp @JimSuplizio /eng/spotbugs-aggregate-report/ @srnagar @JonathanGiles /eng/versioning/ @alzimmermsft @samvaity @g2vinay @JimSuplizio /eng/versioning/external_dependencies.txt @alzimmermsft @samvaity @g2vinay @jonathangiles @rujche @netyyyy @saragluna @moarychan +/.github/workflows/ @Azure/azure-sdk-eng # Removing owners for these files to not require codeowner approval for changes to them given they are shared with project /eng/versioning/version_client.txt @@ -879,3 +886,6 @@ # Add owners for notifications for specific pipelines /eng/pipelines/aggregate-reports.yml @joshfree @jonathangiles /eng/common/pipelines/codeowners-linter.yml @alzimmermsft @srnagar @lmolkova + +# Add Cosmos source owners as the owners of their specialized matrix +/eng/pipelines/templates/stages/cosmos-emulator-matrix.json @kushagraThapar @FabianMeiswinkel @kirankumarkolli @xinlian12 @milismsft @aayush3011 @simorenoh @jeet1995 @Pilchie diff --git a/.github/workflows/event-processor.yml b/.github/workflows/event-processor.yml index 8bb1d3a1bd52..06092e395ad8 100644 --- a/.github/workflows/event-processor.yml +++ b/.github/workflows/event-processor.yml @@ -58,7 +58,7 @@ jobs: run: > dotnet tool install Azure.Sdk.Tools.GitHubEventProcessor - --version 1.0.0-dev.20240610.2 + --version 1.0.0-dev.20240708.1 --add-source https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json --global shell: bash @@ -114,7 +114,7 @@ jobs: run: > dotnet tool install Azure.Sdk.Tools.GitHubEventProcessor - --version 1.0.0-dev.20240610.2 + --version 1.0.0-dev.20240708.1 --add-source https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json --global shell: bash diff --git a/.github/workflows/scheduled-event-processor.yml b/.github/workflows/scheduled-event-processor.yml index db36be4e561d..a20efcfcb9eb 100644 --- a/.github/workflows/scheduled-event-processor.yml +++ b/.github/workflows/scheduled-event-processor.yml @@ -39,7 +39,7 @@ jobs: run: > dotnet tool install Azure.Sdk.Tools.GitHubEventProcessor - --version 1.0.0-dev.20240610.2 + --version 1.0.0-dev.20240708.1 --add-source https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json --global shell: bash diff --git a/.vscode/cspell.json b/.vscode/cspell.json index c4df5907d503..48cb6cf9200d 100644 --- a/.vscode/cspell.json +++ b/.vscode/cspell.json @@ -77,7 +77,6 @@ "sdk/appconfiguration/azure-spring-cloud-feature-management-web/**", "sdk/appconfiguration/azure-spring-cloud-feature-management/**", "sdk/appconfiguration/azure-spring-cloud-appconfiguration-config-web/**", - "sdk/appconfiguration/azure-data-appconfiguration/**", "sdk/appconfiguration/azure-spring-cloud-appconfiguration-config/**", "sdk/boms/azure-sdk-bom/**", "sdk/boms/azure-sdk-template-bom/**", @@ -161,7 +160,8 @@ "sdk/keyvault/azure-security-keyvault-keys/**", "sdk/keyvault/azure-security-keyvault-secrets/**", "sdk/keyvault/azure-security-test-keyvault-jca/**", - "sdk/keyvault/test-resources.json", + "sdk/keyvault/test-resources/test-resources.json", + "sdk/keyvault/test-resources-jca/test-resources.json", "sdk/formrecognizer/azure-ai-formrecognizer/**", "sdk/core/azure-core/**", "sdk/documentintelligence/azure-ai-documentintelligence/**", @@ -275,6 +275,12 @@ "databind", "databricks", "DAZURE", + "deidentification", + "deidentificationclient", + "deidentified", + "deid", + "deidservices", + "deidentify", "ddos", "dcis", "deallocate", @@ -301,6 +307,7 @@ "Entra", "Esto", "etag", + "euap", "eventhub", "eventhubs", "failondeprecatedstatus", @@ -316,10 +323,12 @@ "hanaonazure", "hdfs", "hdinsight", + "healthdataaiservices", "hudha", "hvac", "hybridkubernetes", "hyunwoongko", + "idnum", "insights", "intellij", "Intellij", @@ -969,11 +978,13 @@ "Milli", "qpid", "unretriable" - ] + ] }, { "filename": "sdk/spring/scripts/**", "words": [ + "agroal", + "alluxio", "antlr", "arquillian", "aspectj", @@ -982,18 +993,28 @@ "aspectjweaver", "assertj", "astbuilder", + "asyncer", + "athenz", "atomikos", "awaitility", "awspring", + "bcfips", "Borca", "brotli", "bson", "cbor", + "chromadb", + "cockroachdb", "codehaus", "collectd", + "crac", + "cratedb", + "cyclonedx", "datastax", "dbcp", + "debezium", "deser", + "dynalite", "dynatrace", "ecwid", "ehcache", @@ -1001,18 +1022,26 @@ "fcgi", "flywaydb", "gcloud", + "gimap", + "ginq", "groovysh", "guice", "Hikari", "hikaricp", + "hivemq", + "hocon", + "hornetq", "hppc", + "hqclient", "hsqldb", "humio", "hystrix", "inmemory", "infinispan", + "informix", "integ", "iostreams", + "istack", "istio", "itest", "itests", @@ -1024,6 +1053,8 @@ "jaxrs", "jaxws", "jcache", + "jcloud", + "jclouds", "jdbi", "jdom", "jgit", @@ -1033,8 +1064,10 @@ "johnzon", "jooq", "jpamodelgen", + "jspc", "jstl", "jtds", + "jvnet", "kahadb", "kairos", "karaf", @@ -1042,28 +1075,43 @@ "kotlinx", "kqueue", "kryo", + "kustomize", "ldif", "leveldb", "liquibase", + "milvus", + "minio", "mockmvc", + "moshi", "moxy", "mqtt", "mrbean", "mssql", + "mssqlserver", "mxab", "nekohtml", "nosql", "ocsp", "ojdbc", "okcurl", + "okio", + "ollama", + "openfga", + "openmldb", "opentsdb", "orai", + "orientdb", "osdt", "osgi", "otel", "otlp", "pcollections", "proxool", + "qdrant", + "qpack", + "quarkus", + "questdb", + "quic", "rabbitmq", "reactivex", "remoting", @@ -1081,26 +1129,61 @@ "specto", "squareup", "statsd", + "stax", + "staxex", "stree", + "sybasease", "tcnative", "tekton", "testng", + "tidb", "tmatesoft", + "toxiproxy", + "trino", "trogdor", "txwc", "uberjar", "ultraq", "unboundid", + "vavr", "vertx", "vibur", "wadl", + "weaviate", "webmvc", "xerial", "xmpp", "xsom", + "yasson", + "yugabytedb", "zaxxer" ] }, + { + "filename": "sdk/spring/**.md", + "words": [ + "Dcheckstyle", + "Dcodesnippet", + "Djacoco", + "Dparallel", + "Drevapi", + "Dskip", + "Dspotbugs", + "Pdev" + ] + }, + { + "filename": "sdk/spring/**/*.xml", + "words": [ + "failondeprecatedstatus" + ] + }, + { + "filename": "sdk/spring/**.yml", + "words": [ + "failondeprecatedstatus" + ] + }, { "filename": "sdk/spring/**", "words": [ @@ -1143,21 +1226,32 @@ "VCAP", "xiada", "yiliu", - "usgovcloudapi" + "usgovcloudapi", + "Pnative", + "Djava", + "sbmvn" ] }, { - "filename": "sdk/spring/**.md", + "filename": "sdk/spring/spring-cloud-azure-starter-monitor/**.md", "words": [ - "Dcheckstyle", - "Dcodesnippet", - "Djacoco", - "Dparallel", - "Drevapi", - "Dskip", - "Dspotbugs", - "Pdev", - "Djava" + "Djava" + ] + }, + { + "filename": "sdk/spring/spring-cloud-azure-testcontainers/src/main/java/com/azure/spring/testcontainers/service/connection/storage/StorageBlobContainerConnectionDetailsFactory.java", + "words": [ + "CDXJ", + "SZFPT", + "Bekso" + ] + }, + { + "filename": "sdk/spring/spring-cloud-azure-testcontainers/src/main/java/com/azure/spring/testcontainers/service/connection/storage/StorageQueueContainerConnectionDetailsFactory.java", + "words": [ + "CDXJ", + "SZFPT", + "Bekso" ] }, { diff --git a/common/perf-test-core/pom.xml b/common/perf-test-core/pom.xml index 9eb195393254..62e3b4bdb477 100644 --- a/common/perf-test-core/pom.xml +++ b/common/perf-test-core/pom.xml @@ -82,12 +82,12 @@ com.azure azure-core-http-netty - 1.15.1 + 1.15.2 com.azure azure-core-http-okhttp - 1.12.0 + 1.12.1 com.azure diff --git a/common/smoke-tests/pom.xml b/common/smoke-tests/pom.xml index 57e630f54129..b9f58272d08a 100644 --- a/common/smoke-tests/pom.xml +++ b/common/smoke-tests/pom.xml @@ -88,13 +88,13 @@ com.azure azure-core - 1.49.1 + 1.50.0 com.azure azure-core-http-netty - 1.15.1 + 1.15.2 @@ -106,13 +106,13 @@ com.azure azure-core-http-okhttp - 1.12.0 + 1.12.1 com.azure azure-core-amqp - 2.9.6 + 2.9.7 @@ -124,7 +124,7 @@ com.azure azure-identity - 1.13.0 + 1.13.1 @@ -136,13 +136,13 @@ com.azure azure-messaging-eventhubs - 5.18.4 + 5.18.5 com.azure azure-messaging-eventhubs-checkpointstore-blob - 1.19.4 + 1.19.5 diff --git a/eng/mgmt/automation/api-specs.yaml b/eng/automation/api-specs.yaml similarity index 100% rename from eng/mgmt/automation/api-specs.yaml rename to eng/automation/api-specs.yaml diff --git a/eng/mgmt/automation/changelog.py b/eng/automation/changelog.py similarity index 95% rename from eng/mgmt/automation/changelog.py rename to eng/automation/changelog.py index 1827844a64d2..cd08d5ebcc25 100755 --- a/eng/mgmt/automation/changelog.py +++ b/eng/automation/changelog.py @@ -42,7 +42,7 @@ def main(): logging.basicConfig( stream=sys.stdout, level=logging.INFO, - format="%(asctime)s %(levelname)s %(message)s", + format="%(asctime)s [%(levelname)s] %(message)s", datefmt="%Y-%m-%d %X", ) main() diff --git a/eng/mgmt/changelog/pom.xml b/eng/automation/changelog/pom.xml similarity index 100% rename from eng/mgmt/changelog/pom.xml rename to eng/automation/changelog/pom.xml diff --git a/eng/mgmt/changelog/src/main/java/com/azure/resourcemanager/tools/changelog/Main.java b/eng/automation/changelog/src/main/java/com/azure/resourcemanager/tools/changelog/Main.java similarity index 100% rename from eng/mgmt/changelog/src/main/java/com/azure/resourcemanager/tools/changelog/Main.java rename to eng/automation/changelog/src/main/java/com/azure/resourcemanager/tools/changelog/Main.java diff --git a/eng/mgmt/changelog/src/main/java/com/azure/resourcemanager/tools/changelog/changelog/ChangeLog.java b/eng/automation/changelog/src/main/java/com/azure/resourcemanager/tools/changelog/changelog/ChangeLog.java similarity index 100% rename from eng/mgmt/changelog/src/main/java/com/azure/resourcemanager/tools/changelog/changelog/ChangeLog.java rename to eng/automation/changelog/src/main/java/com/azure/resourcemanager/tools/changelog/changelog/ChangeLog.java diff --git a/eng/mgmt/changelog/src/main/java/com/azure/resourcemanager/tools/changelog/changelog/DefinitionStageChangeLog.java b/eng/automation/changelog/src/main/java/com/azure/resourcemanager/tools/changelog/changelog/DefinitionStageChangeLog.java similarity index 100% rename from eng/mgmt/changelog/src/main/java/com/azure/resourcemanager/tools/changelog/changelog/DefinitionStageChangeLog.java rename to eng/automation/changelog/src/main/java/com/azure/resourcemanager/tools/changelog/changelog/DefinitionStageChangeLog.java diff --git a/eng/mgmt/changelog/src/main/java/com/azure/resourcemanager/tools/changelog/utils/AllMethods.java b/eng/automation/changelog/src/main/java/com/azure/resourcemanager/tools/changelog/utils/AllMethods.java similarity index 100% rename from eng/mgmt/changelog/src/main/java/com/azure/resourcemanager/tools/changelog/utils/AllMethods.java rename to eng/automation/changelog/src/main/java/com/azure/resourcemanager/tools/changelog/utils/AllMethods.java diff --git a/eng/mgmt/changelog/src/main/java/com/azure/resourcemanager/tools/changelog/utils/ClassName.java b/eng/automation/changelog/src/main/java/com/azure/resourcemanager/tools/changelog/utils/ClassName.java similarity index 100% rename from eng/mgmt/changelog/src/main/java/com/azure/resourcemanager/tools/changelog/utils/ClassName.java rename to eng/automation/changelog/src/main/java/com/azure/resourcemanager/tools/changelog/utils/ClassName.java diff --git a/eng/mgmt/changelog/src/main/java/com/azure/resourcemanager/tools/changelog/utils/MethodName.java b/eng/automation/changelog/src/main/java/com/azure/resourcemanager/tools/changelog/utils/MethodName.java similarity index 100% rename from eng/mgmt/changelog/src/main/java/com/azure/resourcemanager/tools/changelog/utils/MethodName.java rename to eng/automation/changelog/src/main/java/com/azure/resourcemanager/tools/changelog/utils/MethodName.java diff --git a/eng/mgmt/changelog/src/main/java/com/azure/resourcemanager/tools/changelog/utils/Namespaces.java b/eng/automation/changelog/src/main/java/com/azure/resourcemanager/tools/changelog/utils/Namespaces.java similarity index 100% rename from eng/mgmt/changelog/src/main/java/com/azure/resourcemanager/tools/changelog/utils/Namespaces.java rename to eng/automation/changelog/src/main/java/com/azure/resourcemanager/tools/changelog/utils/Namespaces.java diff --git a/eng/mgmt/automation/generate.py b/eng/automation/generate.py similarity index 91% rename from eng/mgmt/automation/generate.py rename to eng/automation/generate.py index 106744b51d71..dfcebd5f286d 100755 --- a/eng/mgmt/automation/generate.py +++ b/eng/automation/generate.py @@ -304,6 +304,34 @@ def sdk_automation_typespec_project(tsp_project: str, config: dict) -> dict: } +def update_changelog_version(sdk_root: str, output_folder: str, current_version: str): + pwd = os.getcwd() + try: + os.chdir(sdk_root) + changelog_file = os.path.join(output_folder, "CHANGELOG.md") + if os.path.exists(changelog_file): + with open(changelog_file, "r") as fin: + changelog_str = fin.read() + logging.info("[CHANGELOG][Version] Update changelog latest version") + version_pattern = "^## (\d+\.\d+\.\d+(?:-[\w\d\.]+)?) \((?P.*?)\)" + + changelog_str = re.sub( + pattern=version_pattern, + repl=f"## {current_version} (\\g)", + string=changelog_str, + count=1, + flags=re.M, + ) + with open(changelog_file, "w") as fout: + fout.write(changelog_str) + + logging.info("[Changelog][Success] Updated changelog latest version") + else: + logging.info("[Changelog][Skip] Cannot find changelog file under the given output folder") + finally: + os.chdir(pwd) + + def main(): (parser, args) = parse_args() args = vars(args) @@ -332,6 +360,7 @@ def main(): update_parameters(None) output_folder = OUTPUT_FOLDER_FORMAT.format(service) update_version(sdk_root, output_folder) + update_changelog_version(sdk_root, output_folder, current_version) else: if not args.get("readme"): parser.print_help() @@ -374,7 +403,7 @@ def main(): try: os.chdir(sdk_root) os.system( - "git add eng/versioning eng/mgmt pom.xml {0} {1}".format( + "git add eng/versioning eng/automation pom.xml {0} {1}".format( CI_FILE_FORMAT.format(service), POM_FILE_FORMAT.format(service) ) ) @@ -394,7 +423,7 @@ def main(): logging.basicConfig( stream=sys.stdout, level=logging.INFO, - format="%(asctime)s %(levelname)s %(message)s", + format="%(asctime)s [%(levelname)s] %(message)s", datefmt="%Y-%m-%d %X", ) main() diff --git a/eng/mgmt/automation/generate_data.py b/eng/automation/generate_data.py similarity index 96% rename from eng/mgmt/automation/generate_data.py rename to eng/automation/generate_data.py index 4825896f18bc..bfb173f4ee80 100755 --- a/eng/mgmt/automation/generate_data.py +++ b/eng/automation/generate_data.py @@ -34,6 +34,7 @@ def sdk_automation_typespec_project(tsp_project: str, config: dict) -> dict: repo_url: str = config["repoHttpsUrl"] breaking: bool = False changelog: str = "" + clean_sdk_folder_succeeded = False succeeded, require_sdk_integration, sdk_folder, service, module = generate_typespec_project( tsp_project, sdk_root, spec_root, head_sha, repo_url @@ -54,6 +55,8 @@ def sdk_automation_typespec_project(tsp_project: str, config: dict) -> dict: if require_sdk_integration: update_service_files_for_new_lib(sdk_root, service, GROUP_ID, module) update_root_pom(sdk_root, service) + if clean_sdk_folder_succeeded: + current_version = DEFAULT_VERSION # compile succeeded = compile_package(sdk_root, GROUP_ID, module) @@ -74,7 +77,8 @@ def sdk_automation_typespec_project(tsp_project: str, config: dict) -> dict: succeeded, require_sdk_integration, sdk_folder, service, module = generate_typespec_project( tsp_project, sdk_root, spec_root, head_sha, repo_url ) - stable_version, current_version = set_or_default_version(sdk_root, GROUP_ID, module) + stable_version, _ = set_or_default_version(sdk_root, GROUP_ID, module) + current_version = DEFAULT_VERSION if require_sdk_integration: update_service_files_for_new_lib(sdk_root, service, GROUP_ID, module) update_root_pom(sdk_root, service) @@ -335,7 +339,7 @@ def generate( try: subprocess.run(command, shell=True, check=True) except subprocess.CalledProcessError: - logging.error("[GENERATE] Autorest fail") + logging.error("[GENERATE] Code generation failed. Autorest fails.") return False if require_sdk_integration: @@ -376,7 +380,7 @@ def generate( ) logging.info(command) if os.system(command) != 0: - logging.error("[GENERATE] Autorest fail") + logging.error("[GENERATE] Code generation failed. Autorest fails.") return False set_or_default_version(sdk_root, GROUP_ID, module) @@ -393,13 +397,10 @@ def compile_package(sdk_root: str, group_id: str, module: str) -> bool: ) logging.info(command) if os.system(command) != 0: - error_message = ( - "[COMPILE] Maven build fail.\n" - "One reason of the compilation failure is that the existing code customization in SDK repository being incompatible with the class generated from updated TypeSpec source. In such case, you can ignore the failure, and fix the customization in SDK repository.\n" - 'You can inquire in "Language - Java" Teams channel. Please include the link of this Pull Request in the query.' + logging.error("[COMPILE] Maven build fail.") + logging.error( + 'One reason of the compilation failure is that the existing code customization in SDK repository being incompatible with the class generated from updated TypeSpec source. In such case, you can ignore the failure, and fix the customization in SDK repository. You can inquire in "Language - Java" Teams channel. Please include the link of this Pull Request in the query.' ) - logging.error(error_message) - print(error_message, file=sys.stderr) return False return True @@ -585,7 +586,7 @@ def main(): logging.basicConfig( stream=sys.stdout, level=logging.INFO, - format="%(asctime)s %(levelname)s %(message)s", + format="%(asctime)s [%(levelname)s] %(message)s", datefmt="%Y-%m-%d %X", ) main() diff --git a/eng/mgmt/automation/generate_utils.py b/eng/automation/generate_utils.py old mode 100644 new mode 100755 similarity index 94% rename from eng/mgmt/automation/generate_utils.py rename to eng/automation/generate_utils.py index 8b66865a0d21..bc7443c276b1 --- a/eng/mgmt/automation/generate_utils.py +++ b/eng/automation/generate_utils.py @@ -85,14 +85,12 @@ def generate( ) logging.info(command) if os.system(command) != 0: - error_message = ( - "[GENERATE][Error] Code generation failed.\n" - "Please first check if the failure happens only to Java automation, or for all SDK automations.\n" - "If it happens for all SDK automations, please double check your Swagger, and check whether there is errors in ModelValidation and LintDiff.\n" + logging.error("[GENERATE] Code generation failed.") + logging.error( + "Please first check if the failure happens only to Java automation, or for all SDK automations. " + "If it happens for all SDK automations, please double check your Swagger, and check whether there is errors in ModelValidation and LintDiff. " "If it happens to Java alone, you can open an issue to https://github.com/Azure/autorest.java/issues. Please include the link of this Pull Request in the issue." ) - logging.error(error_message) - print(error_message, file=sys.stderr) return False group = GROUP_ID @@ -128,12 +126,10 @@ def compile_arm_package(sdk_root: str, module: str) -> bool: ) != 0 ): - error_message = ( - "[COMPILE] Maven build fail.\n" + logging.error("[COMPILE] Maven build fail.") + logging.error( 'You can inquire in "Language - Java" Teams channel. Please include the link of this Pull Request in the query.' ) - logging.error(error_message) - print(error_message, file=sys.stderr) return False return True @@ -146,7 +142,7 @@ def generate_changelog_and_breaking_change( ) -> Tuple[bool, str]: logging.info("[CHANGELOG] changelog jar: {0} -> {1}".format(old_jar, new_jar)) stdout = subprocess.run( - 'mvn --no-transfer-progress clean compile exec:java -q -f {0}/eng/mgmt/changelog/pom.xml -DOLD_JAR="{1}" -DNEW_JAR="{2}"'.format( + 'mvn --no-transfer-progress clean compile exec:java -q -f {0}/eng/automation/changelog/pom.xml -DOLD_JAR="{1}" -DNEW_JAR="{2}"'.format( sdk_root, old_jar, new_jar ), stdout=subprocess.PIPE, @@ -416,12 +412,7 @@ def generate_typespec_project( check_call(tsp_cmd, sdk_root) succeeded = True except subprocess.CalledProcessError as error: - error_message = ( - f"[GENERATE][Error] Code generation failed. tsp-client init fails: {error}\n" - "If TypeSpec Validation passes, you can open an issue to https://github.com/Azure/autorest.java/issues. Please include the link of this Pull Request in the issue." - ) - logging.error(error_message) - print(error_message, file=sys.stderr) + logging.error(f"[GENERATE] Code generation failed. tsp-client init fails: {error}") return succeeded, require_sdk_integration, sdk_folder, service, module diff --git a/eng/mgmt/automation/generation.yml b/eng/automation/generation.yml similarity index 86% rename from eng/mgmt/automation/generation.yml rename to eng/automation/generation.yml index fa44feec280b..a6d67ef0d706 100644 --- a/eng/mgmt/automation/generation.yml +++ b/eng/automation/generation.yml @@ -64,14 +64,14 @@ jobs: - bash: | java -version set -x - ./eng/mgmt/automation/generate.py --tsp-config "$(TSP_CONFIG)" --version "$(VERSION)" --auto-commit-external-change --user-name "azure-sdk" --user-email "azuresdk@microsoft.com" + ./eng/automation/generate.py --tsp-config "$(TSP_CONFIG)" --version "$(VERSION)" --auto-commit-external-change --user-name "azure-sdk" --user-email "azuresdk@microsoft.com" displayName: Generation from TypeSpec condition: ${{ eq(parameters.RELEASE_TYPE, 'TypeSpec') }} - bash: | java -version set -x - ./eng/mgmt/automation/generate.py --readme "$(README)" --tag "$(TAG)" --autorest-options="$(AUTOREST_OPTIONS)" --service "$(SERVICE)" --version "$(VERSION)" --suffix "$(SUFFIX)" --auto-commit-external-change --user-name "azure-sdk" --user-email "azuresdk@microsoft.com" + ./eng/automation/generate.py --readme "$(README)" --tag "$(TAG)" --autorest-options="$(AUTOREST_OPTIONS)" --service "$(SERVICE)" --version "$(VERSION)" --suffix "$(SUFFIX)" --auto-commit-external-change --user-name "azure-sdk" --user-email "azuresdk@microsoft.com" displayName: Generation from Swagger condition: ${{ eq(parameters.RELEASE_TYPE, 'Swagger') }} diff --git a/eng/mgmt/automation/generation_data.yml b/eng/automation/generation_data.yml similarity index 81% rename from eng/mgmt/automation/generation_data.yml rename to eng/automation/generation_data.yml index 7cacdc1877c9..3a28de0af705 100644 --- a/eng/mgmt/automation/generation_data.yml +++ b/eng/automation/generation_data.yml @@ -33,7 +33,7 @@ steps: - bash: | export PATH=$JAVA_HOME_11_X64/bin:$PATH java -version - ./eng/mgmt/automation/generate_data.py --readme="$(README)" --spec-readme="$(SPEC_README)" --input-file="$(INPUT_FILE)" --service="$(SERVICE)" --module="$(MODULE)" --security="$(SECURITY)" --security-scopes="$(SECURITY_SCOPES)" --title="$(TITLE)" + ./eng/automation/generate_data.py --readme="$(README)" --spec-readme="$(SPEC_README)" --input-file="$(INPUT_FILE)" --service="$(SERVICE)" --module="$(MODULE)" --security="$(SECURITY)" --security-scopes="$(SECURITY_SCOPES)" --title="$(TITLE)" displayName: Generation - template: /eng/common/pipelines/templates/steps/create-pull-request.yml diff --git a/eng/mgmt/automation/init.sh b/eng/automation/init.sh similarity index 100% rename from eng/mgmt/automation/init.sh rename to eng/automation/init.sh diff --git a/eng/mgmt/automation/install_instruction.py b/eng/automation/install_instruction.py similarity index 97% rename from eng/mgmt/automation/install_instruction.py rename to eng/automation/install_instruction.py index 69c199bb3d8f..d1e760313186 100755 --- a/eng/mgmt/automation/install_instruction.py +++ b/eng/automation/install_instruction.py @@ -51,7 +51,7 @@ def main(): logging.basicConfig( stream=sys.stdout, level=logging.INFO, - format="%(asctime)s %(levelname)s %(message)s", + format="%(asctime)s [%(levelname)s] %(message)s", datefmt="%Y-%m-%d %X", ) main() diff --git a/eng/mgmt/automation/parameters.py b/eng/automation/parameters.py old mode 100644 new mode 100755 similarity index 96% rename from eng/mgmt/automation/parameters.py rename to eng/automation/parameters.py index 8720c4b0496f..37138ab52fec --- a/eng/mgmt/automation/parameters.py +++ b/eng/automation/parameters.py @@ -15,9 +15,9 @@ MAVEN_HOST = "https://repo1.maven.org/maven2" MAVEN_URL = MAVEN_HOST + "/{group_id}/{artifact_id}/{version}/{artifact_id}-{version}.jar" -SDK_ROOT = "../../../" # related to file dir +SDK_ROOT = "../../" # related to file dir AUTOREST_CORE_VERSION = "3.9.7" -AUTOREST_JAVA = "@autorest/java@4.1.32" +AUTOREST_JAVA = "@autorest/java@4.1.34" DEFAULT_VERSION = "1.0.0-beta.1" GROUP_ID = "com.azure.resourcemanager" API_SPECS_FILE = "api-specs.yaml" diff --git a/eng/mgmt/automation/requirement.txt b/eng/automation/requirement.txt similarity index 100% rename from eng/mgmt/automation/requirement.txt rename to eng/automation/requirement.txt diff --git a/eng/mgmt/automation/sdk_generate.py b/eng/automation/sdk_generate.py similarity index 98% rename from eng/mgmt/automation/sdk_generate.py rename to eng/automation/sdk_generate.py index ad728ef132ed..3f42de6fc3e3 100755 --- a/eng/mgmt/automation/sdk_generate.py +++ b/eng/automation/sdk_generate.py @@ -288,7 +288,7 @@ def main(): try: os.chdir(sdk_root) os.system( - "git add eng/versioning eng/mgmt pom.xml {0} {1}".format( + "git add eng/versioning eng/automation pom.xml {0} {1}".format( CI_FILE_FORMAT.format(service), POM_FILE_FORMAT.format(service) ) ) @@ -308,7 +308,7 @@ def main(): logging.basicConfig( stream=sys.stdout, level=logging.INFO, - format="%(asctime)s %(levelname)s %(message)s", + format="%(asctime)s [%(levelname)s] %(message)s", datefmt="%Y-%m-%d %X", ) main() diff --git a/eng/mgmt/automation/sdk_init.sh b/eng/automation/sdk_init.sh similarity index 100% rename from eng/mgmt/automation/sdk_init.sh rename to eng/automation/sdk_init.sh diff --git a/eng/automation/swagger_to_sdk_config.json b/eng/automation/swagger_to_sdk_config.json new file mode 100644 index 000000000000..7e605062f4eb --- /dev/null +++ b/eng/automation/swagger_to_sdk_config.json @@ -0,0 +1,28 @@ +{ + "$schema": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/documentation/sdkautomation/SwaggerToSdkConfigSchema.json", + "initOptions": { + "initScript": { + "path": "./eng/automation/init.sh", + "envs": [ + "JAVA_HOME_11_X64" + ] + } + }, + "generateOptions": { + "generateScript": { + "path": "./eng/automation/generate.py", + "logPrefix": "Java-Sdk-Automation", + "stdout": { + "showInComment": "(.*\\[ERROR\\]\\s*).*" + } + } + }, + "artifactOptions": { + "installInstructionScript": { + "path": "./eng/automation/install_instruction.py" + } + }, + "advancedOptions": { + "generationCallMode": "one-per-config" + } +} diff --git a/eng/mgmt/automation/typespec_utils.py b/eng/automation/typespec_utils.py similarity index 91% rename from eng/mgmt/automation/typespec_utils.py rename to eng/automation/typespec_utils.py index b294214fadf0..06ad1a7d8b3e 100644 --- a/eng/mgmt/automation/typespec_utils.py +++ b/eng/automation/typespec_utils.py @@ -29,7 +29,7 @@ def validate_tspconfig(tsp_dir: str) -> bool: service_dir: str = yaml_json["parameters"]["service-dir"]["default"] package_dir: str = yaml_json["options"]["@azure-tools/typespec-java"]["package-dir"] if "namespace" not in yaml_json["options"]["@azure-tools/typespec-java"]: - log_and_print_error( + logging.error( "[VALIDATE][tspconfig.yaml] " "options.@azure-tools/typespec-java.namespace is REQUIRED for Java SDK. " 'E.g. "com.azure.ai.openai".' @@ -41,7 +41,7 @@ def validate_tspconfig(tsp_dir: str) -> bool: service_dir_segments = service_dir.split("/") if not re.fullmatch(service_dir_pattern, service_dir): valid = False - log_and_print_error( + logging.error( "[VALIDATE][tspconfig.yaml] " 'parameters.service-dir.default SHOULD be "sdk/". ' "See https://azure.github.io/azure-sdk/policies_repostructure.html. " @@ -51,7 +51,7 @@ def validate_tspconfig(tsp_dir: str) -> bool: # validate package_dir if not re.fullmatch(package_dir_pattern, package_dir): valid = False - log_and_print_error( + logging.error( "[VALIDATE][tspconfig.yaml] " 'options.@azure-tools/typespec-java.package-dir SHOULD start with "azure-". ' 'E.g. "azure-ai-openai". ' @@ -61,7 +61,7 @@ def validate_tspconfig(tsp_dir: str) -> bool: # validate namespace if not re.fullmatch(namespace_pattern, namespace): valid = False - log_and_print_error( + logging.error( "[VALIDATE][tspconfig.yaml] " 'options.@azure-tools/typespec-java.namespace SHOULD start with "com.azure.". ' 'E.g. "com.azure.ai.openai". ' @@ -73,14 +73,9 @@ def validate_tspconfig(tsp_dir: str) -> bool: expected_package_dir = namespace[4:].replace(".", "-") if expected_package_dir != package_dir: valid = False - log_and_print_error( + logging.error( "[VALIDATE][tspconfig.yaml] package_dir does not match namespace. " f'Expected package_dir from namespace "{namespace}" is: {expected_package_dir}' ) return valid - - -def log_and_print_error(error_message: str): - logging.error(error_message) - print(error_message, file=sys.stderr) diff --git a/eng/mgmt/automation/utils.py b/eng/automation/utils.py similarity index 100% rename from eng/mgmt/automation/utils.py rename to eng/automation/utils.py diff --git a/eng/code-quality-reports/src/main/java/com/azure/tools/revapi/transforms/JacksonDatabindRemovalTransform.java b/eng/code-quality-reports/src/main/java/com/azure/tools/revapi/transforms/JacksonDatabindRemovalTransform.java index 0dfd9ba4b4b7..6efe6488640d 100644 --- a/eng/code-quality-reports/src/main/java/com/azure/tools/revapi/transforms/JacksonDatabindRemovalTransform.java +++ b/eng/code-quality-reports/src/main/java/com/azure/tools/revapi/transforms/JacksonDatabindRemovalTransform.java @@ -134,6 +134,10 @@ private static boolean shouldDiscard(String packageName) { } else if (packageName.regionMatches(18, "queue.models", 0, 12)) { // Queue return true; + } else if (packageName.regionMatches(18, "blob.", 0, 5)) { + // Blob + return packageName.regionMatches(23, "models", 0, 6) + || packageName.regionMatches(23, "options", 0, 7); } } else if (packageName.regionMatches(10, "communication.", 0, 14)) { if (packageName.regionMatches(24, "jobrouter.models", 0, 16)) { diff --git a/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml b/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml old mode 100755 new mode 100644 index ccf681b448f8..d7496c3ed2e9 --- a/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml +++ b/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml @@ -342,6 +342,12 @@ the main ServiceBusClientBuilder. --> files="com.azure.identity.extensions.jdbc.postgresql.AzurePostgresqlAuthenticationPlugin"/> + + + + + + @@ -360,47 +366,22 @@ the main ServiceBusClientBuilder. --> - - - - - - - - - + - - - - - - - - - - - - - - - - - - - + + diff --git a/eng/code-quality-reports/src/main/resources/revapi/revapi.json b/eng/code-quality-reports/src/main/resources/revapi/revapi.json index 1f45584be3b7..05b216e7c0cb 100644 --- a/eng/code-quality-reports/src/main/resources/revapi/revapi.json +++ b/eng/code-quality-reports/src/main/resources/revapi/revapi.json @@ -127,45 +127,82 @@ "justification": "Cosmos SDK removes Beta annotation to GA its APIs and classes." }, { - "code": "java.method.visibilityReduced", - "old": "method com.azure.spring.messaging.eventhubs.support.converter.EventHubsMessageConverter com.azure.spring.cloud.autoconfigure.eventhubs.AzureEventHubsMessagingAutoConfiguration.EventHubsTemplateConfiguration::eventHubsMessageConverter()", - "new": "method com.azure.spring.messaging.eventhubs.support.converter.EventHubsMessageConverter com.azure.spring.cloud.autoconfigure.eventhubs.AzureEventHubsMessagingAutoConfiguration.EventHubsTemplateConfiguration::eventHubsMessageConverter(com.fasterxml.jackson.databind.ObjectMapper)", - "justification": "Shouldn't have been a public API." + "code": "java.method.added", + "new": "method void com.azure.spring.cloud.autoconfigure.aadb2c.AadB2cOidcLoginConfigurer::(org.springframework.security.web.authentication.logout.LogoutSuccessHandler, org.springframework.security.oauth2.client.web.OAuth2AuthorizationRequestResolver, org.springframework.security.oauth2.client.endpoint.OAuth2AccessTokenResponseClient, org.springframework.boot.web.client.RestTemplateBuilder)", + "justification": "New method added to fix a bug." }, { - "code": "java.method.visibilityReduced", - "old": "method com.azure.spring.messaging.servicebus.support.converter.ServiceBusMessageConverter com.azure.spring.cloud.autoconfigure.servicebus.AzureServiceBusMessagingAutoConfiguration.ServiceBusTemplateConfiguration::serviceBusMessageConverter()", - "new": "method com.azure.spring.messaging.servicebus.support.converter.ServiceBusMessageConverter com.azure.spring.cloud.autoconfigure.servicebus.AzureServiceBusMessagingAutoConfiguration.ServiceBusTemplateConfiguration::serviceBusMessageConverter(com.fasterxml.jackson.databind.ObjectMapper)", - "justification": "Shouldn't have been a public API." + "code": "java.method.removed", + "old": "method java.lang.String com.azure.spring.cloud.autoconfigure.jms.properties.AzureServiceBusJmsProperties::getPassword()", + "justification": "Remove some meaningless jms properties" }, { "code": "java.method.removed", - "old": "method com.azure.spring.messaging.storage.queue.support.converter.StorageQueueMessageConverter com.azure.spring.cloud.autoconfigure.storage.AzureStorageQueueMessagingAutoConfiguration::messageConverter()", - "justification": "Shouldn't have been a public API." + "old": "method java.lang.String com.azure.spring.cloud.autoconfigure.jms.properties.AzureServiceBusJmsProperties::getRemoteUrl()", + "justification": "Remove some meaningless jms properties" }, { - "code": "java.method.added", - "new": "method void com.azure.spring.cloud.autoconfigure.aadb2c.AadB2cOidcLoginConfigurer::(org.springframework.security.web.authentication.logout.LogoutSuccessHandler, org.springframework.security.oauth2.client.web.OAuth2AuthorizationRequestResolver, org.springframework.security.oauth2.client.endpoint.OAuth2AccessTokenResponseClient, org.springframework.boot.web.client.RestTemplateBuilder)", - "justification": "New method added to fix a bug." + "code": "java.method.removed", + "old": "method java.lang.String com.azure.spring.cloud.autoconfigure.jms.properties.AzureServiceBusJmsProperties::getUsername()", + "justification": "Remove some meaningless jms properties" }, { - "regex": true, - "code": "java\\.method\\.removed", - "old": "method java\\.lang\\.String com\\.azure\\.spring\\.cloud\\.autoconfigure\\.jms\\.properties\\.AzureServiceBusJmsProperties::(getPassword|getRemoteUrl|getUsername)\\(\\)", + "code": "java.method.removed", + "old": "method void com.azure.spring.cloud.autoconfigure.jms.properties.AzureServiceBusJmsProperties::setPassword(java.lang.String)", "justification": "Remove some meaningless jms properties" }, { - "code": "java.annotation.attributeValueChanged", - "old": "class com.azure.spring.cloud.autoconfigure.jms.ServiceBusJmsAutoConfiguration", - "new": "class com.azure.spring.cloud.autoconfigure.jms.ServiceBusJmsAutoConfiguration", - "justification": "Import ServiceBusJmsPasswordlessConfiguration.class" + "code": "java.method.removed", + "old": "method void com.azure.spring.cloud.autoconfigure.jms.properties.AzureServiceBusJmsProperties::setRemoteUrl(java.lang.String)", + "justification": "Remove some meaningless jms properties" }, { - "regex": true, - "code": "java\\.method\\.removed", - "old": "method void com\\.azure\\.spring\\.cloud\\.autoconfigure\\.jms\\.properties\\.AzureServiceBusJmsProperties::(setPassword|setRemoteUrl|setUsername)\\(java\\.lang\\.String\\)", + "code": "java.method.removed", + "old": "method void com.azure.spring.cloud.autoconfigure.jms.properties.AzureServiceBusJmsProperties::setUsername(java.lang.String)", "justification": "Remove some meaningless jms properties" }, + { + "regex": true, + "code": "java.method.numberOfParametersChanged", + "old": "method void com\\.azure\\.spring\\.cloud\\.config\\.stores\\..*", + "justification": "Not a public api" + }, + { + "regex": true, + "code": "java.method.removed", + "old": "method com.azure.spring.cloud.config.resource.ConnectionPool com.azure.spring.cloud.config.AppConfigurationBootstrapConfiguration::initConnectionString(com.azure.spring.cloud.config.properties.AppConfigurationProperties)", + "justification": "Not a public api" + }, + { + "regex": true, + "code": "java.class.removed", + "old": "class com\\.azure\\.spring\\.cloud\\.config\\.resource\\.ConnectionPool", + "justification": "Not a public api" + }, + { + "regex": true, + "code": "java.class.removed", + "old": "class com\\.azure\\.spring\\.cloud\\.config\\.resource\\.Connection", + "justification": "Not a public api" + }, + { + "regex": true, + "code": "java.class.removed", + "old": "class com.azure.spring.cloud.config.stores.ClientStore", + "justification": "Not a public api" + }, + { + "ignore": true, + "code": "java.class.externalClassExposedInAPI", + "new": "interface com.azure.spring.cloud.config.AppConfigurationRefresh", + "justification": "Thi isn't an external class" + }, + { + "regex": true, + "code": "java\\.class\\.externalClassExposedInAPI", + "new": "(interface|class|enum) com\\.mysql\\.cj\\..*", + "justification": "Mysql driver classes are allowed to be exposed by dependencies using them." + }, { "code": "java.method.addedToInterface", "new": "method void com.azure.spring.cloud.resourcemanager.provisioning.ServiceBusProvisioner::provisionQueue(java.lang.String, java.lang.String, com.azure.spring.cloud.resourcemanager.provisioning.properties.ServiceBusQueueProperties)", @@ -218,11 +255,6 @@ "old": "enum com.azure.messaging.eventhubs.checkpointstore.blob.Messages", "justification": "Messages class was accidentally made public. Reverting the public change since this should be implementation detail." }, - { - "code": "java.method.numberOfParametersChanged", - "new": "method void com.azure.spring.cloud.autoconfigure.aadb2c.AadB2cAutoConfiguration::(org.springframework.boot.web.client.RestTemplateBuilder)", - "justification": "Bean configuration will not be used by customer in java code." - }, { "ignore": true, "code": "java.annotation.removed", @@ -318,18 +350,15 @@ "justification": "Remove this because AZURE_GERMANY is deprecated." }, { - "regex": true, - "code": "java.annotation.removed", - "old": "class com.azure.spring.cloud.autoconfigure.aad.configuration.(AadResourceServerConfiguration.DefaultAadResourceServerWebSecurityConfigurerAdapter|AadWebApplicationConfiguration.DefaultAadWebSecurityConfigurerAdapter)", - "new": "class com.azure.spring.cloud.autoconfigure.aad.configuration.(AadResourceServerConfiguration.DefaultAadResourceServerWebSecurityConfigurerAdapter|AadWebApplicationConfiguration.DefaultAadWebSecurityConfigurerAdapter)", - "justification": "Element no longer annotated with 'org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean'." + "code": "java.method.addedToInterface", + "new": "method void com.azure.spring.cloud.resourcemanager.provisioning.ServiceBusProvisioner::provisionQueue(java.lang.String, java.lang.String, com.azure.spring.cloud.resourcemanager.provisioning.properties.ServiceBusQueueProperties)", + "justification": "New method added to support more properties." }, { "regex": true, - "code": "java.annotation.added", - "old": "class com.azure.spring.cloud.autoconfigure.aad.configuration.(AadResourceServerConfiguration.DefaultAadResourceServerWebSecurityConfigurerAdapter|AadWebApplicationConfiguration.DefaultAadWebSecurityConfigurerAdapter)", - "new": "class com.azure.spring.cloud.autoconfigure.aad.configuration.(AadResourceServerConfiguration.DefaultAadResourceServerWebSecurityConfigurerAdapter|AadWebApplicationConfiguration.DefaultAadWebSecurityConfigurerAdapter)", - "justification": "Element newly annotated with 'org.springframework.boot.autoconfigure.security.ConditionalOnDefaultWebSecurity" + "code": "java.class.externalClassExposedInAPI", + "new": "class com.azure.spring.cloud.stream.binder.servicebus.core.properties.(ServiceBusProducerProperties|ServiceBusConsumerProperties)", + "justification": "Support new properties." }, { "regex": true, @@ -363,6 +392,21 @@ "new": "class com.azure.cosmos.models.ChangeFeedProcessorItem", "justification": "Modifies the type of changeFeedMetaData from ChangeFeedMetaData to JsonNode." }, + { + "code" : "java.field.removed", + "old" : "field com.mysql.cj.conf.PropertyKey.ociConfigProfile", + "justification" : "Fix field removed." + }, + { + "code" : "java.method.addedToInterface", + "new" : "method int com.mysql.cj.protocol.ServerSession::getOldStatusFlags()", + "justification" : "Method was added to an interface." + }, + { + "code" : "java.method.addedToInterface", + "new" : "method void com.mysql.cj.protocol.ServerSession::setOldStatusFlags(int)", + "justification" : "Method was added to an interface." + }, { "code": "java.annotation.added", "old": "method com.azure.cosmos.CosmosDiagnosticsContext com.azure.cosmos.CosmosDiagnostics::getDiagnosticsContext()", @@ -492,6 +536,52 @@ "old" : ".*? com\\.azure\\.communication\\.callautomation\\.models.*", "new" : ".*? com\\.azure\\.communication\\.callautomation\\.models.*", "justification": "Migration to azure-json" + }, + { + "regex": true, + "code" : "java\\.annotation\\.removed", + "old" : ".*? com\\.azure\\.communication\\.chat\\.models.*", + "new" : ".*? com\\.azure\\.communication\\.chat\\.models.*", + "justification": "Migration to azure-json" + }, + { + "code": "java.class.nowFinal", + "old" : "class com.azure.resourcemanager.eventhubs.models.Identity", + "new" : "class com.azure.resourcemanager.eventhubs.models.Identity", + "justification": "Class is now final." + }, + { + "code": "java.class.nowFinal", + "old" : "class com.azure.resourcemanager.eventhubs.models.UserAssignedIdentity", + "new" : "class com.azure.resourcemanager.eventhubs.models.UserAssignedIdentity", + "justification": "Class is now final." + }, + { + "code" : "java.method.returnTypeTypeParametersChanged", + "old" : "method java.util.List com.azure.resourcemanager.compute.models.SecurityPostureReference::excludeExtensions()", + "new" : "method java.util.List com.azure.resourcemanager.compute.models.SecurityPostureReference::excludeExtensions()", + "justification": "Service breaks but no customer onboard." + }, + { + "code" : "java.method.parameterTypeParameterChanged", + "old" : "parameter com.azure.resourcemanager.compute.models.SecurityPostureReference com.azure.resourcemanager.compute.models.SecurityPostureReference::withExcludeExtensions(===java.util.List===)", + "new" : "parameter com.azure.resourcemanager.compute.models.SecurityPostureReference com.azure.resourcemanager.compute.models.SecurityPostureReference::withExcludeExtensions(===java.util.List===)", + "justification": "Service breaks but no customer onboard." + }, + { + "code" : "java.class.removed", + "old" : "class com.azure.resourcemanager.containerservice.models.OSOptionProperty", + "justification": "Removed non-functional API `getOsOptions` and related models `OSOptionProperty`" + }, + { + "code": "java.method.removed", + "old" : "method com.azure.resourcemanager.network.models.FirewallPacketCaptureParameters com.azure.resourcemanager.network.models.FirewallPacketCaptureParameters::withId(java.lang.String)", + "justification": "service bug fix." + }, + { + "code": "java.missing.oldSuperType", + "old": "class com.azure.resourcemanager.network.models.FirewallPacketCaptureParameters", + "justification": "service bug fix." } ] } diff --git a/eng/code-quality-reports/src/main/resources/spotbugs/spotbugs-exclude.xml b/eng/code-quality-reports/src/main/resources/spotbugs/spotbugs-exclude.xml index 81bd9109b63c..2b1257ba70c1 100644 --- a/eng/code-quality-reports/src/main/resources/spotbugs/spotbugs-exclude.xml +++ b/eng/code-quality-reports/src/main/resources/spotbugs/spotbugs-exclude.xml @@ -1999,13 +1999,13 @@ - + - + @@ -2015,17 +2015,16 @@ - + - - - + + + - - - + + diff --git a/eng/codegen_to_sdk_config.json b/eng/codegen_to_sdk_config.json index c8ccb9c172ef..a8f592eb755d 100644 --- a/eng/codegen_to_sdk_config.json +++ b/eng/codegen_to_sdk_config.json @@ -1,12 +1,12 @@ { "init": { "initScript": { - "path": "./eng/mgmt/automation/sdk_init.sh" + "path": "./eng/automation/sdk_init.sh" } }, "generateAndBuild": { "generateAndBuildScript": { - "path": "./eng/mgmt/automation/sdk_generate.py", + "path": "./eng/automation/sdk_generate.py", "script": "python3" } } diff --git a/eng/common/InterdependencyGraph.html b/eng/common/InterdependencyGraph.html deleted file mode 100644 index 21f78563ed42..000000000000 --- a/eng/common/InterdependencyGraph.html +++ /dev/null @@ -1,356 +0,0 @@ - - - -Interdependency Graph - - - - - - - - -
-

Dependency Graph

- - -
-
-
- - - diff --git a/eng/common/TestResources/New-TestResources.ps1 b/eng/common/TestResources/New-TestResources.ps1 index 6ee09ff3b23e..6ccf55a781c1 100644 --- a/eng/common/TestResources/New-TestResources.ps1 +++ b/eng/common/TestResources/New-TestResources.ps1 @@ -117,6 +117,8 @@ param ( $NewTestResourcesRemainingArguments ) +. (Join-Path $PSScriptRoot .. scripts Helpers Resource-Helpers.ps1) +. $PSScriptRoot/TestResources-Helpers.ps1 . $PSScriptRoot/SubConfig-Helpers.ps1 if (!$ServicePrincipalAuth) { @@ -131,272 +133,6 @@ if (!$PSBoundParameters.ContainsKey('ErrorAction')) { $ErrorActionPreference = 'Stop' } -function Log($Message) -{ - Write-Host ('{0} - {1}' -f [DateTime]::Now.ToLongTimeString(), $Message) -} - -# vso commands are specially formatted log lines that are parsed by Azure Pipelines -# to perform additional actions, most commonly marking values as secrets. -# https://docs.microsoft.com/en-us/azure/devops/pipelines/scripts/logging-commands -function LogVsoCommand([string]$message) -{ - if (!$CI -or $SuppressVsoCommands) { - return - } - Write-Host $message -} - -function Retry([scriptblock] $Action, [int] $Attempts = 5) -{ - $attempt = 0 - $sleep = 5 - - while ($attempt -lt $Attempts) { - try { - $attempt++ - return $Action.Invoke() - } catch { - if ($attempt -lt $Attempts) { - $sleep *= 2 - - Write-Warning "Attempt $attempt failed: $_. Trying again in $sleep seconds..." - Start-Sleep -Seconds $sleep - } else { - throw - } - } - } -} - -# NewServicePrincipalWrapper creates an object from an AAD graph or Microsoft Graph service principal object type. -# This is necessary to work around breaking changes introduced in Az version 7.0.0: -# https://azure.microsoft.com/en-us/updates/update-your-apps-to-use-microsoft-graph-before-30-june-2022/ -function NewServicePrincipalWrapper([string]$subscription, [string]$resourceGroup, [string]$displayName) -{ - if ((Get-Module Az.Resources).Version -eq "5.3.0") { - # https://github.com/Azure/azure-powershell/issues/17040 - # New-AzAdServicePrincipal calls will fail with: - # "You cannot call a method on a null-valued expression." - Write-Warning "Az.Resources version 5.3.0 is not supported. Please update to >= 5.3.1" - Write-Warning "Update-Module Az.Resources -RequiredVersion 5.3.1" - exit 1 - } - - try { - $servicePrincipal = Retry { - New-AzADServicePrincipal -Role "Owner" -Scope "/subscriptions/$SubscriptionId/resourceGroups/$ResourceGroupName" -DisplayName $displayName - } - } catch { - # The underlying error "The directory object quota limit for the Principal has been exceeded" gets overwritten by the module trying - # to call New-AzADApplication with a null object instead of stopping execution, which makes this case hard to diagnose because it prints the following: - # "Cannot bind argument to parameter 'ObjectId' because it is an empty string." - # Provide a more helpful diagnostic prompt to the user if appropriate: - $totalApps = (Get-AzADApplication -OwnedApplication).Length - $msg = "App Registrations owned by you total $totalApps and may exceed the max quota (likely around 135)." + ` - "`nTry removing some at https://ms.portal.azure.com/#view/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/~/RegisteredApps" + ` - " or by running the following command to remove apps created by this script:" + ` - "`n Get-AzADApplication -DisplayNameStartsWith '$baseName' | Remove-AzADApplication" + ` - "`nNOTE: You may need to wait for the quota number to be updated after removing unused applications." - Write-Warning $msg - throw - } - - $spPassword = "" - $appId = "" - if (Get-Member -Name "Secret" -InputObject $servicePrincipal -MemberType property) { - Write-Verbose "Using legacy PSADServicePrincipal object type from AAD graph API" - # Secret property exists on PSADServicePrincipal type from AAD graph in Az # module versions < 7.0.0 - $spPassword = $servicePrincipal.Secret - $appId = $servicePrincipal.ApplicationId - } else { - if ((Get-Module Az.Resources).Version -eq "5.1.0") { - Write-Verbose "Creating password and credential for service principal via MS Graph API" - Write-Warning "Please update Az.Resources to >= 5.2.0 by running 'Update-Module Az'" - # Microsoft graph objects (Az.Resources version == 5.1.0) do not provision a secret on creation so it must be added separately. - # Submitting a password credential object without specifying a password will result in one being generated on the server side. - $password = New-Object -TypeName "Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPasswordCredential" - $password.DisplayName = "Password for $displayName" - $credential = Retry { New-AzADSpCredential -PasswordCredentials $password -ServicePrincipalObject $servicePrincipal -ErrorAction 'Stop' } - $spPassword = ConvertTo-SecureString $credential.SecretText -AsPlainText -Force - $appId = $servicePrincipal.AppId - } else { - Write-Verbose "Creating service principal credential via MS Graph API" - # In 5.2.0 the password credential issue was fixed (see https://github.com/Azure/azure-powershell/pull/16690) but the - # parameter set was changed making the above call fail due to a missing ServicePrincipalId parameter. - $credential = Retry { $servicePrincipal | New-AzADSpCredential -ErrorAction 'Stop' } - $spPassword = ConvertTo-SecureString $credential.SecretText -AsPlainText -Force - $appId = $servicePrincipal.AppId - } - } - - return @{ - AppId = $appId - ApplicationId = $appId - # This is the ObjectId/OID but most return objects use .Id so keep it consistent to prevent confusion - Id = $servicePrincipal.Id - DisplayName = $servicePrincipal.DisplayName - Secret = $spPassword - } -} - -function LoadCloudConfig([string] $env) -{ - $configPath = "$PSScriptRoot/clouds/$env.json" - if (!(Test-Path $configPath)) { - Write-Warning "Could not find cloud configuration for environment '$env'" - return @{} - } - - $config = Get-Content $configPath | ConvertFrom-Json -AsHashtable - return $config -} - -function MergeHashes([hashtable] $source, [psvariable] $dest) -{ - foreach ($key in $source.Keys) { - if ($dest.Value.Contains($key) -and $dest.Value[$key] -ne $source[$key]) { - Write-Warning ("Overwriting '$($dest.Name).$($key)' with value '$($dest.Value[$key])' " + - "to new value '$($source[$key])'") - } - $dest.Value[$key] = $source[$key] - } -} - -function BuildBicepFile([System.IO.FileSystemInfo] $file) -{ - if (!(Get-Command bicep -ErrorAction Ignore)) { - Write-Error "A bicep file was found at '$($file.FullName)' but the Azure Bicep CLI is not installed. See aka.ms/bicep-install" - throw - } - - $tmp = $env:TEMP ? $env:TEMP : [System.IO.Path]::GetTempPath() - $templateFilePath = Join-Path $tmp "$ResourceType-resources.$(New-Guid).compiled.json" - - # Az can deploy bicep files natively, but by compiling here it becomes easier to parse the - # outputted json for mismatched parameter declarations. - bicep build $file.FullName --outfile $templateFilePath - if ($LASTEXITCODE) { - Write-Error "Failure building bicep file '$($file.FullName)'" - throw - } - - return $templateFilePath -} - -function BuildDeploymentOutputs([string]$serviceName, [object]$azContext, [object]$deployment, [hashtable]$environmentVariables) { - $serviceDirectoryPrefix = BuildServiceDirectoryPrefix $serviceName - # Add default values - $deploymentOutputs = [Ordered]@{ - "${serviceDirectoryPrefix}SUBSCRIPTION_ID" = $azContext.Subscription.Id; - "${serviceDirectoryPrefix}RESOURCE_GROUP" = $resourceGroup.ResourceGroupName; - "${serviceDirectoryPrefix}LOCATION" = $resourceGroup.Location; - "${serviceDirectoryPrefix}ENVIRONMENT" = $azContext.Environment.Name; - "${serviceDirectoryPrefix}AZURE_AUTHORITY_HOST" = $azContext.Environment.ActiveDirectoryAuthority; - "${serviceDirectoryPrefix}RESOURCE_MANAGER_URL" = $azContext.Environment.ResourceManagerUrl; - "${serviceDirectoryPrefix}SERVICE_MANAGEMENT_URL" = $azContext.Environment.ServiceManagementUrl; - "AZURE_SERVICE_DIRECTORY" = $serviceName.ToUpperInvariant(); - } - - if ($ServicePrincipalAuth) { - $deploymentOutputs["${serviceDirectoryPrefix}CLIENT_ID"] = $TestApplicationId; - $deploymentOutputs["${serviceDirectoryPrefix}CLIENT_SECRET"] = $TestApplicationSecret; - $deploymentOutputs["${serviceDirectoryPrefix}TENANT_ID"] = $azContext.Tenant.Id; - } - - MergeHashes $environmentVariables $(Get-Variable deploymentOutputs) - - foreach ($key in $deployment.Outputs.Keys) { - $variable = $deployment.Outputs[$key] - - # Work around bug that makes the first few characters of environment variables be lowercase. - $key = $key.ToUpperInvariant() - - if ($variable.Type -eq 'String' -or $variable.Type -eq 'SecureString') { - $deploymentOutputs[$key] = $variable.Value - } - } - - # Force capitalization of all keys to avoid Azure Pipelines confusion with - # variable auto-capitalization and OS env var capitalization differences - $capitalized = @{} - foreach ($item in $deploymentOutputs.GetEnumerator()) { - $capitalized[$item.Name.ToUpperInvariant()] = $item.Value - } - - return $capitalized -} - -function SetDeploymentOutputs( - [string]$serviceName, - [object]$azContext, - [object]$deployment, - [object]$templateFile, - [hashtable]$environmentVariables = @{} -) { - $deploymentEnvironmentVariables = $environmentVariables.Clone() - $deploymentOutputs = BuildDeploymentOutputs $serviceName $azContext $deployment $deploymentEnvironmentVariables - - if ($OutFile) { - if (!$IsWindows) { - Write-Host 'File option is supported only on Windows' - } - - $outputFile = "$($templateFile.originalFilePath).env" - - $environmentText = $deploymentOutputs | ConvertTo-Json; - $bytes = [System.Text.Encoding]::UTF8.GetBytes($environmentText) - $protectedBytes = [Security.Cryptography.ProtectedData]::Protect($bytes, $null, [Security.Cryptography.DataProtectionScope]::CurrentUser) - - Set-Content $outputFile -Value $protectedBytes -AsByteStream -Force - - Write-Host "Test environment settings`n $environmentText`nstored into encrypted $outputFile" - } else { - if (!$CI) { - # Write an extra new line to isolate the environment variables for easy reading. - Log "Persist the following environment variables based on your detected shell ($shell):`n" - } - - # Write overwrite warnings first, since local execution prints a runnable command to export variables - foreach ($key in $deploymentOutputs.Keys) { - if ([Environment]::GetEnvironmentVariable($key)) { - Write-Warning "Deployment outputs will overwrite pre-existing environment variable '$key'" - } - } - - # Marking values as secret by allowed keys below is not sufficient, as there may be outputs set in the ARM/bicep - # file that re-mark those values as secret (since all user-provided deployment outputs are treated as secret by default). - # This variable supports a second check on not marking previously allowed keys/values as secret. - $notSecretValues = @() - foreach ($key in $deploymentOutputs.Keys) { - $value = $deploymentOutputs[$key] - $deploymentEnvironmentVariables[$key] = $value - - if ($CI) { - if (ShouldMarkValueAsSecret $serviceName $key $value $notSecretValues) { - # Treat all ARM template output variables as secrets since "SecureString" variables do not set values. - # In order to mask secrets but set environment variables for any given ARM template, we set variables twice as shown below. - LogVsoCommand "##vso[task.setvariable variable=_$key;issecret=true;]$value" - Write-Host "Setting variable as secret '$key'" - } else { - Write-Host "Setting variable '$key': $value" - $notSecretValues += $value - } - LogVsoCommand "##vso[task.setvariable variable=$key;]$value" - } else { - Write-Host ($shellExportFormat -f $key, $value) - } - } - - if ($key) { - # Isolate the environment variables for easy reading. - Write-Host "`n" - $key = $null - } - } - - return $deploymentEnvironmentVariables, $deploymentOutputs -} # Support actions to invoke on exit. $exitActions = @({ @@ -843,31 +579,7 @@ try { -templateFile $templateFile ` -environmentVariables $EnvironmentVariables - $storageAccounts = Retry { Get-AzResource -ResourceGroupName $ResourceGroupName -ResourceType "Microsoft.Storage/storageAccounts" } - # Add client IP to storage account when running as local user. Pipeline's have their own vnet with access - if ($storageAccounts) { - foreach ($account in $storageAccounts) { - $rules = Get-AzStorageAccountNetworkRuleSet -ResourceGroupName $ResourceGroupName -AccountName $account.Name - if ($rules -and $rules.DefaultAction -eq "Allow") { - Write-Host "Restricting network rules in storage account '$($account.Name)' to deny access by default" - Retry { Update-AzStorageAccountNetworkRuleSet -ResourceGroupName $ResourceGroupName -Name $account.Name -DefaultAction Deny } - if ($CI -and $env:PoolSubnet) { - Write-Host "Enabling access to '$($account.Name)' from pipeline subnet $($env:PoolSubnet)" - Retry { Add-AzStorageAccountNetworkRule -ResourceGroupName $ResourceGroupName -Name $account.Name -VirtualNetworkResourceId $env:PoolSubnet } - } elseif ($AllowIpRanges) { - Write-Host "Enabling access to '$($account.Name)' to $($AllowIpRanges.Length) IP ranges" - $ipRanges = $AllowIpRanges | ForEach-Object { - @{ Action = 'allow'; IPAddressOrRange = $_ } - } - Retry { Update-AzStorageAccountNetworkRuleSet -ResourceGroupName $ResourceGroupName -Name $account.Name -IPRule $ipRanges | Out-Null } - } elseif (!$CI) { - Write-Host "Enabling access to '$($account.Name)' from client IP" - $clientIp ??= Retry { Invoke-RestMethod -Uri 'https://icanhazip.com/' } # cloudflare owned ip site - Retry { Add-AzStorageAccountNetworkRule -ResourceGroupName $ResourceGroupName -Name $account.Name -IPAddressOrRange $clientIp | Out-Null } - } - } - } - } + SetResourceNetworkAccessRules -ResourceGroupName $ResourceGroupName -AllowIpRanges $AllowIpRanges -CI:$CI $postDeploymentScript = $templateFile.originalFilePath | Split-Path | Join-Path -ChildPath "$ResourceType-resources-post.ps1" if (Test-Path $postDeploymentScript) { diff --git a/eng/common/TestResources/Remove-TestResources.ps1 b/eng/common/TestResources/Remove-TestResources.ps1 index 490b41b8ebe9..12411c4ee2aa 100644 --- a/eng/common/TestResources/Remove-TestResources.ps1 +++ b/eng/common/TestResources/Remove-TestResources.ps1 @@ -61,6 +61,19 @@ param ( [Parameter()] [switch] $ServicePrincipalAuth, + # List of CIDR ranges to add to specific resource firewalls, e.g. @(10.100.0.0/16, 10.200.0.0/16) + [Parameter()] + [ValidateCount(0,399)] + [Validatescript({ + foreach ($range in $PSItem) { + if ($range -like '*/31' -or $range -like '*/32') { + throw "Firewall IP Ranges cannot contain a /31 or /32 CIDR" + } + } + return $true + })] + [array] $AllowIpRanges = @(), + [Parameter()] [switch] $Force, @@ -69,6 +82,9 @@ param ( $RemoveTestResourcesRemainingArguments ) +. (Join-Path $PSScriptRoot .. scripts Helpers Resource-Helpers.ps1) +. (Join-Path $PSScriptRoot TestResources-Helpers.ps1) + # By default stop for any error. if (!$PSBoundParameters.ContainsKey('ErrorAction')) { $ErrorActionPreference = 'Stop' @@ -241,6 +257,9 @@ $verifyDeleteScript = { # Get any resources that can be purged after the resource group is deleted coerced into a collection even if empty. $purgeableResources = Get-PurgeableGroupResources $ResourceGroupName +SetResourceNetworkAccessRules -ResourceGroupName $ResourceGroupName -AllowIpRanges $AllowIpRanges -SetFirewall -CI:$CI +Remove-WormStorageAccounts -GroupPrefix $ResourceGroupName -CI:$CI + Log "Deleting resource group '$ResourceGroupName'" if ($Force -and !$purgeableResources) { Remove-AzResourceGroup -Name "$ResourceGroupName" -Force:$Force -AsJob diff --git a/eng/common/TestResources/TestResources-Helpers.ps1 b/eng/common/TestResources/TestResources-Helpers.ps1 new file mode 100644 index 000000000000..6dee017aec9a --- /dev/null +++ b/eng/common/TestResources/TestResources-Helpers.ps1 @@ -0,0 +1,267 @@ +function Log($Message) { + Write-Host ('{0} - {1}' -f [DateTime]::Now.ToLongTimeString(), $Message) +} + +# vso commands are specially formatted log lines that are parsed by Azure Pipelines +# to perform additional actions, most commonly marking values as secrets. +# https://docs.microsoft.com/en-us/azure/devops/pipelines/scripts/logging-commands +function LogVsoCommand([string]$message) { + if (!$CI -or $SuppressVsoCommands) { + return + } + Write-Host $message +} + +function Retry([scriptblock] $Action, [int] $Attempts = 5) { + $attempt = 0 + $sleep = 5 + + while ($attempt -lt $Attempts) { + try { + $attempt++ + return $Action.Invoke() + } + catch { + if ($attempt -lt $Attempts) { + $sleep *= 2 + + Write-Warning "Attempt $attempt failed: $_. Trying again in $sleep seconds..." + Start-Sleep -Seconds $sleep + } + else { + throw + } + } + } +} + +# NewServicePrincipalWrapper creates an object from an AAD graph or Microsoft Graph service principal object type. +# This is necessary to work around breaking changes introduced in Az version 7.0.0: +# https://azure.microsoft.com/en-us/updates/update-your-apps-to-use-microsoft-graph-before-30-june-2022/ +function NewServicePrincipalWrapper([string]$subscription, [string]$resourceGroup, [string]$displayName) { + if ((Get-Module Az.Resources).Version -eq "5.3.0") { + # https://github.com/Azure/azure-powershell/issues/17040 + # New-AzAdServicePrincipal calls will fail with: + # "You cannot call a method on a null-valued expression." + Write-Warning "Az.Resources version 5.3.0 is not supported. Please update to >= 5.3.1" + Write-Warning "Update-Module Az.Resources -RequiredVersion 5.3.1" + exit 1 + } + + try { + $servicePrincipal = Retry { + New-AzADServicePrincipal -Role "Owner" -Scope "/subscriptions/$SubscriptionId/resourceGroups/$ResourceGroupName" -DisplayName $displayName + } + } + catch { + # The underlying error "The directory object quota limit for the Principal has been exceeded" gets overwritten by the module trying + # to call New-AzADApplication with a null object instead of stopping execution, which makes this case hard to diagnose because it prints the following: + # "Cannot bind argument to parameter 'ObjectId' because it is an empty string." + # Provide a more helpful diagnostic prompt to the user if appropriate: + $totalApps = (Get-AzADApplication -OwnedApplication).Length + $msg = "App Registrations owned by you total $totalApps and may exceed the max quota (likely around 135)." + ` + "`nTry removing some at https://ms.portal.azure.com/#view/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/~/RegisteredApps" + ` + " or by running the following command to remove apps created by this script:" + ` + "`n Get-AzADApplication -DisplayNameStartsWith '$baseName' | Remove-AzADApplication" + ` + "`nNOTE: You may need to wait for the quota number to be updated after removing unused applications." + Write-Warning $msg + throw + } + + $spPassword = "" + $appId = "" + if (Get-Member -Name "Secret" -InputObject $servicePrincipal -MemberType property) { + Write-Verbose "Using legacy PSADServicePrincipal object type from AAD graph API" + # Secret property exists on PSADServicePrincipal type from AAD graph in Az # module versions < 7.0.0 + $spPassword = $servicePrincipal.Secret + $appId = $servicePrincipal.ApplicationId + } + else { + if ((Get-Module Az.Resources).Version -eq "5.1.0") { + Write-Verbose "Creating password and credential for service principal via MS Graph API" + Write-Warning "Please update Az.Resources to >= 5.2.0 by running 'Update-Module Az'" + # Microsoft graph objects (Az.Resources version == 5.1.0) do not provision a secret on creation so it must be added separately. + # Submitting a password credential object without specifying a password will result in one being generated on the server side. + $password = New-Object -TypeName "Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPasswordCredential" + $password.DisplayName = "Password for $displayName" + $credential = Retry { New-AzADSpCredential -PasswordCredentials $password -ServicePrincipalObject $servicePrincipal -ErrorAction 'Stop' } + $spPassword = ConvertTo-SecureString $credential.SecretText -AsPlainText -Force + $appId = $servicePrincipal.AppId + } + else { + Write-Verbose "Creating service principal credential via MS Graph API" + # In 5.2.0 the password credential issue was fixed (see https://github.com/Azure/azure-powershell/pull/16690) but the + # parameter set was changed making the above call fail due to a missing ServicePrincipalId parameter. + $credential = Retry { $servicePrincipal | New-AzADSpCredential -ErrorAction 'Stop' } + $spPassword = ConvertTo-SecureString $credential.SecretText -AsPlainText -Force + $appId = $servicePrincipal.AppId + } + } + + return @{ + AppId = $appId + ApplicationId = $appId + # This is the ObjectId/OID but most return objects use .Id so keep it consistent to prevent confusion + Id = $servicePrincipal.Id + DisplayName = $servicePrincipal.DisplayName + Secret = $spPassword + } +} + +function LoadCloudConfig([string] $env) { + $configPath = "$PSScriptRoot/clouds/$env.json" + if (!(Test-Path $configPath)) { + Write-Warning "Could not find cloud configuration for environment '$env'" + return @{} + } + + $config = Get-Content $configPath | ConvertFrom-Json -AsHashtable + return $config +} + +function MergeHashes([hashtable] $source, [psvariable] $dest) { + foreach ($key in $source.Keys) { + if ($dest.Value.Contains($key) -and $dest.Value[$key] -ne $source[$key]) { + Write-Warning ("Overwriting '$($dest.Name).$($key)' with value '$($dest.Value[$key])' " + + "to new value '$($source[$key])'") + } + $dest.Value[$key] = $source[$key] + } +} + +function BuildBicepFile([System.IO.FileSystemInfo] $file) { + if (!(Get-Command bicep -ErrorAction Ignore)) { + Write-Error "A bicep file was found at '$($file.FullName)' but the Azure Bicep CLI is not installed. See aka.ms/bicep-install" + throw + } + + $tmp = $env:TEMP ? $env:TEMP : [System.IO.Path]::GetTempPath() + $templateFilePath = Join-Path $tmp "$ResourceType-resources.$(New-Guid).compiled.json" + + # Az can deploy bicep files natively, but by compiling here it becomes easier to parse the + # outputted json for mismatched parameter declarations. + bicep build $file.FullName --outfile $templateFilePath + if ($LASTEXITCODE) { + Write-Error "Failure building bicep file '$($file.FullName)'" + throw + } + + return $templateFilePath +} + +function BuildDeploymentOutputs([string]$serviceName, [object]$azContext, [object]$deployment, [hashtable]$environmentVariables) { + $serviceDirectoryPrefix = BuildServiceDirectoryPrefix $serviceName + # Add default values + $deploymentOutputs = [Ordered]@{ + "${serviceDirectoryPrefix}SUBSCRIPTION_ID" = $azContext.Subscription.Id; + "${serviceDirectoryPrefix}RESOURCE_GROUP" = $resourceGroup.ResourceGroupName; + "${serviceDirectoryPrefix}LOCATION" = $resourceGroup.Location; + "${serviceDirectoryPrefix}ENVIRONMENT" = $azContext.Environment.Name; + "${serviceDirectoryPrefix}AZURE_AUTHORITY_HOST" = $azContext.Environment.ActiveDirectoryAuthority; + "${serviceDirectoryPrefix}RESOURCE_MANAGER_URL" = $azContext.Environment.ResourceManagerUrl; + "${serviceDirectoryPrefix}SERVICE_MANAGEMENT_URL" = $azContext.Environment.ServiceManagementUrl; + "AZURE_SERVICE_DIRECTORY" = $serviceName.ToUpperInvariant(); + } + + if ($ServicePrincipalAuth) { + $deploymentOutputs["${serviceDirectoryPrefix}CLIENT_ID"] = $TestApplicationId; + $deploymentOutputs["${serviceDirectoryPrefix}CLIENT_SECRET"] = $TestApplicationSecret; + $deploymentOutputs["${serviceDirectoryPrefix}TENANT_ID"] = $azContext.Tenant.Id; + } + + MergeHashes $environmentVariables $(Get-Variable deploymentOutputs) + + foreach ($key in $deployment.Outputs.Keys) { + $variable = $deployment.Outputs[$key] + + # Work around bug that makes the first few characters of environment variables be lowercase. + $key = $key.ToUpperInvariant() + + if ($variable.Type -eq 'String' -or $variable.Type -eq 'SecureString') { + $deploymentOutputs[$key] = $variable.Value + } + } + + # Force capitalization of all keys to avoid Azure Pipelines confusion with + # variable auto-capitalization and OS env var capitalization differences + $capitalized = @{} + foreach ($item in $deploymentOutputs.GetEnumerator()) { + $capitalized[$item.Name.ToUpperInvariant()] = $item.Value + } + + return $capitalized +} + +function SetDeploymentOutputs( + [string]$serviceName, + [object]$azContext, + [object]$deployment, + [object]$templateFile, + [hashtable]$environmentVariables = @{} +) { + $deploymentEnvironmentVariables = $environmentVariables.Clone() + $deploymentOutputs = BuildDeploymentOutputs $serviceName $azContext $deployment $deploymentEnvironmentVariables + + if ($OutFile) { + if (!$IsWindows) { + Write-Host 'File option is supported only on Windows' + } + + $outputFile = "$($templateFile.originalFilePath).env" + + $environmentText = $deploymentOutputs | ConvertTo-Json; + $bytes = [System.Text.Encoding]::UTF8.GetBytes($environmentText) + $protectedBytes = [Security.Cryptography.ProtectedData]::Protect($bytes, $null, [Security.Cryptography.DataProtectionScope]::CurrentUser) + + Set-Content $outputFile -Value $protectedBytes -AsByteStream -Force + + Write-Host "Test environment settings`n $environmentText`nstored into encrypted $outputFile" + } + else { + if (!$CI) { + # Write an extra new line to isolate the environment variables for easy reading. + Log "Persist the following environment variables based on your detected shell ($shell):`n" + } + + # Write overwrite warnings first, since local execution prints a runnable command to export variables + foreach ($key in $deploymentOutputs.Keys) { + if ([Environment]::GetEnvironmentVariable($key)) { + Write-Warning "Deployment outputs will overwrite pre-existing environment variable '$key'" + } + } + + # Marking values as secret by allowed keys below is not sufficient, as there may be outputs set in the ARM/bicep + # file that re-mark those values as secret (since all user-provided deployment outputs are treated as secret by default). + # This variable supports a second check on not marking previously allowed keys/values as secret. + $notSecretValues = @() + foreach ($key in $deploymentOutputs.Keys) { + $value = $deploymentOutputs[$key] + $deploymentEnvironmentVariables[$key] = $value + + if ($CI) { + if (ShouldMarkValueAsSecret $serviceName $key $value $notSecretValues) { + # Treat all ARM template output variables as secrets since "SecureString" variables do not set values. + # In order to mask secrets but set environment variables for any given ARM template, we set variables twice as shown below. + LogVsoCommand "##vso[task.setvariable variable=_$key;issecret=true;]$value" + Write-Host "Setting variable as secret '$key'" + } + else { + Write-Host "Setting variable '$key': $value" + $notSecretValues += $value + } + LogVsoCommand "##vso[task.setvariable variable=$key;]$value" + } + else { + Write-Host ($shellExportFormat -f $key, $value) + } + } + + if ($key) { + # Isolate the environment variables for easy reading. + Write-Host "`n" + $key = $null + } + } + + return $deploymentEnvironmentVariables, $deploymentOutputs +} diff --git a/eng/common/TestResources/build-test-resource-config.yml b/eng/common/TestResources/build-test-resource-config.yml index 56d7fa4e96ac..e3dd30644955 100644 --- a/eng/common/TestResources/build-test-resource-config.yml +++ b/eng/common/TestResources/build-test-resource-config.yml @@ -16,7 +16,7 @@ parameters: steps: - task: AzurePowerShell@5 displayName: Set Pipeline Subnet Info - condition: ne(variables['Pool'], '') + condition: and(succeeded(), ne(variables['Pool'], '')) env: ${{ parameters.EnvVars }} inputs: azureSubscription: azure-sdk-tests diff --git a/eng/common/TestResources/remove-test-resources.yml b/eng/common/TestResources/remove-test-resources.yml index b877d72139a2..025e90dd4c29 100644 --- a/eng/common/TestResources/remove-test-resources.yml +++ b/eng/common/TestResources/remove-test-resources.yml @@ -29,7 +29,9 @@ steps: displayName: Remove test resources condition: and(eq(variables['CI_HAS_DEPLOYED_RESOURCES'], 'true'), ne(variables['Skip.RemoveTestResources'], 'true')) continueOnError: true - env: ${{ parameters.EnvVars }} + env: + PoolSubnet: $(PoolSubnet) + ${{ insert }}: ${{ parameters.EnvVars }} inputs: azureSubscription: ${{ parameters.ServiceConnection }} azurePowerShellVersion: LatestVersion @@ -46,6 +48,7 @@ steps: @subscriptionConfiguration ` -ResourceType '${{ parameters.ResourceType }}' ` -ServiceDirectory "${{ parameters.ServiceDirectory }}" ` + -AllowIpRanges ('$(azsdk-corp-net-ip-ranges)' -split ',') ` -CI ` -Force ` -Verbose @@ -63,10 +66,13 @@ steps: -ResourceType '${{ parameters.ResourceType }}' ` -ServiceDirectory "${{ parameters.ServiceDirectory }}" ` -ServicePrincipalAuth ` + -AllowIpRanges ('$(azsdk-corp-net-ip-ranges)' -split ',') ` -CI ` -Force ` -Verbose displayName: Remove test resources condition: and(eq(variables['CI_HAS_DEPLOYED_RESOURCES'], 'true'), ne(variables['Skip.RemoveTestResources'], 'true')) continueOnError: true - env: ${{ parameters.EnvVars }} + env: + PoolSubnet: $(PoolSubnet) + ${{ insert }}: ${{ parameters.EnvVars }} diff --git a/eng/common/TestResources/sub-config/AzureChinaMsft.json b/eng/common/TestResources/sub-config/AzureChinaMsft.json new file mode 100644 index 000000000000..bd555f7af497 --- /dev/null +++ b/eng/common/TestResources/sub-config/AzureChinaMsft.json @@ -0,0 +1,12 @@ +{ + "SubscriptionId": "44b2f395-b47b-462a-9a40-6ec719b6b910", + "TenantId": "3d0a72e2-8b06-4528-98df-1391c6f12c11", + "TestApplicationId": "5296eef3-d187-4e3e-bd80-7a05c38c389b", + "TestApplicationSecret": "", + "TestApplicationOid": "0d7672d5-e1db-42d4-a85e-add73010cfe5", + "ProvisionerApplicationId": "5296eef3-d187-4e3e-bd80-7a05c38c389b", + "ProvisionerApplicationSecret": "", + "ProvisionerApplicationOid": "0d7672d5-e1db-42d4-a85e-add73010cfe5", + "Environment": "AzureChinaCloud", + "AzureSubscription": "azuresdkchina" +} diff --git a/eng/common/TestResources/sub-config/AzurePreviewMsft.json b/eng/common/TestResources/sub-config/AzurePreviewMsft.json new file mode 100644 index 000000000000..318baefab3a2 --- /dev/null +++ b/eng/common/TestResources/sub-config/AzurePreviewMsft.json @@ -0,0 +1,12 @@ +{ + "SubscriptionId": "23fddbc8-cb64-4b59-ba97-4c9f77c212e4", + "TenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "TestApplicationId": "f850650c-1fcf-4489-b46f-71af2e30d360", + "TestApplicationSecret": "", + "TestApplicationOid": "30511c9d-ba1a-4c7b-b422-5b543da11b3f", + "ProvisionerApplicationId": "f850650c-1fcf-4489-b46f-71af2e30d360", + "ProvisionerApplicationSecret": "", + "ProvisionerApplicationOid": "30511c9d-ba1a-4c7b-b422-5b543da11b3f", + "Environment": "AzureCloud", + "AzureSubscription": "Azure SDK Test Resources - Preview" +} diff --git a/eng/common/TestResources/sub-config/AzureUsGovMsft.json b/eng/common/TestResources/sub-config/AzureUsGovMsft.json new file mode 100644 index 000000000000..97fedb95c950 --- /dev/null +++ b/eng/common/TestResources/sub-config/AzureUsGovMsft.json @@ -0,0 +1,12 @@ +{ + "SubscriptionId": "4ad9eeaf-9573-4288-8357-1445436f34cd", + "TenantId": "63296244-ce2c-46d8-bc36-3e558792fbee", + "TestApplicationId": "48104cb1-6c74-4857-a8b6-f44d5cf43438", + "TestApplicationSecret": "", + "TestApplicationOid": "431d66d1-2713-4135-a0b6-28ea5abd3411", + "ProvisionerApplicationId": "48104cb1-6c74-4857-a8b6-f44d5cf43438", + "ProvisionerApplicationSecret": "", + "ProvisionerApplicationOid": "431d66d1-2713-4135-a0b6-28ea5abd3411", + "Environment": "AzureUSGovernment", + "AzureSubscription": "azuresdkgov" +} diff --git a/eng/common/pipelines/templates/steps/daily-dev-build-variable.yml b/eng/common/pipelines/templates/steps/daily-dev-build-variable.yml index 5d53a5265c7a..37efd0bd0312 100644 --- a/eng/common/pipelines/templates/steps/daily-dev-build-variable.yml +++ b/eng/common/pipelines/templates/steps/daily-dev-build-variable.yml @@ -2,6 +2,7 @@ # is used when this pipeline is going to be generating and publishing daily dev builds. parameters: ServiceDirectory: '' + Condition: succeeded() steps: - ${{if ne(parameters.ServiceDirectory, '')}}: - task: Powershell@2 @@ -13,7 +14,7 @@ steps: pwsh: true workingDirectory: $(Pipeline.Workspace) displayName: Dump Package properties - condition: succeeded() + condition: ${{ parameters.Condition }} - pwsh: | $setDailyDevBuild = "false" if (('$(Build.Reason)' -eq 'Schedule') -and ('$(System.TeamProject)' -eq 'internal')) { @@ -21,4 +22,4 @@ steps: } echo "##vso[task.setvariable variable=SetDevVersion]$setDailyDevBuild" displayName: "Setup Versioning Properties" - condition: and(succeeded(), eq(variables['SetDevVersion'], '')) + condition: and(${{ parameters.Condition }}, eq(variables['SetDevVersion'], '')) diff --git a/eng/common/pipelines/templates/steps/set-default-branch.yml b/eng/common/pipelines/templates/steps/set-default-branch.yml index 31bf28936164..12ec1be317b4 100644 --- a/eng/common/pipelines/templates/steps/set-default-branch.yml +++ b/eng/common/pipelines/templates/steps/set-default-branch.yml @@ -2,6 +2,7 @@ parameters: WorkingDirectory: '$(System.DefaultWorkingDirectory)' RemoteRepo: 'origin' DefaultBranchVariableName: DefaultBranch + Condition: 'succeeded()' steps: - pwsh: | $setDefaultBranch = (git remote show ${{ parameters.RemoteRepo }} | Out-String) -replace "(?ms).*HEAD branch: (\w+).*", '$1' @@ -13,4 +14,5 @@ steps: Write-Host "##vso[task.setvariable variable=${{ parameters.DefaultBranchVariableName }}]$setDefaultBranch" displayName: "Setup Default Branch" workingDirectory: ${{ parameters.workingDirectory }} + condition: ${{ parameters.Condition }} ignoreLASTEXITCODE: true diff --git a/eng/common/pipelines/templates/steps/verify-changelog.yml b/eng/common/pipelines/templates/steps/verify-changelog.yml index 887ad1a97d90..113e0a5e695a 100644 --- a/eng/common/pipelines/templates/steps/verify-changelog.yml +++ b/eng/common/pipelines/templates/steps/verify-changelog.yml @@ -11,6 +11,9 @@ parameters: - name: ForRelease type: boolean default: false +- name: Condition + type: string + default: succeeded() steps: - task: Powershell@2 @@ -23,4 +26,5 @@ steps: pwsh: true workingDirectory: $(Pipeline.Workspace) displayName: Verify ChangeLogEntry for ${{ parameters.PackageName }} + condition: ${{ parameters.Condition }} continueOnError: false diff --git a/eng/common/pipelines/templates/steps/verify-links.yml b/eng/common/pipelines/templates/steps/verify-links.yml index 8a84f8d0ecf9..4d84e124a87f 100644 --- a/eng/common/pipelines/templates/steps/verify-links.yml +++ b/eng/common/pipelines/templates/steps/verify-links.yml @@ -12,6 +12,8 @@ parameters: steps: - template: /eng/common/pipelines/templates/steps/set-default-branch.yml + parameters: + Condition: ${{ parameters.Condition }} - task: PowerShell@2 displayName: Link verification check condition: ${{ parameters.Condition }} diff --git a/eng/common/pipelines/templates/steps/verify-path-length.yml b/eng/common/pipelines/templates/steps/verify-path-length.yml index e79729216901..259c663b9dc3 100644 --- a/eng/common/pipelines/templates/steps/verify-path-length.yml +++ b/eng/common/pipelines/templates/steps/verify-path-length.yml @@ -1,11 +1,13 @@ # Template for all Python Scripts in this repository -parameters: +parameters: SourceDirectory: '' BasePathLength: 49 + Condition: succeeded() steps: - task: PythonScript@0 displayName: Analyze Path Lengths + condition: ${{ parameters.Condition }} inputs: scriptSource: inline script: | diff --git a/eng/common/pipelines/templates/steps/verify-readme.yml b/eng/common/pipelines/templates/steps/verify-readme.yml index 7b9217ade3e2..6eeb174b323b 100644 --- a/eng/common/pipelines/templates/steps/verify-readme.yml +++ b/eng/common/pipelines/templates/steps/verify-readme.yml @@ -15,10 +15,14 @@ parameters: - name: DocWardenVersion type: string default: '' +- name: Condition + type: string + default: succeeded() steps: - task: PowerShell@2 displayName: "Verify Readmes" + condition: ${{ parameters.Condition }} inputs: filePath: "eng/common/scripts/Verify-Readme.ps1" arguments: > diff --git a/eng/common/scripts/Generate-PR-Diff.ps1 b/eng/common/scripts/Generate-PR-Diff.ps1 index 8239b219c373..d84f9e15ca7c 100644 --- a/eng/common/scripts/Generate-PR-Diff.ps1 +++ b/eng/common/scripts/Generate-PR-Diff.ps1 @@ -45,7 +45,7 @@ $changedServices = Get-ChangedServices -ChangedFiles $changedFiles $result = [PSCustomObject]@{ "ChangedFiles" = $changedFiles "ChangedServices" = $changedServices - "PRNumber" = $env:SYSTEM_PULLREQUEST_PULLREQUESTNUMBER + "PRNumber" = if ($env:SYSTEM_PULLREQUEST_PULLREQUESTNUMBER) { $env:SYSTEM_PULLREQUEST_PULLREQUESTNUMBER } else { "-1" } } $result | ConvertTo-Json | Out-File $ArtifactName diff --git a/eng/common/scripts/Helpers/Resource-Helpers.ps1 b/eng/common/scripts/Helpers/Resource-Helpers.ps1 index 6c02e9150e24..fdbb44186eaf 100644 --- a/eng/common/scripts/Helpers/Resource-Helpers.ps1 +++ b/eng/common/scripts/Helpers/Resource-Helpers.ps1 @@ -4,7 +4,7 @@ function Get-PurgeableGroupResources { param ( - [Parameter(Mandatory=$true, Position=0)] + [Parameter(Mandatory = $true, Position = 0)] [string] $ResourceGroupName ) @@ -27,8 +27,8 @@ function Get-PurgeableGroupResources { # Get any Key Vaults that will be deleted so they can be purged later if soft delete is enabled. $deletedKeyVaults = @(Get-AzKeyVault -ResourceGroupName $ResourceGroupName -ErrorAction Ignore | ForEach-Object { - # Enumerating vaults from a resource group does not return all properties we required. - Get-AzKeyVault -VaultName $_.VaultName -ErrorAction Ignore | Where-Object { $_.EnableSoftDelete } ` + # Enumerating vaults from a resource group does not return all properties we required. + Get-AzKeyVault -VaultName $_.VaultName -ErrorAction Ignore | Where-Object { $_.EnableSoftDelete } ` | Add-Member -MemberType NoteProperty -Name AzsdkResourceType -Value 'Key Vault' -PassThru ` | Add-Member -MemberType AliasProperty -Name AzsdkName -Value VaultName -PassThru }) @@ -56,13 +56,13 @@ function Get-PurgeableResources { $deletedHsms = @() foreach ($r in $content.value) { $deletedHsms += [pscustomobject] @{ - AzsdkResourceType = 'Managed HSM' - AzsdkName = $r.name - Id = $r.id - Name = $r.name - Location = $r.properties.location - DeletionDate = $r.properties.deletionDate -as [DateTime] - ScheduledPurgeDate = $r.properties.scheduledPurgeDate -as [DateTime] + AzsdkResourceType = 'Managed HSM' + AzsdkName = $r.name + Id = $r.id + Name = $r.name + Location = $r.properties.location + DeletionDate = $r.properties.deletionDate -as [DateTime] + ScheduledPurgeDate = $r.properties.scheduledPurgeDate -as [DateTime] EnablePurgeProtection = $r.properties.purgeProtectionEnabled } } @@ -91,7 +91,8 @@ function Get-PurgeableResources { Write-Verbose "Found $($deletedKeyVaults.Count) deleted Key Vaults to potentially purge." $purgeableResources += $deletedKeyVaults } - } catch { } + } + catch { } return $purgeableResources } @@ -100,7 +101,7 @@ function Get-PurgeableResources { # This allows you to pipe a collection and process each item in the collection. filter Remove-PurgeableResources { param ( - [Parameter(Position=0, ValueFromPipeline=$true)] + [Parameter(Position = 0, ValueFromPipeline = $true)] [object[]] $Resource, [Parameter()] @@ -128,7 +129,7 @@ filter Remove-PurgeableResources { # Use `-AsJob` to start a lightweight, cancellable job and pass to `Wait-PurgeableResoruceJob` for consistent behavior. Remove-AzKeyVault -VaultName $r.VaultName -Location $r.Location -InRemovedState -Force -ErrorAction Continue -AsJob ` - | Wait-PurgeableResourceJob -Resource $r -Timeout $Timeout -PassThru:$PassThru + | Wait-PurgeableResourceJob -Resource $r -Timeout $Timeout -PassThru:$PassThru } 'Managed HSM' { @@ -139,18 +140,19 @@ filter Remove-PurgeableResources { # Use `GetNewClosure()` on the `-Action` ScriptBlock to make sure variables are captured. Invoke-AzRestMethod -Method POST -Path "/subscriptions/$subscriptionId/providers/Microsoft.KeyVault/locations/$($r.Location)/deletedManagedHSMs/$($r.Name)/purge?api-version=2023-02-01" -ErrorAction Ignore -AsJob ` - | Wait-PurgeableResourceJob -Resource $r -Timeout $Timeout -PassThru:$PassThru -Action { - param ( $response ) - if ($response.StatusCode -ge 200 -and $response.StatusCode -lt 300) { - Write-Warning "Successfully requested that Managed HSM '$($r.Name)' be purged, but may take a few minutes before it is actually purged." - } elseif ($response.Content) { - $content = $response.Content | ConvertFrom-Json - if ($content.error) { - $err = $content.error - Write-Warning "Failed to deleted Managed HSM '$($r.Name)': ($($err.code)) $($err.message)" - } - } - }.GetNewClosure() + | Wait-PurgeableResourceJob -Resource $r -Timeout $Timeout -PassThru:$PassThru -Action { + param ( $response ) + if ($response.StatusCode -ge 200 -and $response.StatusCode -lt 300) { + Write-Warning "Successfully requested that Managed HSM '$($r.Name)' be purged, but may take a few minutes before it is actually purged." + } + elseif ($response.Content) { + $content = $response.Content | ConvertFrom-Json + if ($content.error) { + $err = $content.error + Write-Warning "Failed to deleted Managed HSM '$($r.Name)': ($($err.code)) $($err.message)" + } + } + }.GetNewClosure() } default { @@ -167,12 +169,12 @@ function Log($Message) { function Wait-PurgeableResourceJob { param ( - [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [Parameter(Mandatory = $true, ValueFromPipeline = $true)] $Job, # The resource is used for logging and to return if `-PassThru` is specified # so we can easily see all resources that may be in a bad state when the script has completed. - [Parameter(Mandatory=$true)] + [Parameter(Mandatory = $true)] $Resource, # Optional ScriptBlock should define params corresponding to the associated job's `Output` property. @@ -195,7 +197,8 @@ function Wait-PurgeableResourceJob { if ($Action) { $null = $Action.Invoke($result) } - } else { + } + else { Write-Warning "Timed out waiting to purge $($Resource.AzsdkResourceType) '$($Resource.AzsdkName)'. Cancelling job." $Job.Cancel() @@ -204,3 +207,191 @@ function Wait-PurgeableResourceJob { } } } + +# Helper function for removing storage accounts with WORM that sometimes get leaked from live tests not set up to clean +# up their resource policies +function Remove-WormStorageAccounts() { + [CmdletBinding(SupportsShouldProcess = $True)] + param( + [string]$GroupPrefix, + [switch]$CI + ) + + $ErrorActionPreference = 'Stop' + + # Be a little defensive so we don't delete non-live test groups via naming convention + # DO NOT REMOVE THIS + # We call this script from live test pipelines as well, and a string mismatch/error could blow away + # some static storage accounts we rely on + if (!$groupPrefix -or ($CI -and !$GroupPrefix.StartsWith('rg-'))) { + throw "The -GroupPrefix parameter must not be empty, or must start with 'rg-' in CI contexts" + } + + $groups = Get-AzResourceGroup | Where-Object { $_.ResourceGroupName.StartsWith($GroupPrefix) } | Where-Object { $_.ProvisioningState -ne 'Deleting' } + + foreach ($group in $groups) { + Write-Host "=========================================" + $accounts = Get-AzStorageAccount -ResourceGroupName $group.ResourceGroupName + if ($accounts) { + foreach ($account in $accounts) { + if ($WhatIfPreference) { + Write-Host "What if: Removing $($account.StorageAccountName) in $($account.ResourceGroupName)" + } + else { + Write-Host "Removing $($account.StorageAccountName) in $($account.ResourceGroupName)" + } + + $hasContainers = ($account.Kind -ne "FileStorage") + + # If it doesn't have containers then we can skip the explicit clean-up of this storage account + if (!$hasContainers) { continue } + + $ctx = New-AzStorageContext -StorageAccountName $account.StorageAccountName + + $immutableBlobs = $ctx ` + | Get-AzStorageContainer ` + | Where-Object { $_.BlobContainerProperties.HasImmutableStorageWithVersioning } ` + | Get-AzStorageBlob + try { + foreach ($blob in $immutableBlobs) { + Write-Host "Removing legal hold - blob: $($blob.Name), account: $($account.StorageAccountName), group: $($group.ResourceGroupName)" + $blob | Set-AzStorageBlobLegalHold -DisableLegalHold | Out-Null + } + } + catch { + Write-Warning "User must have 'Storage Blob Data Owner' RBAC permission on subscription or resource group" + Write-Error $_ + throw + } + # Sometimes we get a 404 blob not found but can still delete containers, + # and sometimes we must delete the blob if there's a legal hold. + # Try to remove the blob, but keep running regardless. + $succeeded = $false + for ($attempt = 0; $attempt -lt 2; $attempt++) { + if ($succeeded) { + break + } + + try { + Write-Host "Removing immutability policies - account: $($ctx.StorageAccountName), group: $($group.ResourceGroupName)" + $null = $ctx | Get-AzStorageContainer | Get-AzStorageBlob | Remove-AzStorageBlobImmutabilityPolicy + } + catch {} + + try { + $ctx | Get-AzStorageContainer | Get-AzStorageBlob | Remove-AzStorageBlob -Force + $succeeded = $true + } + catch { + Write-Warning "Failed to remove blobs - account: $($ctx.StorageAccountName), group: $($group.ResourceGroupName)" + Write-Warning $_ + } + } + + try { + # Use AzRm cmdlet as deletion will only work through ARM with the immutability policies defined on the blobs + $ctx | Get-AzStorageContainer | ForEach-Object { Remove-AzRmStorageContainer -Name $_.Name -StorageAccountName $ctx.StorageAccountName -ResourceGroupName $group.ResourceGroupName -Force } + } + catch { + Write-Warning "Container removal failed. Ignoring the error and trying to delete the storage account." + Write-Warning $_ + } + Remove-AzStorageAccount -StorageAccountName $account.StorageAccountName -ResourceGroupName $account.ResourceGroupName -Force + } + } + if ($WhatIfPreference) { + Write-Host "What if: Removing resource group $($group.ResourceGroupName)" + } + else { + Remove-AzResourceGroup -ResourceGroupName $group.ResourceGroupName -Force -AsJob + } + } +} + +function SetResourceNetworkAccessRules([string]$ResourceGroupName, [array]$AllowIpRanges, [switch]$CI, [switch]$SetFirewall) { + SetStorageNetworkAccessRules -ResourceGroupName $ResourceGroupName -AllowIpRanges $AllowIpRanges -CI:$CI -SetFirewall:$SetFirewall +} + +function SetStorageNetworkAccessRules([string]$ResourceGroupName, [array]$AllowIpRanges, [switch]$CI, [switch]$SetFirewall) { + $clientIp = $null + $storageAccounts = Retry { Get-AzResource -ResourceGroupName $ResourceGroupName -ResourceType "Microsoft.Storage/storageAccounts" } + # Add client IP to storage account when running as local user. Pipeline's have their own vnet with access + if ($storageAccounts) { + $appliedRule = $false + foreach ($account in $storageAccounts) { + $properties = Get-AzStorageAccount -ResourceGroupName $ResourceGroupName -AccountName $account.Name + $rules = Get-AzStorageAccountNetworkRuleSet -ResourceGroupName $ResourceGroupName -AccountName $account.Name + + if ($properties.AllowBlobPublicAccess) { + Write-Host "Restricting public blob access in storage account '$($account.Name)'" + Set-AzStorageAccount -ResourceGroupName $ResourceGroupName -StorageAccountName $account.Name -AllowBlobPublicAccess $false + } + + # In override mode, we only want to capture storage accounts that have had incomplete network rules applied, + # otherwise it's not worth updating due to timing and throttling issues. + # If the network rules are deny only without any vnet/ip allowances, then we can't ever purge the storage account + # when immutable blobs need to be removed. + if (!$rules -or !$SetFirewall -or $rules.DefaultAction -eq "Allow") { + return + } + + # Add firewall rules in cases where existing rules added were incomplete to enable blob removal + Write-Host "Restricting network rules in storage account '$($account.Name)' to deny access by default" + Retry { Update-AzStorageAccountNetworkRuleSet -ResourceGroupName $ResourceGroupName -Name $account.Name -DefaultAction Deny } + if ($CI -and $env:PoolSubnet) { + Write-Host "Enabling access to '$($account.Name)' from pipeline subnet $($env:PoolSubnet)" + Retry { Add-AzStorageAccountNetworkRule -ResourceGroupName $ResourceGroupName -Name $account.Name -VirtualNetworkResourceId $env:PoolSubnet } + $appliedRule = $true + } + elseif ($AllowIpRanges) { + Write-Host "Enabling access to '$($account.Name)' to $($AllowIpRanges.Length) IP ranges" + $ipRanges = $AllowIpRanges | ForEach-Object { + @{ Action = 'allow'; IPAddressOrRange = $_ } + } + Retry { Update-AzStorageAccountNetworkRuleSet -ResourceGroupName $ResourceGroupName -Name $account.Name -IPRule $ipRanges | Out-Null } + $appliedRule = $true + } + elseif (!$CI) { + Write-Host "Enabling access to '$($account.Name)' from client IP" + $clientIp ??= Retry { Invoke-RestMethod -Uri 'https://icanhazip.com/' } # cloudflare owned ip site + $clientIp = $clientIp.Trim() + $ipRanges = Get-AzStorageAccountNetworkRuleSet -ResourceGroupName $ResourceGroupName -Name $account.Name + if ($ipRanges) { + foreach ($range in $ipRanges.IpRules) { + if (DoesSubnetOverlap $range.IPAddressOrRange $clientIp) { + return + } + } + } + Retry { Add-AzStorageAccountNetworkRule -ResourceGroupName $ResourceGroupName -Name $account.Name -IPAddressOrRange $clientIp | Out-Null } + $appliedRule = $true + } + } + + if ($appliedRule) { + Write-Host "Sleeping for 15 seconds to allow network rules to take effect" + Start-Sleep 15 + } + } +} + +function DoesSubnetOverlap([string]$ipOrCidr, [string]$overlapIp) { + [System.Net.IPAddress]$overlapIpAddress = $overlapIp + $parsed = $ipOrCidr -split '/' + [System.Net.IPAddress]$baseIp = $parsed[0] + if ($parsed.Length -eq 1) { + return $baseIp -eq $overlapIpAddress + } + + $subnet = $parsed[1] + $subnetNum = [int]$subnet + + $baseMask = [math]::pow(2, 31) + $mask = 0 + for ($i = 0; $i -lt $subnetNum; $i++) { + $mask = $mask + $baseMask; + $baseMask = $baseMask / 2 + } + + return $baseIp.Address -eq ($overlapIpAddress.Address -band ([System.Net.IPAddress]$mask).Address) +} diff --git a/eng/common/scripts/Package-Properties.ps1 b/eng/common/scripts/Package-Properties.ps1 index 606998c8ea3c..0e703a9d4374 100644 --- a/eng/common/scripts/Package-Properties.ps1 +++ b/eng/common/scripts/Package-Properties.ps1 @@ -105,6 +105,30 @@ function Get-PkgProperties return $null } +function Get-PrPkgProperties([string]$InputDiffJson) { + $packagesWithChanges = @() + + $allPackageProperties = Get-AllPkgProperties + $diff = Get-Content $InputDiffJson | ConvertFrom-Json + $targetedFiles = $diff.ChangedFiles + + foreach($pkg in $allPackageProperties) + { + $pkgDirectory = Resolve-Path "$($pkg.DirectoryPath)" + + foreach($file in $targetedFiles) + { + $filePath = Resolve-Path (Join-Path $RepoRoot $file) + $shouldInclude = $filePath -like "$pkgDirectory*" + if ($shouldInclude) { + $packagesWithChanges += $pkg + } + } + } + + return $packagesWithChanges +} + # Takes ServiceName and Repo Root Directory # Returns important properties for each package in the specified service, or entire repo if the serviceName is not specified # Returns a Table of service key to array values of PS Object with properties @ { pkgName, pkgVersion, pkgDirectoryPath, pkgReadMePath, pkgChangeLogPath } diff --git a/eng/common/scripts/Save-Package-Properties.ps1 b/eng/common/scripts/Save-Package-Properties.ps1 index 0e8ce26aa654..c234d8b28ede 100644 --- a/eng/common/scripts/Save-Package-Properties.ps1 +++ b/eng/common/scripts/Save-Package-Properties.ps1 @@ -15,7 +15,10 @@ filename as track 1 packages (e.g. same artifact name or package name), the track 2 package properties will be written. .PARAMETER serviceDirectory -Service directory in which to search for packages +Service directory in which to search for packages. + +.PARAMETER prDiff +A file path leading to a file generated from Generate-PR-Diff.json. This parameter takes precedence over serviceDirectory, do not provide both. .PARAMETER outDirectory Output location (generally a package artifact directory in DevOps) for JSON @@ -32,10 +35,10 @@ Verison property in that file. [CmdletBinding()] Param ( - [Parameter(Mandatory=$True)] [string] $serviceDirectory, [Parameter(Mandatory=$True)] [string] $outDirectory, + [string] $prDiff, [switch] $addDevVersion ) @@ -92,7 +95,16 @@ function GetRelativePath($path) { } $exportedPaths = @{} -$allPackageProperties = Get-AllPkgProperties $serviceDirectory + +$allPackageProperties = @() + +if ($prDiff) { + $allPackageProperties = Get-PrPkgProperties $prDiff +} +else { + $allPackageProperties = Get-AllPkgProperties $serviceDirectory +} + if ($allPackageProperties) { if (-not (Test-Path -Path $outDirectory)) @@ -137,6 +149,6 @@ if ($allPackageProperties) } else { - Write-Error "Package properties are not available for service directory $($serviceDirectory)" + Write-Error "Package properties are not available for service directory $serviceDirectory or $prdiff" exit 1 } diff --git a/eng/common/scripts/Test-SampleMetadata.ps1 b/eng/common/scripts/Test-SampleMetadata.ps1 index 9e50fa1dce03..8499b70a4926 100644 --- a/eng/common/scripts/Test-SampleMetadata.ps1 +++ b/eng/common/scripts/Test-SampleMetadata.ps1 @@ -203,6 +203,7 @@ begin { "azure-genomics", "azure-hdinsight", "azure-hdinsight-rserver", + "azure-health-data-services", "azure-health-insights", "azure-hpc-cache", "azure-immersive-reader", diff --git a/eng/common/scripts/stress-testing/find-all-stress-packages.ps1 b/eng/common/scripts/stress-testing/find-all-stress-packages.ps1 index a79db98e7c96..bec510cd958a 100644 --- a/eng/common/scripts/stress-testing/find-all-stress-packages.ps1 +++ b/eng/common/scripts/stress-testing/find-all-stress-packages.ps1 @@ -75,7 +75,7 @@ function ParseChart([string]$chartFile) { function MatchesAnnotations([hashtable]$chart, [hashtable]$filters) { foreach ($filter in $filters.GetEnumerator()) { - if (!$chart["annotations"] -or $chart["annotations"][$filter.Key] -ne $filter.Value) { + if (!$chart["annotations"] -or $chart["annotations"][$filter.Key] -notmatch $filter.Value) { return $false } } diff --git a/eng/common/scripts/stress-testing/stress-test-deployment-lib.ps1 b/eng/common/scripts/stress-testing/stress-test-deployment-lib.ps1 index aa426d7b4687..c67540f3b3e5 100644 --- a/eng/common/scripts/stress-testing/stress-test-deployment-lib.ps1 +++ b/eng/common/scripts/stress-testing/stress-test-deployment-lib.ps1 @@ -122,6 +122,12 @@ function DeployStressTests( } $clusterGroup = 'rg-stress-cluster-prod' $subscription = 'Azure SDK Test Resources' + } elseif ($environment -eq 'storage') { + if ($clusterGroup -or $subscription) { + Write-Warning "Overriding cluster group and subscription with defaults for 'storage' environment." + } + $clusterGroup = 'rg-stress-cluster-storage' + $subscription = 'XClient' } elseif (!$clusterGroup -or !$subscription) { throw "clusterGroup and subscription parameters must be specified when deploying to an environment that is not pg or prod." } diff --git a/eng/emitter-package-lock.json b/eng/emitter-package-lock.json index abf499734a4b..81b3f7e40a96 100644 --- a/eng/emitter-package-lock.json +++ b/eng/emitter-package-lock.json @@ -5,20 +5,20 @@ "packages": { "": { "dependencies": { - "@azure-tools/typespec-java": "0.17.1" + "@azure-tools/typespec-java": "0.18.2" }, "devDependencies": { - "@azure-tools/typespec-autorest": "0.43.0", - "@azure-tools/typespec-azure-core": "0.43.0", - "@azure-tools/typespec-azure-resource-manager": "0.43.0", - "@azure-tools/typespec-azure-rulesets": "0.43.0", - "@azure-tools/typespec-client-generator-core": "0.43.1", - "@typespec/compiler": "0.57.0", - "@typespec/http": "0.57.0", - "@typespec/openapi": "0.57.0", - "@typespec/rest": "0.57.0", - "@typespec/versioning": "0.57.0", - "@typespec/xml": "0.57.0" + "@azure-tools/typespec-autorest": "0.44.0", + "@azure-tools/typespec-azure-core": "0.44.0", + "@azure-tools/typespec-azure-resource-manager": "0.44.0", + "@azure-tools/typespec-azure-rulesets": "0.44.0", + "@azure-tools/typespec-client-generator-core": "0.44.1", + "@typespec/compiler": "0.58.0", + "@typespec/http": "0.58.0", + "@typespec/openapi": "0.58.0", + "@typespec/rest": "0.58.0", + "@typespec/versioning": "0.58.0", + "@typespec/xml": "0.58.0" } }, "node_modules/@autorest/codemodel": { @@ -67,40 +67,40 @@ } }, "node_modules/@azure-tools/typespec-autorest": { - "version": "0.43.0", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-autorest/-/typespec-autorest-0.43.0.tgz", - "integrity": "sha512-tZ9uXXOdxu2y01W9n3mzXf+IEY2MQkP/JaQaKlcOx2+dbklHNQWSDU0Vm6Gmm6l//XiF9QiI8653BiuO97czyw==", + "version": "0.44.0", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-autorest/-/typespec-autorest-0.44.0.tgz", + "integrity": "sha512-GlIQayA6HfKndq1T2qHBXtL6n8gTiShUEhi30zncoBaIUnwumkXSnx18uCQl0EzFmvAqLYt3kbHqQNzZIdGaeQ==", "engines": { "node": ">=18.0.0" }, "peerDependencies": { - "@azure-tools/typespec-azure-core": "~0.43.0", - "@azure-tools/typespec-azure-resource-manager": "~0.43.0", - "@azure-tools/typespec-client-generator-core": "~0.43.0", - "@typespec/compiler": "~0.57.0", - "@typespec/http": "~0.57.0", - "@typespec/openapi": "~0.57.0", - "@typespec/rest": "~0.57.0", - "@typespec/versioning": "~0.57.0" + "@azure-tools/typespec-azure-core": "~0.44.0", + "@azure-tools/typespec-azure-resource-manager": "~0.44.0", + "@azure-tools/typespec-client-generator-core": "~0.44.0", + "@typespec/compiler": "~0.58.0", + "@typespec/http": "~0.58.0", + "@typespec/openapi": "~0.58.0", + "@typespec/rest": "~0.58.0", + "@typespec/versioning": "~0.58.0" } }, "node_modules/@azure-tools/typespec-azure-core": { - "version": "0.43.0", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-core/-/typespec-azure-core-0.43.0.tgz", - "integrity": "sha512-B1r0i3segJ7RuNXxcAMBy8H2t+jTkaf74dkyUWD0HIFPkhETN0uR59nuor+s+LoLU8yI4JypOFSNZt6e1rod8w==", + "version": "0.44.0", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-core/-/typespec-azure-core-0.44.0.tgz", + "integrity": "sha512-d11QK2v5fOZH8YUqf42FsqHEirKCHzeKFq4Uo/51BXCXmJJahsTaFMAG2M0GoJe8tmTHeMijStnVMfzcGNqCAA==", "engines": { "node": ">=18.0.0" }, "peerDependencies": { - "@typespec/compiler": "~0.57.0", - "@typespec/http": "~0.57.0", - "@typespec/rest": "~0.57.0" + "@typespec/compiler": "~0.58.0", + "@typespec/http": "~0.58.0", + "@typespec/rest": "~0.58.0" } }, "node_modules/@azure-tools/typespec-azure-resource-manager": { - "version": "0.43.0", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-resource-manager/-/typespec-azure-resource-manager-0.43.0.tgz", - "integrity": "sha512-0GQL+/o1u+PAB63FpYz3sy3ZgZvCtk5T4sDAnICnV23v2YWIONDMUfxxd0x40xJbY6PkcwwHDpBLNMqajf2H6A==", + "version": "0.44.0", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-resource-manager/-/typespec-azure-resource-manager-0.44.0.tgz", + "integrity": "sha512-m4dG41at6En1swbxlvCDl1v4Mvrfp17acDnRxEcd4SdKP2R9eVS2mBy1tSuFtMcJlOnoBZ5CxQgk+Osg/Q9nmA==", "dependencies": { "change-case": "~5.4.4", "pluralize": "^8.0.0" @@ -109,32 +109,32 @@ "node": ">=18.0.0" }, "peerDependencies": { - "@azure-tools/typespec-azure-core": "~0.43.0", - "@typespec/compiler": "~0.57.0", - "@typespec/http": "~0.57.0", - "@typespec/openapi": "~0.57.0", - "@typespec/rest": "~0.57.0", - "@typespec/versioning": "~0.57.0" + "@azure-tools/typespec-azure-core": "~0.44.0", + "@typespec/compiler": "~0.58.0", + "@typespec/http": "~0.58.0", + "@typespec/openapi": "~0.58.0", + "@typespec/rest": "~0.58.0", + "@typespec/versioning": "~0.58.0" } }, "node_modules/@azure-tools/typespec-azure-rulesets": { - "version": "0.43.0", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-rulesets/-/typespec-azure-rulesets-0.43.0.tgz", - "integrity": "sha512-yh0dNQIM4hRDWATh/tkONP991uMxFDHY8BkC0eWtIpfTjQTuR2PlGhrLgMxHT2Q5cCusfkNWeFvKDYlxKeoFLA==", + "version": "0.44.0", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-rulesets/-/typespec-azure-rulesets-0.44.0.tgz", + "integrity": "sha512-ZFiT+rtLIq3uP4uSr85i7w+3r02BEqERePaCtTyjexo2IBz0lwQ5Nn/5ujfuDDSy+3daoC2bQy8hw/BGWg9/Ng==", "engines": { "node": ">=18.0.0" }, "peerDependencies": { - "@azure-tools/typespec-azure-core": "~0.43.0", - "@azure-tools/typespec-azure-resource-manager": "~0.43.0", - "@azure-tools/typespec-client-generator-core": "~0.43.0", - "@typespec/compiler": "~0.57.0" + "@azure-tools/typespec-azure-core": "~0.44.0", + "@azure-tools/typespec-azure-resource-manager": "~0.44.0", + "@azure-tools/typespec-client-generator-core": "~0.44.0", + "@typespec/compiler": "~0.58.0" } }, "node_modules/@azure-tools/typespec-client-generator-core": { - "version": "0.43.1", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-client-generator-core/-/typespec-client-generator-core-0.43.1.tgz", - "integrity": "sha512-NwNN/fIOcjOU/8o6ViCuEAAQl6zmu2X1QKPuXxeSy8ssDwrTiX9Ho2X/7IZM4XmOArKTtgmTkNcSnnmuj5dsGg==", + "version": "0.44.1", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-client-generator-core/-/typespec-client-generator-core-0.44.1.tgz", + "integrity": "sha512-hpDYS4J329kPnXMAndburITh81jgOloxLrv6QXJadurnFhxFHb8AycGO8VWgFYTf04cWd7yDx7HutzGSN9C7TQ==", "dependencies": { "change-case": "~5.4.4", "pluralize": "^8.0.0" @@ -143,18 +143,17 @@ "node": ">=18.0.0" }, "peerDependencies": { - "@azure-tools/typespec-azure-core": "~0.43.0", - "@typespec/compiler": "~0.57.0", - "@typespec/http": "~0.57.0", - "@typespec/rest": "~0.57.0", - "@typespec/versioning": "~0.57.0", - "@typespec/xml": "~0.57.0" + "@azure-tools/typespec-azure-core": "~0.44.0", + "@typespec/compiler": "~0.58.0", + "@typespec/http": "~0.58.0", + "@typespec/rest": "~0.58.0", + "@typespec/versioning": "~0.58.0" } }, "node_modules/@azure-tools/typespec-java": { - "version": "0.17.1", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-java/-/typespec-java-0.17.1.tgz", - "integrity": "sha512-Q+hu7WxqOr1+2fRY2z5eTfqioqGY02hnHk30c1EmWKnJUfLxomOq1Vk9dlnLHUMOdlyCA813fiyygu5MHWHDEg==", + "version": "0.18.2", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-java/-/typespec-java-0.18.2.tgz", + "integrity": "sha512-eWgNAOVBzrJz1FMcOYVv04UBqA0mxWvDT3VPP/KG97rhVgi2LZjKGI/gM8ET7TBVl4jBBwzPN+BtDcvC4DTVqQ==", "dependencies": { "@autorest/codemodel": "~4.20.0", "js-yaml": "~4.1.0", @@ -164,17 +163,17 @@ "node": ">=14.0.0" }, "peerDependencies": { - "@azure-tools/typespec-autorest": ">=0.43.0 <1.0.0", - "@azure-tools/typespec-azure-core": ">=0.43.0 <1.0.0", - "@azure-tools/typespec-azure-resource-manager": ">=0.43.0 <1.0.0", - "@azure-tools/typespec-azure-rulesets": ">=0.43.0 <1.0.0", - "@azure-tools/typespec-client-generator-core": ">=0.43.1 <1.0.0", - "@typespec/compiler": ">=0.57.0 <1.0.0", - "@typespec/http": ">=0.57.0 <1.0.0", - "@typespec/openapi": ">=0.57.0 <1.0.0", - "@typespec/rest": ">=0.57.0 <1.0.0", - "@typespec/versioning": ">=0.57.0 <1.0.0", - "@typespec/xml": ">=0.57.0 <1.0.0" + "@azure-tools/typespec-autorest": ">=0.44.0 <1.0.0", + "@azure-tools/typespec-azure-core": ">=0.44.0 <1.0.0", + "@azure-tools/typespec-azure-resource-manager": ">=0.44.0 <1.0.0", + "@azure-tools/typespec-azure-rulesets": ">=0.44.0 <1.0.0", + "@azure-tools/typespec-client-generator-core": ">=0.44.1 <1.0.0", + "@typespec/compiler": ">=0.58.0 <1.0.0", + "@typespec/http": ">=0.58.0 <1.0.0", + "@typespec/openapi": ">=0.58.0 <1.0.0", + "@typespec/rest": ">=0.58.0 <1.0.0", + "@typespec/versioning": ">=0.58.0 <1.0.0", + "@typespec/xml": ">=0.58.0 <1.0.0" } }, "node_modules/@babel/code-frame": { @@ -255,22 +254,23 @@ } }, "node_modules/@typespec/compiler": { - "version": "0.57.0", - "resolved": "https://registry.npmjs.org/@typespec/compiler/-/compiler-0.57.0.tgz", - "integrity": "sha512-Z5L7J90Ol21IbzU+rBD2wzKy2vJ2Yg2FIzi+yB5rtb7/c4oBea/CgEByMVHBtT7uw45ZXJpHOiepuGSPVXw2EA==", + "version": "0.58.0", + "resolved": "https://registry.npmjs.org/@typespec/compiler/-/compiler-0.58.0.tgz", + "integrity": "sha512-kyyXwjy9mLwOTYZyXbfPzGr2dpRwj2DASvUAKxax/BVKFLVxTfecIZKwWCLB42RxgraqYx2/t4RhviH+QbEtqA==", "dependencies": { - "@babel/code-frame": "~7.24.2", - "ajv": "~8.13.0", + "@babel/code-frame": "~7.24.7", + "ajv": "~8.16.0", "change-case": "~5.4.4", - "globby": "~14.0.1", + "globby": "~14.0.2", "mustache": "~4.2.0", "picocolors": "~1.0.1", - "prettier": "~3.2.5", + "prettier": "~3.3.2", "prompts": "~2.4.2", "semver": "^7.6.2", + "temporal-polyfill": "^0.2.5", "vscode-languageserver": "~9.0.1", "vscode-languageserver-textdocument": "~1.0.11", - "yaml": "~2.4.2", + "yaml": "~2.4.5", "yargs": "~17.7.2" }, "bin": { @@ -282,66 +282,66 @@ } }, "node_modules/@typespec/http": { - "version": "0.57.0", - "resolved": "https://registry.npmjs.org/@typespec/http/-/http-0.57.0.tgz", - "integrity": "sha512-k3bWOTPNqlRB3/TmrXVBtObmxj2J20l2FnhGXvs+tjdtbXLxCQWmvQz6xlne9nkLAtWVB/pQRUn+oMJfhWta3w==", + "version": "0.58.0", + "resolved": "https://registry.npmjs.org/@typespec/http/-/http-0.58.0.tgz", + "integrity": "sha512-jQpkugg9AZVrNDMkDIgZRpIoRkkU2b0LtKWqMGg33MItYj9/DYSgDtY7xb7oCBppRtFFZ/h138HyhYl3zQxZRg==", "engines": { "node": ">=18.0.0" }, "peerDependencies": { - "@typespec/compiler": "~0.57.0" + "@typespec/compiler": "~0.58.0" } }, "node_modules/@typespec/openapi": { - "version": "0.57.0", - "resolved": "https://registry.npmjs.org/@typespec/openapi/-/openapi-0.57.0.tgz", - "integrity": "sha512-35wK/BqjOXSlhWuGMwoYN3FSgIYFOKtw8ot4ErcgmxAGuKaS2GkUhZvtQJXUn2ByU0Fl4jqslPmTz8SEcz7rbw==", + "version": "0.58.0", + "resolved": "https://registry.npmjs.org/@typespec/openapi/-/openapi-0.58.0.tgz", + "integrity": "sha512-gu6nXfmpfZrfq8Etpgl1dpMfsXii7EzQyhZgsPhIy7ZwV5bDmFk1/oyhTqIpWrnr4pD3r151T2BQjzJefjf15A==", "engines": { "node": ">=18.0.0" }, "peerDependencies": { - "@typespec/compiler": "~0.57.0", - "@typespec/http": "~0.57.0" + "@typespec/compiler": "~0.58.0", + "@typespec/http": "~0.58.0" } }, "node_modules/@typespec/rest": { - "version": "0.57.0", - "resolved": "https://registry.npmjs.org/@typespec/rest/-/rest-0.57.0.tgz", - "integrity": "sha512-mZj76Kf+cmH38pYA6LT8Zz7QjuR3fdQo5bc8pXhKMwLq9vRqNLz6Z9InbOeo8zY+xP0GfUwEU9kXczmCc8gyRA==", + "version": "0.58.0", + "resolved": "https://registry.npmjs.org/@typespec/rest/-/rest-0.58.0.tgz", + "integrity": "sha512-QBxkED0/KQKG22pwzis0n7BY+uLMSZZPSoVe/ESBFika9n5/yyeQ0l58xbFFwwfxAxe4xwuZ5PNwTdEXZbzr5g==", "engines": { "node": ">=18.0.0" }, "peerDependencies": { - "@typespec/compiler": "~0.57.0", - "@typespec/http": "~0.57.0" + "@typespec/compiler": "~0.58.0", + "@typespec/http": "~0.58.0" } }, "node_modules/@typespec/versioning": { - "version": "0.57.0", - "resolved": "https://registry.npmjs.org/@typespec/versioning/-/versioning-0.57.0.tgz", - "integrity": "sha512-kk6zCNSwcqqYB9isNNagTy+Zv6wEIRA4NkcZ/X1riTj2zhJwKsIFNXQWm1yxpZn+BY4+1QtuaQHuBLo8HbgR/w==", + "version": "0.58.0", + "resolved": "https://registry.npmjs.org/@typespec/versioning/-/versioning-0.58.0.tgz", + "integrity": "sha512-brnQQ3wKWh4AbgqmnVLj+8zyOaDk9VPWg4QBecdQxzz7PrSrlAzIzRfeIyr67+hwi/0SvkTAB6GNH7YYTypKGA==", "engines": { "node": ">=18.0.0" }, "peerDependencies": { - "@typespec/compiler": "~0.57.0" + "@typespec/compiler": "~0.58.0" } }, "node_modules/@typespec/xml": { - "version": "0.57.0", - "resolved": "https://registry.npmjs.org/@typespec/xml/-/xml-0.57.0.tgz", - "integrity": "sha512-itsFsahgBRNREoF4FXUgELmNGtOMmzNnhxT+NeAl4f7EXmz/mu1y/k9hWmDXWr+DB0Oq1r0Fc+D0TSl51szzlQ==", + "version": "0.58.0", + "resolved": "https://registry.npmjs.org/@typespec/xml/-/xml-0.58.0.tgz", + "integrity": "sha512-2OG2JXypMZR90nVoIVwxc+6Sc4lsggLPuh1yhw1BKiv2NBAuSdfcK4MuiIooqR206QJw9xM8qtNxlUeDb00DDw==", "engines": { "node": ">=18.0.0" }, "peerDependencies": { - "@typespec/compiler": "~0.57.0" + "@typespec/compiler": "~0.58.0" } }, "node_modules/ajv": { - "version": "8.13.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.13.0.tgz", - "integrity": "sha512-PRA911Blj99jR5RMeTunVbNXMF6Lp4vZXnk5GQjcnUWUTsrXtekg/pnmFFI2u/I36Y/2bITGS30GZCXei6uNkA==", + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.16.0.tgz", + "integrity": "sha512-F0twR8U1ZU67JIEtekUcLkXkoO5mMMmgGD8sK/xUFzJ805jxHQl92hImFAqqXMyMYjSPOyUPAwHYhB72g5sTXw==", "dependencies": { "fast-deep-equal": "^3.1.3", "json-schema-traverse": "^1.0.0", @@ -684,9 +684,9 @@ } }, "node_modules/prettier": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz", - "integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz", + "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==", "bin": { "prettier": "bin/prettier.cjs" }, @@ -804,9 +804,9 @@ } }, "node_modules/semver": { - "version": "7.6.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", - "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", "bin": { "semver": "bin/semver.js" }, @@ -865,6 +865,19 @@ "node": ">=4" } }, + "node_modules/temporal-polyfill": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/temporal-polyfill/-/temporal-polyfill-0.2.5.tgz", + "integrity": "sha512-ye47xp8Cb0nDguAhrrDS1JT1SzwEV9e26sSsrWzVu+yPZ7LzceEcH0i2gci9jWfOfSCCgM3Qv5nOYShVUUFUXA==", + "dependencies": { + "temporal-spec": "^0.2.4" + } + }, + "node_modules/temporal-spec": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/temporal-spec/-/temporal-spec-0.2.4.tgz", + "integrity": "sha512-lDMFv4nKQrSjlkHKAlHVqKrBG4DyFfa9F74cmBZ3Iy3ed8yvWnlWSIdi4IKfSqwmazAohBNwiN64qGx4y5Q3IQ==" + }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", diff --git a/eng/emitter-package.json b/eng/emitter-package.json index 8a2a5376d496..520ce453ae03 100644 --- a/eng/emitter-package.json +++ b/eng/emitter-package.json @@ -1,19 +1,19 @@ { "main": "dist/src/index.js", "dependencies": { - "@azure-tools/typespec-java": "0.17.1" + "@azure-tools/typespec-java": "0.18.2" }, "devDependencies": { - "@azure-tools/typespec-autorest": "0.43.0", - "@azure-tools/typespec-azure-core": "0.43.0", - "@azure-tools/typespec-azure-resource-manager": "0.43.0", - "@azure-tools/typespec-azure-rulesets": "0.43.0", - "@azure-tools/typespec-client-generator-core": "0.43.1", - "@typespec/compiler": "0.57.0", - "@typespec/http": "0.57.0", - "@typespec/openapi": "0.57.0", - "@typespec/rest": "0.57.0", - "@typespec/versioning": "0.57.0", - "@typespec/xml": "0.57.0" + "@azure-tools/typespec-autorest": "0.44.0", + "@azure-tools/typespec-azure-core": "0.44.0", + "@azure-tools/typespec-azure-resource-manager": "0.44.0", + "@azure-tools/typespec-azure-rulesets": "0.44.0", + "@azure-tools/typespec-client-generator-core": "0.44.1", + "@typespec/compiler": "0.58.0", + "@typespec/http": "0.58.0", + "@typespec/openapi": "0.58.0", + "@typespec/rest": "0.58.0", + "@typespec/versioning": "0.58.0", + "@typespec/xml": "0.58.0" } } diff --git a/eng/mgmt/automation/swagger_to_sdk_config.json b/eng/mgmt/automation/swagger_to_sdk_config.json deleted file mode 100644 index 69c2545b9b49..000000000000 --- a/eng/mgmt/automation/swagger_to_sdk_config.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "$schema": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/documentation/sdkautomation/SwaggerToSdkConfigSchema.json", - "initOptions": { - "initScript": { - "path": "./eng/mgmt/automation/init.sh", - "envs": [ - "JAVA_HOME_11_X64" - ] - } - }, - "generateOptions": { - "generateScript": { - "path": "./eng/mgmt/automation/generate.py" - } - }, - "artifactOptions": { - "installInstructionScript": { - "path": "./eng/mgmt/automation/install_instruction.py" - } - }, - "advancedOptions": { - "generationCallMode": "one-per-config" - } -} \ No newline at end of file diff --git a/eng/pipelines/partner-release.yml b/eng/pipelines/partner-release.yml index 2a4052c95ac0..09054c7cec08 100644 --- a/eng/pipelines/partner-release.yml +++ b/eng/pipelines/partner-release.yml @@ -18,8 +18,6 @@ extends: - stage: displayName: 'Partner Release' variables: - - name: BuildToolScripts - value: $(Pipeline.Workspace)/azure-sdk-build-tools/scripts - name: Artifacts value: $(Pipeline.Workspace)/artifacts - name: EsrpArtifacts @@ -46,9 +44,14 @@ extends: azurePowerShellVersion: LatestVersion pwsh: true Inline: | + echo "azcopy copy 'https://azuresdkpartnerdrops.blob.core.windows.net/drops/${{ parameters.BlobPath }}/*' '$(Artifacts)' --recursive=true" azcopy copy 'https://azuresdkpartnerdrops.blob.core.windows.net/drops/${{ parameters.BlobPath }}/*' '$(Artifacts)' --recursive=true - echo "Copied files:" - dir '$(Artifacts)' -r | % { $_.FullName } + $copiedFiles = (dir '$(Artifacts)' -r | % { $_.FullName }) + echo "Copied files: $copiedFiles" + if (!$copiedFiles) { + echo "Failed to copy any files from 'https://azuresdkpartnerdrops.blob.core.windows.net/drops/${{ parameters.BlobPath }}/*' please double check they exist" + exit 1 + } env: AZCOPY_AUTO_LOGIN_TYPE: 'PSCRED' @@ -87,7 +90,6 @@ extends: ArtifactDirectory: $(Pipeline.Workspace)/packages-signed OutputDirectory: $(EsrpArtifacts) Target: EsrpRelease - BuildToolsPath: $(Pipeline.Workspace)/azure-sdk-build-tools JavaRepoRoot: $(Pipeline.Workspace)/azure-sdk-for-java ShouldPublish: ${{ parameters.ShouldPublish }} StageOnly: false diff --git a/eng/pipelines/templates/jobs/ci.tests.yml b/eng/pipelines/templates/jobs/ci.tests.yml index ba341ff8eff0..b258fb0499cb 100644 --- a/eng/pipelines/templates/jobs/ci.tests.yml +++ b/eng/pipelines/templates/jobs/ci.tests.yml @@ -45,6 +45,9 @@ parameters: - name: TimeoutInMinutes type: number default: 60 + - name: EnvVars + type: object + default: {} jobs: - job: @@ -146,6 +149,7 @@ jobs: TestOptions: ${{ parameters.TestOptions }} TestParallelization: ${{ parameters.TestParallelization }} BuildParallelization: ${{ parameters.BuildParallelization }} + TestEnvVars: ${{ parameters.EnvVars }} - template: /eng/pipelines/templates/steps/post-job-cleanup.yml diff --git a/eng/pipelines/templates/jobs/ci.yml b/eng/pipelines/templates/jobs/ci.yml index 1ed14d0c570d..482e8db842e7 100644 --- a/eng/pipelines/templates/jobs/ci.yml +++ b/eng/pipelines/templates/jobs/ci.yml @@ -58,6 +58,9 @@ parameters: - name: TimeoutInMinutes type: number default: 60 + - name: EnvVars + type: object + default: {} jobs: - job: 'Build' @@ -405,3 +408,4 @@ jobs: BuildParallelization: ${{ parameters.BuildParallelization }} AdditionalLintingOptions: ${{ parameters.AdditionalLintingOptions }} TimeoutInMinutes: ${{ parameters.TimeoutInMinutes }} + EnvVars: ${{ parameters.EnvVars }} diff --git a/eng/pipelines/templates/jobs/live.tests.yml b/eng/pipelines/templates/jobs/live.tests.yml index 78d95033ce8c..167082860d29 100644 --- a/eng/pipelines/templates/jobs/live.tests.yml +++ b/eng/pipelines/templates/jobs/live.tests.yml @@ -16,6 +16,7 @@ parameters: UsePlatformContainer: false DisableAzureResourceCreation: false BuildParallelization: '2C' + BuildOptions: '' TestGoals: $(TestGoals) TestOptions: $(TestOptions) TestParallelization: '1' @@ -139,6 +140,7 @@ jobs: parameters: ParallelTestPlayback: 'false' BuildParallelization: ${{ parameters.BuildParallelization }} + BuildOptions: ${{ parameters.BuildOptions }} IsLiveTest: true TestGoals: ${{ parameters.TestGoals }} TestOptions: ${{ parameters.TestOptions }} diff --git a/eng/pipelines/templates/stages/1es-redirect.yml b/eng/pipelines/templates/stages/1es-redirect.yml index 83a6d5f58390..8ff618cdd5fd 100644 --- a/eng/pipelines/templates/stages/1es-redirect.yml +++ b/eng/pipelines/templates/stages/1es-redirect.yml @@ -11,7 +11,7 @@ resources: - repository: azure-sdk-build-tools type: git name: internal/azure-sdk-build-tools - ref: refs/tags/azure-sdk-build-tools_20240628.1 + ref: refs/tags/azure-sdk-build-tools_20240711.1 parameters: - name: stages diff --git a/eng/pipelines/templates/stages/archetype-java-release-batch.yml b/eng/pipelines/templates/stages/archetype-java-release-batch.yml index cbef4ab17352..035fc384df55 100644 --- a/eng/pipelines/templates/stages/archetype-java-release-batch.yml +++ b/eng/pipelines/templates/stages/archetype-java-release-batch.yml @@ -222,7 +222,6 @@ stages: ArtifactDirectory: $(Pipeline.Workspace)/${{parameters.ArtifactName}}-signed OutputDirectory: $(Pipeline.Workspace)/EsrpPackages Target: EsrpRelease - BuildToolsPath: $(Pipeline.Workspace)/azure-sdk-build-tools JavaRepoRoot: $(Pipeline.Workspace)/azure-sdk-for-java - template: /eng/common/pipelines/templates/steps/publish-1es-artifact.yml parameters: @@ -236,7 +235,6 @@ stages: ArtifactDirectory: $(Pipeline.Workspace)/${{parameters.ArtifactName}}-signed RepositoryUrl: https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-java/maven/v1 Target: JavaDevFeed - BuildToolsPath: $(Pipeline.Workspace)/azure-sdk-build-tools JavaRepoRoot: $(Pipeline.Workspace)/azure-sdk-for-java - template: /eng/common/pipelines/templates/steps/publish-1es-artifact.yml parameters: diff --git a/eng/pipelines/templates/stages/archetype-java-release-patch.yml b/eng/pipelines/templates/stages/archetype-java-release-patch.yml index 48d101ca3860..416025296702 100644 --- a/eng/pipelines/templates/stages/archetype-java-release-patch.yml +++ b/eng/pipelines/templates/stages/archetype-java-release-patch.yml @@ -135,7 +135,6 @@ stages: ArtifactDirectory: $(Pipeline.Workspace)/${{parameters.ArtifactName}}-signed OutputDirectory: $(Pipeline.Workspace)/EsrpPackages Target: EsrpRelease - BuildToolsPath: $(Pipeline.Workspace)/azure-sdk-build-tools JavaRepoRoot: $(Pipeline.Workspace)/azure-sdk-for-java - template: /eng/common/pipelines/templates/steps/publish-1es-artifact.yml parameters: @@ -149,7 +148,6 @@ stages: ArtifactDirectory: $(Pipeline.Workspace)/${{parameters.ArtifactName}}-signed RepositoryUrl: https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-java/maven/v1 Target: JavaDevFeed - BuildToolsPath: $(Pipeline.Workspace)/azure-sdk-build-tools JavaRepoRoot: $(Pipeline.Workspace)/azure-sdk-for-java - template: /eng/common/pipelines/templates/steps/publish-1es-artifact.yml parameters: diff --git a/eng/pipelines/templates/stages/archetype-java-release-pom-only.yml b/eng/pipelines/templates/stages/archetype-java-release-pom-only.yml index 9ac4f4e12704..0d2e89af890c 100644 --- a/eng/pipelines/templates/stages/archetype-java-release-pom-only.yml +++ b/eng/pipelines/templates/stages/archetype-java-release-pom-only.yml @@ -119,7 +119,6 @@ stages: ArtifactDirectory: $(Pipeline.Workspace)/${{parameters.ArtifactName}}-signed OutputDirectory: $(Pipeline.Workspace)/EsrpPackages Target: EsrpRelease - BuildToolsPath: $(Pipeline.Workspace)/azure-sdk-build-tools JavaRepoRoot: $(Pipeline.Workspace)/azure-sdk-for-java - template: /eng/common/pipelines/templates/steps/publish-1es-artifact.yml parameters: @@ -135,7 +134,6 @@ stages: ArtifactDirectory: $(Pipeline.Workspace)/${{parameters.ArtifactName}}-signed RepositoryUrl: https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-java/maven/v1 Target: JavaDevFeed - BuildToolsPath: $(Pipeline.Workspace)/azure-sdk-build-tools JavaRepoRoot: $(Pipeline.Workspace)/azure-sdk-for-java - template: /eng/common/pipelines/templates/steps/publish-1es-artifact.yml parameters: diff --git a/eng/pipelines/templates/stages/archetype-sdk-client.yml b/eng/pipelines/templates/stages/archetype-sdk-client.yml index ae5663d52b22..5b95c65aeed0 100644 --- a/eng/pipelines/templates/stages/archetype-sdk-client.yml +++ b/eng/pipelines/templates/stages/archetype-sdk-client.yml @@ -64,6 +64,9 @@ parameters: - name: oneESTemplateTag type: string default: release + - name: EnvVars + type: object + default: {} extends: template: /eng/pipelines/templates/stages/1es-redirect.yml @@ -116,6 +119,7 @@ extends: - ${{ if eq(parameters.SDKType, 'data') }}: - JavaTestVersion=(.*1)\.\d{2}(.*)/$1.11$2 PreBuildSteps: ${{ parameters.PreBuildSteps }} + EnvVars: ${{ parameters.EnvVars }} AdditionalLintingOptions: ${{ parameters.AdditionalLintingOptions }} ${{ if eq(parameters.SDKType, 'data') }}: TestGoals: 'verify' diff --git a/eng/pipelines/templates/stages/archetype-sdk-native-tests.yml b/eng/pipelines/templates/stages/archetype-sdk-native-tests.yml index 4cf1f1776985..8ad353efe453 100644 --- a/eng/pipelines/templates/stages/archetype-sdk-native-tests.yml +++ b/eng/pipelines/templates/stages/archetype-sdk-native-tests.yml @@ -69,6 +69,7 @@ parameters: - eng/common/TestResources/sub-config/AzurePublicMsft.json Preview: SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources-preview) + ServiceConnection: azure-sdk-tests-preview Canary: SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources) Location: 'centraluseuap' diff --git a/eng/pipelines/templates/stages/archetype-sdk-tests-isolated.yml b/eng/pipelines/templates/stages/archetype-sdk-tests-isolated.yml index 2fd7b864f7a9..b5cdad87789f 100644 --- a/eng/pipelines/templates/stages/archetype-sdk-tests-isolated.yml +++ b/eng/pipelines/templates/stages/archetype-sdk-tests-isolated.yml @@ -44,6 +44,12 @@ parameters: - name: Location type: string default: '' +- name: PreGenerationSteps + type: stepList + default: [] +- name: BuildOptions + type: string + default: '' - name: ServiceDirectory type: string default: not-specified @@ -66,7 +72,7 @@ parameters: - eng/common/TestResources/sub-config/AzurePublicMsft.json Preview: SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources-preview) - ServiceConnection: azure-sdk-tests + ServiceConnection: azure-sdk-tests-preview Canary: SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources) ServiceConnection: azure-sdk-tests @@ -117,6 +123,9 @@ parameters: - name: UseFederatedAuth type: boolean default: false +- name: AdditionalSparseCheckoutPaths + type: object + default: [] stages: - ${{ each cloud in parameters.CloudConfig }}: @@ -138,10 +147,12 @@ stages: jobs: - template: /eng/common/pipelines/templates/jobs/generate-job-matrix.yml parameters: + PreGenerationSteps: ${{ parameters.PreGenerationSteps }} SparseCheckoutPaths: - "sdk/${{ parameters.ServiceDirectory }}/**/*.json" - '!sdk/**/test-recordings/*' - '!sdk/**/session-records/*' + - ${{ parameters.AdditionalSparseCheckoutPaths }} JobTemplatePath: /eng/pipelines/templates/jobs/live.tests.yml AdditionalParameters: PreSteps: @@ -150,6 +161,7 @@ stages: PostSteps: - ${{ parameters.PlatformPostSteps }} - ${{ parameters.PostSteps }} + BuildOptions: ${{ parameters.BuildOptions }} EnvVars: ${{ parameters.EnvVars }} MaxParallel: ${{ parameters.MaxParallel }} TimeoutInMinutes: ${{ parameters.TimeoutInMinutes }} diff --git a/eng/pipelines/templates/stages/archetype-sdk-tests.yml b/eng/pipelines/templates/stages/archetype-sdk-tests.yml index 77e51df93751..7d658bb1094a 100644 --- a/eng/pipelines/templates/stages/archetype-sdk-tests.yml +++ b/eng/pipelines/templates/stages/archetype-sdk-tests.yml @@ -66,7 +66,7 @@ parameters: - eng/common/TestResources/sub-config/AzurePublicMsft.json Preview: SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources-preview) - ServiceConnection: azure-sdk-tests + ServiceConnection: azure-sdk-tests-preview Canary: SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources) ServiceConnection: azure-sdk-tests diff --git a/eng/pipelines/templates/stages/cosmos-emulator-matrix.json b/eng/pipelines/templates/stages/cosmos-emulator-matrix.json index e51b07a07d7b..21a437cf6f0d 100644 --- a/eng/pipelines/templates/stages/cosmos-emulator-matrix.json +++ b/eng/pipelines/templates/stages/cosmos-emulator-matrix.json @@ -18,19 +18,6 @@ "JavaTestVersion": "1.17", "AdditionalArgs": "-DargLine=\"-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true\"" }, - "Spring Emulator Only Integration Tests - Java 8": { - "ProfileFlag": "-Pintegration-test-emulator", - "JavaTestVersion": "1.8", - "ACCOUNT_HOST": "https://localhost:8081/", - "ACCOUNT_KEY": "C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==", - "SECONDARY_ACCOUNT_KEY": "C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==", - "NEW_ACCOUNT_HOST": "https://localhost:8081/", - "NEW_ACCOUNT_KEY": "C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==", - "NEW_SECONDARY_ACCOUNT_KEY": "C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==", - "TestFromSource": true, - "AdditionalArgs": "-Dspring-e2e -DargLine=-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true", - "Language": "Spring" - }, "Spring Emulator Only Integration Tests - Java 17": { "ProfileFlag": "-Pintegration-test-emulator", "JavaTestVersion": "1.17", diff --git a/eng/pipelines/templates/steps/build-and-test.yml b/eng/pipelines/templates/steps/build-and-test.yml index 5cd0bc18011b..c24ac578f84b 100644 --- a/eng/pipelines/templates/steps/build-and-test.yml +++ b/eng/pipelines/templates/steps/build-and-test.yml @@ -2,6 +2,9 @@ parameters: - name: BuildParallelization type: string default: '2C' + - name: BuildOptions + type: string + default: '' - name: TestGoals type: string default: $(TestGoals) @@ -47,7 +50,7 @@ steps: displayName: 'Build for non-From Source run' inputs: mavenPomFile: pom.xml - options: $(DefaultOptions) -DskipTests $(DefaultSkipOptions) -Djacoco.skip=true -T ${{ parameters.BuildParallelization }} -pl $(ProjectList) -am + options: $(DefaultOptions) -DskipTests $(DefaultSkipOptions) -Djacoco.skip=true ${{ parameters.BuildOptions }} -T ${{ parameters.BuildParallelization }} -pl $(ProjectList) -am mavenOptions: '$(MemoryOptions) $(LoggingOptions)' javaHomeOption: 'JDKVersion' jdkVersionOption: $(JavaTestVersion) @@ -165,7 +168,7 @@ steps: # bloated the ci.yml files' AdditionalModules because we ended up having to list every transitive azure client # dependency. Note: The -T 1C says spin up a build thread per core. Since we're building # all the track 2, client, libraries (which is now over 100) this effectively cuts the build time in half. - options: $(DefaultOptions) -DskipTests $(DefaultSkipOptions) -Djacoco.skip=true -T ${{ parameters.BuildParallelization }} + options: $(DefaultOptions) -DskipTests $(DefaultSkipOptions) -Djacoco.skip=true ${{ parameters.BuildOptions }} -T ${{ parameters.BuildParallelization }} mavenOptions: '$(MemoryOptions) $(LoggingOptions)' javaHomeOption: 'JDKVersion' jdkVersionOption: $(JavaTestVersion) @@ -196,7 +199,7 @@ steps: $env:AZURESUBSCRIPTION_CLIENT_ID = $account.Id $env:AZURESUBSCRIPTION_TENANT_ID = $account.Tenants - mvn --% -f $(Build.SourcesDirectory)/ClientFromSourcePom.xml ${{ parameters.TestGoals }} $(DefaultTestOptions) -DAZURE_TEST_DEBUG=$(IsDebug) -Dparallel-test-playback=${{ parameters.ParallelTestPlayback }} ${{ parameters.TestOptions }} $(LiveTestSourceParams) -T ${{ parameters.TestParallelization }} + mvn --% -f $(Build.SourcesDirectory)/ClientFromSourcePom.xml ${{ parameters.TestGoals }} $(DefaultTestOptions) -DAZURE_TEST_DEBUG=$(IsDebug) -Dparallel-test-playback=${{ parameters.ParallelTestPlayback }} ${{ parameters.TestOptions }} $(LiveTestSourceParams) ${{ parameters.BuildOptions }} -T ${{ parameters.TestParallelization }} exit $LASTEXITCODE env: # PowerShellJavaHome is set in the 'Set PowerShellJavaHome' diff --git a/eng/pipelines/templates/variables/globals.yml b/eng/pipelines/templates/variables/globals.yml index 64c8cdcf8103..0cbfdc8742f7 100644 --- a/eng/pipelines/templates/variables/globals.yml +++ b/eng/pipelines/templates/variables/globals.yml @@ -24,7 +24,7 @@ variables: MAVEN_CACHE_FOLDER: $(Pipeline.Workspace)/.m2/repository # See https://github.com/actions/virtual-environments/issues/1499 for more info about the wagon options # If reports about Maven dependency downloads become more common investigate re-introducing "-Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false", or other iterations of the configurations. - WagonOptions: '-Dmaven.wagon.httpconnectionManager.ttlSeconds=60' + WagonOptions: '-Dmaven.wagon.httpconnectionManager.ttlSeconds=60 -Dmaven.wagon.http.pool=false' DefaultOptions: '-Dmaven.repo.local=$(MAVEN_CACHE_FOLDER) --batch-mode --fail-at-end --settings eng/settings.xml $(WagonOptions)' LoggingOptions: '-Dorg.slf4j.simpleLogger.defaultLogLevel=$(MavenLogLevel) -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn' MemoryOptions: '-Xmx4096m' diff --git a/eng/versioning/external_dependencies.txt b/eng/versioning/external_dependencies.txt index 726a2395080f..60ed81a2377d 100644 --- a/eng/versioning/external_dependencies.txt +++ b/eng/versioning/external_dependencies.txt @@ -201,25 +201,23 @@ com.microsoft.azure:azure-mgmt-resources;1.3.0 com.microsoft.azure:azure-mgmt-search;1.24.1 com.microsoft.azure:azure-mgmt-storage;1.3.0 com.microsoft.azure:azure-storage;8.0.0 -com.microsoft.azure:msal4j;1.15.1 +com.microsoft.azure:msal4j;1.16.1 com.microsoft.azure:msal4j-brokers;1.0.0 com.microsoft.azure:msal4j-persistence-extension;1.3.0 com.sun.activation:jakarta.activation;1.2.2 -io.opentelemetry:opentelemetry-api;1.38.0 -io.opentelemetry:opentelemetry-sdk;1.38.0 -io.opentelemetry:opentelemetry-sdk-metrics;1.38.0 -io.opentelemetry:opentelemetry-sdk-logs;1.38.0 -io.opentelemetry:opentelemetry-exporter-logging;1.38.0 -io.opentelemetry:opentelemetry-exporter-otlp;1.38.0 -io.opentelemetry:opentelemetry-sdk-testing;1.38.0 -io.opentelemetry:opentelemetry-sdk-extension-autoconfigure;1.38.0 -io.opentelemetry:opentelemetry-sdk-extension-autoconfigure-spi;1.38.0 -io.opentelemetry:opentelemetry-bom;1.38.0 -io.opentelemetry.instrumentation:opentelemetry-instrumentation-bom-alpha;2.4.0-alpha -io.opentelemetry.instrumentation:opentelemetry-runtime-telemetry-java8;2.4.0-alpha -io.opentelemetry.instrumentation:opentelemetry-spring-boot-starter;2.4.0-alpha -io.opentelemetry.instrumentation:opentelemetry-jdbc;2.4.0-alpha -io.opentelemetry.instrumentation:opentelemetry-logback-appender-1.0;2.4.0-alpha +io.opentelemetry:opentelemetry-api;1.40.0 +io.opentelemetry:opentelemetry-sdk;1.40.0 +io.opentelemetry:opentelemetry-sdk-metrics;1.40.0 +io.opentelemetry:opentelemetry-sdk-logs;1.40.0 +io.opentelemetry:opentelemetry-exporter-logging;1.40.0 +io.opentelemetry:opentelemetry-exporter-otlp;1.40.0 +io.opentelemetry:opentelemetry-sdk-testing;1.40.0 +io.opentelemetry:opentelemetry-sdk-extension-autoconfigure;1.40.0 +io.opentelemetry:opentelemetry-sdk-extension-autoconfigure-spi;1.40.0 +io.opentelemetry:opentelemetry-bom;1.40.0 +io.opentelemetry.instrumentation:opentelemetry-runtime-telemetry-java8;2.6.0-alpha +io.opentelemetry.instrumentation:opentelemetry-spring-boot-starter;2.6.0 +io.opentelemetry.instrumentation:opentelemetry-logback-appender-1.0;2.6.0-alpha io.opentelemetry.semconv:opentelemetry-semconv-incubating;1.25.0-alpha io.projectreactor:reactor-test;3.4.38 @@ -448,3 +446,102 @@ spring_com.microsoft.azure:azure;1.34.0 # sdk\spring\spring-cloud-azure-service\pom.xml spring_redis.clients:jedis;3.8.0 + +# sdk\spring\pom.xml modules +springboot3_com.diffplug.spotless:spotless-maven-plugin;2.30.0 +springboot3_com.fasterxml.jackson.core:jackson-annotations;2.17.2 +springboot3_com.fasterxml.jackson.core:jackson-core;2.17.2 +springboot3_com.fasterxml.jackson.core:jackson-databind;2.17.2 +springboot3_com.fasterxml.jackson.dataformat:jackson-dataformat-xml;2.17.2 +springboot3_com.fasterxml.jackson.datatype:jackson-datatype-jdk8;2.17.2 +springboot3_com.fasterxml.jackson.datatype:jackson-datatype-jsr310;2.17.2 +springboot3_com.fasterxml.jackson.module:jackson-module-afterburner;2.17.2 +springboot3_com.fasterxml.jackson.module:jackson-module-parameter-names;2.17.2 +springboot3_com.github.spotbugs:spotbugs-maven-plugin;4.8.2.0 +springboot3_com.google.code.findbugs:jsr305;3.0.2 +springboot3_com.mysql:mysql-connector-j;8.3.0 +springboot3_com.nimbusds:nimbus-jose-jwt;9.37.3 +springboot3_io.lettuce:lettuce-core;6.3.2.RELEASE +springboot3_io.micrometer:micrometer-core;1.13.2 +springboot3_io.netty:netty-buffer;4.1.111.Final +springboot3_io.netty:netty-codec-http;4.1.111.Final +springboot3_io.netty:netty-common;4.1.111.Final +springboot3_io.netty:netty-handler;4.1.111.Final +springboot3_io.netty:netty-transport-native-epoll;4.1.111.Final +springboot3_io.netty:netty-transport-native-kqueue;4.1.111.Final +springboot3_io.netty:netty-transport;4.1.111.Final +springboot3_io.projectreactor.netty:reactor-netty;1.1.21 +springboot3_io.projectreactor:reactor-test;3.6.8 +springboot3_jakarta.servlet:jakarta.servlet-api;6.0.0 +springboot3_jakarta.validation:jakarta.validation-api;3.0.2 +springboot3_javax.annotation:javax.annotation-api;1.3.2 +springboot3_junit:junit;4.13.2 +springboot3_net.bytebuddy:byte-buddy-agent;1.14.18 +springboot3_net.bytebuddy:byte-buddy;1.14.18 +springboot3_org.apache.commons:commons-lang3;3.14.0 +springboot3_org.apache.kafka:kafka-clients;3.7.1 +springboot3_org.apache.maven.plugins:maven-antrun-plugin;3.1.0 +springboot3_org.apache.maven.plugins:maven-compiler-plugin;3.13.0 +springboot3_org.apache.maven.plugins:maven-enforcer-plugin;3.4.1 +springboot3_org.apache.maven.plugins:maven-failsafe-plugin;3.2.5 +springboot3_org.apache.maven.plugins:maven-jar-plugin;3.4.2 +springboot3_org.apache.maven.plugins:maven-javadoc-plugin;3.6.3 +springboot3_org.apache.maven.plugins:maven-surefire-plugin;3.2.5 +springboot3_org.apache.qpid:qpid-jms-client;2.0.0 +springboot3_org.assertj:assertj-core;3.25.3 +springboot3_org.hibernate.validator:hibernate-validator;8.0.1.Final +springboot3_org.javatuples:javatuples;1.2 +springboot3_org.junit.jupiter:junit-jupiter;5.10.3 +springboot3_org.junit.vintage:junit-vintage-engine;5.10.3 +springboot3_org.messaginghub:pooled-jms;3.1.6 +springboot3_org.mockito:mockito-core;5.11.0 +springboot3_org.postgresql:postgresql;42.7.3 +springboot3_org.revapi:revapi-maven-plugin;0.14.6 +springboot3_org.slf4j:slf4j-api;2.0.13 +springboot3_org.slf4j:slf4j-simple;2.0.13 +springboot3_org.springframework.boot:spring-boot-actuator-autoconfigure;3.3.2 +springboot3_org.springframework.boot:spring-boot-actuator;3.3.2 +springboot3_org.springframework.boot:spring-boot-autoconfigure;3.3.2 +springboot3_org.springframework.boot:spring-boot-configuration-metadata;3.3.2 +springboot3_org.springframework.boot:spring-boot-configuration-processor;3.3.2 +springboot3_org.springframework.boot:spring-boot-dependencies;3.3.2 +springboot3_org.springframework.boot:spring-boot-starter-actuator;3.3.2 +springboot3_org.springframework.boot:spring-boot-starter-integration;3.3.2 +springboot3_org.springframework.boot:spring-boot-starter-parent;3.3.2 +springboot3_org.springframework.boot:spring-boot-starter-test;3.3.2 +springboot3_org.springframework.boot:spring-boot-starter-web;3.3.2 +springboot3_org.springframework.boot:spring-boot-starter;3.3.2 +springboot3_org.springframework.boot:spring-boot-test;3.3.2 +springboot3_org.springframework.boot:spring-boot-testcontainers;3.3.2 +springboot3_org.springframework.cloud:spring-cloud-bus;4.1.2 +springboot3_org.springframework.cloud:spring-cloud-context;4.1.4 +springboot3_org.springframework.cloud:spring-cloud-starter-bootstrap;4.1.4 +springboot3_org.springframework.cloud:spring-cloud-starter-stream-kafka;4.1.3 +springboot3_org.springframework.cloud:spring-cloud-stream-test-binder;4.1.3 +springboot3_org.springframework.cloud:spring-cloud-stream;4.1.3 +springboot3_org.springframework.data:spring-data-commons;3.3.2 +springboot3_org.springframework.data:spring-data-redis;3.3.2 +springboot3_org.springframework.integration:spring-integration-core;6.3.2 +springboot3_org.springframework.kafka:spring-kafka;3.2.2 +springboot3_org.springframework.retry:spring-retry;2.0.7 +springboot3_org.springframework.security:spring-security-config;6.3.1 +springboot3_org.springframework.security:spring-security-oauth2-client;6.3.1 +springboot3_org.springframework.security:spring-security-oauth2-jose;6.3.1 +springboot3_org.springframework.security:spring-security-oauth2-resource-server;6.3.1 +springboot3_org.springframework.security:spring-security-web;6.3.1 +springboot3_org.springframework:spring-beans;6.1.11 +springboot3_org.springframework:spring-context-support;6.1.11 +springboot3_org.springframework:spring-context;6.1.11 +springboot3_org.springframework:spring-core-test;6.1.11 +springboot3_org.springframework:spring-core;6.1.11 +springboot3_org.springframework:spring-expression;6.1.11 +springboot3_org.springframework:spring-jdbc;6.1.11 +springboot3_org.springframework:spring-jms;6.1.11 +springboot3_org.springframework:spring-messaging;6.1.11 +springboot3_org.springframework:spring-test;6.1.11 +springboot3_org.springframework:spring-tx;6.1.11 +springboot3_org.springframework:spring-web;6.1.11 +springboot3_org.springframework:spring-webmvc;6.1.11 +springboot3_org.testcontainers:testcontainers;1.19.8 +springboot3_org.testcontainers:junit-jupiter;1.19.8 +springboot3_org.testcontainers:azure;1.19.8 diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 2e882e9907d8..76c35ca54209 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -67,7 +67,7 @@ com.azure:azure-aot-graalvm-support-netty;1.0.0-beta.3;1.0.0-beta.4 com.azure:azure-aot-graalvm-samples;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-aot-graalvm-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-code-customization-parent;1.0.0-beta.1;1.0.0-beta.1 -com.azure:azure-communication-callautomation;1.2.2;1.2.0-beta.1 +com.azure:azure-communication-callautomation;1.2.2;1.3.0-beta.1 com.azure:azure-communication-callingserver;1.0.0-beta.4;1.0.0-beta.5 com.azure:azure-communication-chat;1.5.2;1.6.0-beta.1 com.azure:azure-communication-common;1.3.4;1.4.0-beta.1 @@ -82,22 +82,22 @@ com.azure:azure-communication-sms;1.1.25;1.2.0-beta.1 com.azure:azure-compute-batch;1.0.0-beta.2;1.0.0-beta.3 com.azure:azure-containers-containerregistry;1.2.9;1.3.0-beta.1 com.azure:azure-containers-containerregistry-perf;1.0.0-beta.1;1.0.0-beta.1 -com.azure:azure-core;1.49.1;1.50.0-beta.1 -com.azure:azure-core-amqp;2.9.6;2.10.0-beta.1 +com.azure:azure-core;1.50.0;1.51.0-beta.1 +com.azure:azure-core-amqp;2.9.7;2.10.0-beta.1 com.azure:azure-core-amqp-experimental;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-core-experimental;1.0.0-beta.51;1.0.0-beta.52 com.azure:azure-core-http-jdk-httpclient;1.0.0-beta.14;1.0.0-beta.15 -com.azure:azure-core-http-netty;1.15.1;1.16.0-beta.1 -com.azure:azure-core-http-okhttp;1.12.0;1.13.0-beta.1 +com.azure:azure-core-http-netty;1.15.2;1.16.0-beta.1 +com.azure:azure-core-http-okhttp;1.12.1;1.13.0-beta.1 com.azure:azure-core-http-vertx;1.0.0-beta.19;1.0.0-beta.20 -com.azure:azure-core-management;1.15.0;1.16.0-beta.1 +com.azure:azure-core-management;1.15.1;1.16.0-beta.1 com.azure:azure-core-metrics-opentelemetry;1.0.0-beta.20;1.0.0-beta.21 com.azure:azure-core-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-core-serializer-avro-apache;1.0.0-beta.47;1.0.0-beta.48 com.azure:azure-core-serializer-avro-jackson;1.0.0-beta.1;1.0.0-beta.2 -com.azure:azure-core-serializer-json-gson;1.2.13;1.3.0-beta.1 -com.azure:azure-core-serializer-json-jackson;1.4.13;1.5.0-beta.1 -com.azure:azure-core-test;1.26.0;1.27.0-beta.1 +com.azure:azure-core-serializer-json-gson;1.2.14;1.3.0-beta.1 +com.azure:azure-core-serializer-json-jackson;1.4.14;1.5.0-beta.1 +com.azure:azure-core-test;1.26.1;1.27.0-beta.1 com.azure:azure-core-tracing-opentelemetry;1.0.0-beta.47;1.0.0-beta.48 com.azure:azure-core-tracing-opentelemetry-samples;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-core-version-tests;1.0.0-beta.1;1.0.0-beta.1 @@ -126,12 +126,13 @@ com.azure:azure-developer-devcenter;1.0.1;1.1.0-beta.1 com.azure:azure-developer-loadtesting;1.0.14;1.1.0-beta.1 com.azure:azure-digitaltwins-core;1.3.21;1.4.0-beta.1 com.azure:azure-e2e;1.0.0-beta.1;1.0.0-beta.1 +com.azure:azure-health-deidentification;1.0.0;1.0.0-beta.1 com.azure:azure-health-insights-clinicalmatching;1.0.0-beta.1;1.0.0-beta.2 com.azure:azure-health-insights-cancerprofiling;1.0.0-beta.1;1.0.0-beta.2 com.azure:azure-health-insights-radiologyinsights;1.0.0-beta.1;1.0.0-beta.2 -com.azure:azure-identity;1.13.0;1.14.0-beta.1 +com.azure:azure-identity;1.13.1;1.14.0-beta.1 com.azure:azure-identity-extensions;1.1.17;1.2.0-beta.2 -com.azure:azure-identity-broker;1.1.2;1.2.0-beta.1 +com.azure:azure-identity-broker;1.1.3;1.2.0-beta.1 com.azure:azure-identity-broker-samples;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-identity-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-iot-deviceupdate;1.0.19;1.1.0-beta.1 @@ -150,13 +151,13 @@ com.azure:azure-media-videoanalyzer-edge;1.0.0-beta.6;1.0.0-beta.7 com.azure:azure-messaging-eventgrid;4.22.3;4.23.0-beta.1 com.azure:azure-messaging-eventgrid-namespaces;1.0.0;1.1.0-beta.1 com.azure:azure-messaging-eventgrid-cloudnative-cloudevents;1.0.0-beta.1;1.0.0-beta.2 -com.azure:azure-messaging-eventhubs;5.18.4;5.18.5 -com.azure:azure-messaging-eventhubs-checkpointstore-blob;1.19.4;1.19.5 +com.azure:azure-messaging-eventhubs;5.18.5;5.19.0-beta.2 +com.azure:azure-messaging-eventhubs-checkpointstore-blob;1.19.5;1.20.0-beta.2 com.azure:azure-messaging-eventhubs-checkpointstore-jedis;1.0.0-beta.3;1.0.0-beta.4 com.azure:azure-messaging-eventhubs-stress;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-messaging-eventhubs-track1-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-messaging-eventhubs-track2-perf;1.0.0-beta.1;1.0.0-beta.1 -com.azure:azure-messaging-servicebus;7.17.0;7.17.1 +com.azure:azure-messaging-servicebus;7.17.1;7.18.0-beta.2 com.azure:azure-messaging-servicebus-stress;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-messaging-servicebus-track1-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-messaging-servicebus-track2-perf;1.0.0-beta.1;1.0.0-beta.1 @@ -167,17 +168,17 @@ com.azure:azure-mixedreality-remoterendering;1.1.30;1.2.0-beta.1 com.azure:azure-monitor-opentelemetry-exporter;1.0.0-beta.25;1.0.0-beta.26 com.azure:azure-monitor-ingestion;1.2.2;1.3.0-beta.1 com.azure:azure-monitor-ingestion-perf;1.0.0-beta.1;1.0.0-beta.1 -com.azure:azure-monitor-query;1.4.0;1.5.0-beta.1 +com.azure:azure-monitor-query;1.4.0;1.5.0 com.azure:azure-monitor-query-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-perf-test-parent;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-quantum-jobs;1.0.0-beta.1;1.0.0-beta.2 -com.azure:azure-search-documents;11.6.6;11.7.0-beta.4 +com.azure:azure-search-documents;11.7.0;11.8.0-beta.1 com.azure:azure-search-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-security-attestation;1.1.25;1.2.0-beta.1 com.azure:azure-security-confidentialledger;1.0.21;1.1.0-beta.1 com.azure:azure-security-keyvault-administration;4.5.5;4.6.0-beta.1 com.azure:azure-security-keyvault-certificates;4.6.4;4.7.0-beta.1 -com.azure:azure-security-keyvault-jca;2.8.1;2.9.0-beta.2 +com.azure:azure-security-keyvault-jca;2.8.1;2.9.0-beta.3 com.azure:azure-security-test-keyvault-jca;1.0.0;1.0.0 com.azure:azure-security-keyvault-keys;4.8.5;4.9.0-beta.1 com.azure:azure-security-keyvault-secrets;4.8.4;4.9.0-beta.1 @@ -185,18 +186,17 @@ com.azure:azure-security-keyvault-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-sdk-template;1.1.1234;1.2.2-beta.1 com.azure:azure-sdk-template-two;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-sdk-template-three;1.0.0-beta.1;1.0.0-beta.1 -com.azure:azure-spring-data-cosmos;3.46.0;3.47.0-beta.1 -com.azure:azure-storage-blob;12.26.1;12.27.0-beta.2 -com.azure:azure-storage-blob-batch;12.22.1;12.23.0-beta.2 +com.azure:azure-storage-blob;12.26.1;12.27.0 +com.azure:azure-storage-blob-batch;12.22.1;12.23.0 com.azure:azure-storage-blob-changefeed;12.0.0-beta.22;12.0.0-beta.23 -com.azure:azure-storage-blob-cryptography;12.25.1;12.26.0-beta.2 +com.azure:azure-storage-blob-cryptography;12.25.1;12.26.0 com.azure:azure-storage-blob-nio;12.0.0-beta.23;12.0.0-beta.24 -com.azure:azure-storage-common;12.25.1;12.26.0-beta.2 -com.azure:azure-storage-file-share;12.22.1;12.23.0-beta.2 -com.azure:azure-storage-file-datalake;12.19.1;12.20.0-beta.2 -com.azure:azure-storage-internal-avro;12.11.1;12.12.0-beta.2 +com.azure:azure-storage-common;12.25.1;12.26.0 +com.azure:azure-storage-file-share;12.22.1;12.23.0 +com.azure:azure-storage-file-datalake;12.19.1;12.20.0 +com.azure:azure-storage-internal-avro;12.11.1;12.12.0 com.azure:azure-storage-perf;1.0.0-beta.1;1.0.0-beta.1 -com.azure:azure-storage-queue;12.21.1;12.22.0-beta.2 +com.azure:azure-storage-queue;12.21.1;12.22.0 com.azure:azure-template-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-template-stress;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-verticals-agrifood-farming;1.0.0-beta.3;1.0.0-beta.4 @@ -210,58 +210,59 @@ com.azure:identity-test-webapp;0.0.1-SNAPSHOT;0.0.1-SNAPSHOT com.azure:azure-ai-vision-face;1.0.0-beta.1;1.0.0-beta.2 com.azure.spring:azure-monitor-spring-native;1.0.0-beta.1;1.0.0-beta.1 com.azure.spring:azure-monitor-spring-native-test;1.0.0-beta.1;1.0.0-beta.1 -com.azure.spring:spring-cloud-azure-appconfiguration-config-web;4.19.0;4.20.0-beta.1 -com.azure.spring:spring-cloud-azure-appconfiguration-config;4.19.0;4.20.0-beta.1 -com.azure.spring:spring-cloud-azure-feature-management-web;4.19.0;4.20.0-beta.1 -com.azure.spring:spring-cloud-azure-feature-management;4.19.0;4.20.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-appconfiguration-config;4.19.0;4.20.0-beta.1 -com.azure.spring:spring-cloud-azure-dependencies;4.19.0;4.20.0-beta.1 -com.azure.spring:spring-messaging-azure;4.19.0;4.20.0-beta.1 -com.azure.spring:spring-messaging-azure-eventhubs;4.19.0;4.20.0-beta.1 -com.azure.spring:spring-messaging-azure-servicebus;4.19.0;4.20.0-beta.1 -com.azure.spring:spring-messaging-azure-storage-queue;4.19.0;4.20.0-beta.1 -com.azure.spring:spring-integration-azure-core;4.19.0;4.20.0-beta.1 -com.azure.spring:spring-integration-azure-eventhubs;4.19.0;4.20.0-beta.1 -com.azure.spring:spring-integration-azure-servicebus;4.19.0;4.20.0-beta.1 -com.azure.spring:spring-integration-azure-storage-queue;4.19.0;4.20.0-beta.1 -com.azure.spring:spring-cloud-azure-core;4.19.0;4.20.0-beta.1 -com.azure.spring:spring-cloud-azure-actuator-autoconfigure;4.19.0;4.20.0-beta.1 -com.azure.spring:spring-cloud-azure-actuator;4.19.0;4.20.0-beta.1 -com.azure.spring:spring-cloud-azure-autoconfigure;4.19.0;4.20.0-beta.1 -com.azure.spring:spring-cloud-azure-resourcemanager;4.19.0;4.20.0-beta.1 -com.azure.spring:spring-cloud-azure-service;4.19.0;4.20.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-active-directory;4.19.0;4.20.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-active-directory-b2c;4.19.0;4.20.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-actuator;4.19.0;4.20.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-appconfiguration;4.19.0;4.20.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-cosmos;4.19.0;4.20.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-data-cosmos;4.19.0;4.20.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-eventhubs;4.19.0;4.20.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-eventgrid;4.19.0;4.20.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-jdbc-mysql;4.19.0;4.20.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-jdbc-postgresql;4.19.0;4.20.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-redis;4.19.0;4.20.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-keyvault;4.19.0;4.20.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-keyvault-certificates;4.19.0;4.20.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-keyvault-secrets;4.19.0;4.20.0-beta.1 +com.azure.spring:spring-cloud-azure-appconfiguration-config-web;5.13.0;5.14.0-beta.1 +com.azure.spring:spring-cloud-azure-appconfiguration-config;5.13.0;5.14.0-beta.1 +com.azure.spring:spring-cloud-azure-feature-management-web;5.13.0;5.14.0-beta.1 +com.azure.spring:spring-cloud-azure-feature-management;5.13.0;5.14.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-appconfiguration-config;5.13.0;5.14.0-beta.1 +com.azure.spring:spring-cloud-azure-dependencies;5.13.0;5.14.0-beta.1 +com.azure.spring:spring-messaging-azure;5.13.0;5.14.0-beta.1 +com.azure.spring:spring-messaging-azure-eventhubs;5.13.0;5.14.0-beta.1 +com.azure.spring:spring-messaging-azure-servicebus;5.13.0;5.14.0-beta.1 +com.azure.spring:spring-messaging-azure-storage-queue;5.13.0;5.14.0-beta.1 +com.azure.spring:spring-integration-azure-core;5.13.0;5.14.0-beta.1 +com.azure.spring:spring-integration-azure-eventhubs;5.13.0;5.14.0-beta.1 +com.azure.spring:spring-integration-azure-servicebus;5.13.0;5.14.0-beta.1 +com.azure.spring:spring-integration-azure-storage-queue;5.13.0;5.14.0-beta.1 +com.azure.spring:spring-cloud-azure-core;5.13.0;5.14.0-beta.1 +com.azure.spring:spring-cloud-azure-actuator-autoconfigure;5.13.0;5.14.0-beta.1 +com.azure.spring:spring-cloud-azure-actuator;5.13.0;5.14.0-beta.1 +com.azure.spring:spring-cloud-azure-autoconfigure;5.13.0;5.14.0-beta.1 +com.azure.spring:spring-cloud-azure-resourcemanager;5.13.0;5.14.0-beta.1 +com.azure.spring:spring-cloud-azure-service;5.13.0;5.14.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-active-directory;5.13.0;5.14.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-active-directory-b2c;5.13.0;5.14.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-actuator;5.13.0;5.14.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-appconfiguration;5.13.0;5.14.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-cosmos;5.13.0;5.14.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-data-cosmos;5.13.0;5.14.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-data-redis-lettuce;5.13.0;5.14.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-eventhubs;5.13.0;5.14.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-eventgrid;5.13.0;5.14.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-jdbc-mysql;5.13.0;5.14.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-jdbc-postgresql;5.13.0;5.14.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-keyvault;5.13.0;5.14.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-keyvault-certificates;5.13.0;5.14.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-keyvault-secrets;5.13.0;5.14.0-beta.1 com.azure.spring:spring-cloud-azure-starter-monitor;1.0.0-beta.5;1.0.0-beta.6 -com.azure.spring:spring-cloud-azure-starter-servicebus-jms;4.19.0;4.20.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-servicebus;4.19.0;4.20.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-storage;4.19.0;4.20.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-storage-blob;4.19.0;4.20.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-storage-file-share;4.19.0;4.20.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-storage-queue;4.19.0;4.20.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-integration-eventhubs;4.19.0;4.20.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-integration-servicebus;4.19.0;4.20.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-integration-storage-queue;4.19.0;4.20.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-stream-eventhubs;4.19.0;4.20.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-stream-servicebus;4.19.0;4.20.0-beta.1 -com.azure.spring:spring-cloud-azure-starter;4.19.0;4.20.0-beta.1 -com.azure.spring:spring-cloud-azure-stream-binder-eventhubs-core;4.19.0;4.20.0-beta.1 -com.azure.spring:spring-cloud-azure-stream-binder-eventhubs;4.19.0;4.20.0-beta.1 -com.azure.spring:spring-cloud-azure-stream-binder-servicebus-core;4.19.0;4.20.0-beta.1 -com.azure.spring:spring-cloud-azure-stream-binder-servicebus;4.19.0;4.20.0-beta.1 -com.azure.spring:spring-cloud-azure-trace-sleuth;4.19.0;4.20.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-servicebus-jms;5.13.0;5.14.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-servicebus;5.13.0;5.14.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-storage;5.13.0;5.14.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-storage-blob;5.13.0;5.14.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-storage-file-share;5.13.0;5.14.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-storage-queue;5.13.0;5.14.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-integration-eventhubs;5.13.0;5.14.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-integration-servicebus;5.13.0;5.14.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-integration-storage-queue;5.13.0;5.14.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-stream-eventhubs;5.13.0;5.14.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-stream-servicebus;5.13.0;5.14.0-beta.1 +com.azure.spring:spring-cloud-azure-starter;5.13.0;5.14.0-beta.1 +com.azure.spring:spring-cloud-azure-stream-binder-eventhubs-core;5.13.0;5.14.0-beta.1 +com.azure.spring:spring-cloud-azure-stream-binder-eventhubs;5.13.0;5.14.0-beta.1 +com.azure.spring:spring-cloud-azure-stream-binder-servicebus-core;5.13.0;5.14.0-beta.1 +com.azure.spring:spring-cloud-azure-stream-binder-servicebus;5.13.0;5.14.0-beta.1 +com.azure.spring:spring-cloud-azure-testcontainers;5.14.0-beta.1;5.14.0-beta.1 +com.azure:azure-spring-data-cosmos;5.13.0;5.14.0-beta.1 com.azure.resourcemanager:azure-resourcemanager;2.40.0;2.41.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-appplatform;2.40.0;2.41.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-appservice;2.40.0;2.41.0-beta.1 @@ -303,7 +304,7 @@ com.azure.resourcemanager:azure-resourcemanager-eventgrid;1.1.0;1.2.0-beta.7 com.azure.resourcemanager:azure-resourcemanager-healthbot;1.0.0-beta.2;1.0.0-beta.3 com.azure.resourcemanager:azure-resourcemanager-confluent;1.1.0;1.2.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-digitaltwins;1.2.0;1.3.0-beta.1 -com.azure.resourcemanager:azure-resourcemanager-netapp;1.2.0;1.3.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-netapp;1.3.0;1.4.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-storagecache;1.0.0-beta.11;1.0.0-beta.12 com.azure.resourcemanager:azure-resourcemanager-redisenterprise;2.0.0;2.1.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-hybridkubernetes;1.0.0-beta.3;1.0.0-beta.4 @@ -343,7 +344,7 @@ com.azure.resourcemanager:azure-resourcemanager-devspaces;1.0.0-beta.2;1.0.0-bet com.azure.resourcemanager:azure-resourcemanager-devtestlabs;1.0.0;1.1.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-hanaonazure;1.0.0-beta.2;1.0.0-beta.3 com.azure.resourcemanager:azure-resourcemanager-healthcareapis;1.1.0;1.2.0-beta.1 -com.azure.resourcemanager:azure-resourcemanager-hybridcompute;1.0.0-beta.5;1.0.0-beta.6 +com.azure.resourcemanager:azure-resourcemanager-hybridcompute;1.0.0-beta.6;1.0.0-beta.7 com.azure.resourcemanager:azure-resourcemanager-logic;1.0.0-beta.2;1.0.0-beta.3 com.azure.resourcemanager:azure-resourcemanager-maintenance;1.0.0;1.1.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-machinelearningservices;1.0.0-beta.1;1.0.0-beta.2 @@ -388,7 +389,7 @@ com.azure.resourcemanager:azure-resourcemanager-quota;1.0.0;1.1.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-extendedlocation;1.0.0-beta.2;1.0.0-beta.3 com.azure.resourcemanager:azure-resourcemanager-logz;1.0.0-beta.2;1.0.0-beta.3 com.azure.resourcemanager:azure-resourcemanager-storagepool;1.0.0-beta.2;1.0.0-beta.3 -com.azure.resourcemanager:azure-resourcemanager-dataprotection;1.2.0;1.3.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-dataprotection;1.3.0;1.4.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-desktopvirtualization;1.1.0;1.2.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-loadtesting;1.0.0;1.1.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-automanage;1.0.0-beta.1;1.0.0-beta.2 @@ -400,7 +401,7 @@ com.azure.resourcemanager:azure-resourcemanager-mobilenetwork;1.2.0;1.3.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-azureadexternalidentities;1.0.0-beta.1;1.0.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-dashboard;1.0.0;1.1.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-servicelinker;1.0.0-beta.2;1.0.0-beta.3 -com.azure.resourcemanager:azure-resourcemanager-appcontainers;1.0.0-beta.7;1.0.0-beta.8 +com.azure.resourcemanager:azure-resourcemanager-appcontainers;1.0.0-beta.8;1.0.0-beta.9 com.azure.resourcemanager:azure-resourcemanager-scvmm;1.0.0;1.1.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-hardwaresecuritymodules;1.0.0-beta.2;1.0.0-beta.3 com.azure.resourcemanager:azure-resourcemanager-workloads;1.0.0;1.1.0-beta.1 @@ -462,8 +463,9 @@ com.azure.resourcemanager:azure-resourcemanager-standbypool;1.0.0-beta.1;1.0.0-b com.azure.resourcemanager:azure-resourcemanager-edgezones;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-devopsinfrastructure;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-oracledatabase;1.0.0;1.1.0-beta.1 -com.azure.resourcemanager:azure-resourcemanager-informaticadatamanagement;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-informaticadatamanagement;1.0.0;1.1.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-mongocluster;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-computefleet;1.0.0-beta.2;1.0.0-beta.3 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 @@ -480,7 +482,7 @@ io.clientcore:http-stress;1.0.0-beta.1;1.0.0-beta.1 # note: The unreleased dependencies will not be manipulated with the automatic PR creation code. # In the pom, the version update tag after the version should name the unreleased package and the dependency version: # -unreleased_com.azure:azure-core;1.50.0-beta.1 +unreleased_com.azure:azure-identity;1.14.0-beta.1 # Released Beta dependencies: Copy the entry from above, prepend "beta_", remove the current # version and set the version to the released beta. Released beta dependencies are only valid @@ -489,4 +491,3 @@ unreleased_com.azure:azure-core;1.50.0-beta.1 # Format; # beta_:;dependency-version # note: Released beta versions will not be manipulated with the automatic PR creation code. -beta_com.azure:azure-identity;1.13.0-beta.2 diff --git a/pom.xml b/pom.xml index 5090732934e2..bab1932942a3 100644 --- a/pom.xml +++ b/pom.xml @@ -44,6 +44,7 @@ sdk/cognitiveservices sdk/commerce sdk/communication + sdk/computefleet sdk/confidentialledger sdk/confluent sdk/connectedvmware @@ -101,6 +102,7 @@ sdk/hdinsight sdk/healthbot sdk/healthcareapis + sdk/healthdataaiservices sdk/healthinsights sdk/hybridcompute sdk/hybridconnectivity diff --git a/sdk/advisor/azure-resourcemanager-advisor/pom.xml b/sdk/advisor/azure-resourcemanager-advisor/pom.xml index 4dcdcc6a95e8..5c842987e050 100644 --- a/sdk/advisor/azure-resourcemanager-advisor/pom.xml +++ b/sdk/advisor/azure-resourcemanager-advisor/pom.xml @@ -44,23 +44,23 @@ com.azure azure-core - 1.49.1 + 1.50.0 com.azure azure-core-management - 1.15.0 + 1.15.1 com.azure azure-core-test - 1.26.0 + 1.26.1 test com.azure azure-identity - 1.13.0 + 1.13.1 test diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/pom.xml b/sdk/agrifood/azure-resourcemanager-agrifood/pom.xml index a13367745e1c..c91930b27bbd 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/pom.xml +++ b/sdk/agrifood/azure-resourcemanager-agrifood/pom.xml @@ -44,23 +44,23 @@ com.azure azure-core - 1.49.1 + 1.50.0 com.azure azure-core-management - 1.15.0 + 1.15.1 com.azure azure-core-test - 1.26.0 + 1.26.1 test com.azure azure-identity - 1.13.0 + 1.13.1 test diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/README.md b/sdk/agrifood/azure-verticals-agrifood-farming/README.md index b8f5c9369d8b..098d22b90377 100644 --- a/sdk/agrifood/azure-verticals-agrifood-farming/README.md +++ b/sdk/agrifood/azure-verticals-agrifood-farming/README.md @@ -47,7 +47,7 @@ To use the [DefaultAzureCredential][DefaultAzureCredential] provider shown below com.azure azure-identity - 1.12.2 + 1.13.1 ``` diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/pom.xml b/sdk/agrifood/azure-verticals-agrifood-farming/pom.xml index 4ae8bcf68d52..a3a750d29b89 100644 --- a/sdk/agrifood/azure-verticals-agrifood-farming/pom.xml +++ b/sdk/agrifood/azure-verticals-agrifood-farming/pom.xml @@ -43,7 +43,7 @@ com.azure azure-core - 1.49.1 + 1.50.0 com.azure @@ -53,7 +53,7 @@ com.azure azure-core-http-netty - 1.15.1 + 1.15.2 @@ -78,13 +78,13 @@ com.azure azure-core-test - 1.26.0 + 1.26.1 test com.azure azure-identity - 1.13.0 + 1.13.1 test @@ -102,7 +102,7 @@ com.azure azure-core-serializer-json-jackson - 1.4.13 + 1.4.14 test diff --git a/sdk/alertsmanagement/azure-resourcemanager-alertsmanagement/pom.xml b/sdk/alertsmanagement/azure-resourcemanager-alertsmanagement/pom.xml index 5ce2c4302f61..69c9500e8e35 100644 --- a/sdk/alertsmanagement/azure-resourcemanager-alertsmanagement/pom.xml +++ b/sdk/alertsmanagement/azure-resourcemanager-alertsmanagement/pom.xml @@ -44,12 +44,12 @@ com.azure azure-core - 1.49.1 + 1.50.0 com.azure azure-core-management - 1.15.0 + 1.15.1 diff --git a/sdk/anomalydetector/azure-ai-anomalydetector/README.md b/sdk/anomalydetector/azure-ai-anomalydetector/README.md index b404a226abc1..c9d1170bbc24 100644 --- a/sdk/anomalydetector/azure-ai-anomalydetector/README.md +++ b/sdk/anomalydetector/azure-ai-anomalydetector/README.md @@ -12,7 +12,8 @@ - [Azure Subscription][azure_subscription] - An existing Cognitive Services or Anomaly Detector resource. -For more information about creating the resource or how to get the location and sku information see [here][cognitive_resource_cli]. +For more information about creating the resource or how to get the location and sku information see +[here][cognitive_resource_cli]. ### Include the Package @@ -30,7 +31,10 @@ For more information about creating the resource or how to get the location and ### Authenticate the client -In order to interact with the Anomaly Detector service, you'll need to create an instance of the [`AnomalyDetectorClient`][anomaly_detector_client_class] class. You will need an **endpoint** and an **API key** to instantiate a client object. +In order to interact with the Anomaly Detector service, you'll need to create an instance of +[`MultivariateClient`][multivariate_client_class], [`MultivariateAsyncClient`][multivariate_async_client_class], +[`UnivariateClient`][univariate_client_class], or [`UnivariateAsyncClient`][univariate_async_client_class]. You will +need an **endpoint** and an **API key** to instantiate a client object. #### Get API Key @@ -44,9 +48,12 @@ az cognitiveservices account keys list --resource-group com.azure azure-identity - 1.12.2 + 1.13.1 ``` -You will also need to [register a new AAD application][register_aad_app] and [grant access][aad_grant_access] to Anomaly Detector by assigning the `"Cognitive Services User"` role to your service principal. +You will also need to [register a new AAD application][register_aad_app] and [grant access][aad_grant_access] to +Anomaly Detector by assigning the `"Cognitive Services User"` role to your service principal. -Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_CLIENT_SECRET. +Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: +AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_CLIENT_SECRET. ##### Sync client @@ -68,16 +77,21 @@ Set the values of the client ID, tenant ID, and client secret of the AAD applica String endpoint = Configuration.getGlobalConfiguration().get("AZURE_ANOMALY_DETECTOR_ENDPOINT"); String key = Configuration.getGlobalConfiguration().get("AZURE_ANOMALY_DETECTOR_API_KEY"); -AnomalyDetectorClient anomalyDetectorClient = - new AnomalyDetectorClientBuilder() - .credential(new AzureKeyCredential(key)) - .endpoint(endpoint) - .buildClient(); +MultivariateClient multivariateClient = new AnomalyDetectorClientBuilder() + .credential(new AzureKeyCredential(key)) + .endpoint(endpoint) + .buildMultivariateClient(); + +UnivariateClient univariateClient = new AnomalyDetectorClientBuilder() + .credential(new AzureKeyCredential(key)) + .endpoint(endpoint) + .buildUnivariateClient(); ``` ## Key concepts -With the Anomaly Detector, you can either detect anomalies in one variable using **Univariate Anomaly Detection**, or detect anomalies in multiple variables with **Multivariate Anomaly Detection**. +With the Anomaly Detector, you can either detect anomalies in one variable using **Univariate Anomaly Detection**, or +detect anomalies in multiple variables with **Multivariate Anomaly Detection**. |Feature |Description | |---------|---------| @@ -86,11 +100,16 @@ With the Anomaly Detector, you can either detect anomalies in one variable using ### Univariate Anomaly Detection -The Univariate Anomaly Detection API enables you to monitor and detect abnormalities in your time series data without having to know machine learning. The algorithms adapt by automatically identifying and applying the best-fitting models to your data, regardless of industry, scenario, or data volume. Using your time series data, the API determines boundaries for anomaly detection, expected values, and which data points are anomalies. +The Univariate Anomaly Detection API enables you to monitor and detect abnormalities in your time series data without +having to know machine learning. The algorithms adapt by automatically identifying and applying the best-fitting models +to your data, regardless of industry, scenario, or data volume. Using your time series data, the API determines +boundaries for anomaly detection, expected values, and which data points are anomalies. -Using the Anomaly Detector doesn't require any prior experience in machine learning, and the REST API enables you to easily integrate the service into your applications and processes. +Using the Anomaly Detector doesn't require any prior experience in machine learning, and the REST API enables you to +easily integrate the service into your applications and processes. -With the Univariate Anomaly Detection, you can automatically detect anomalies throughout your time series data, or as they occur in real-time. +With the Univariate Anomaly Detection, you can automatically detect anomalies throughout your time series data, or as +they occur in real-time. |Feature |Description | |---------|---------| @@ -100,9 +119,14 @@ With the Univariate Anomaly Detection, you can automatically detect anomalies th ### Multivariate Anomaly Detection -The **Multivariate Anomaly Detection** APIs further enable developers by easily integrating advanced AI for detecting anomalies from groups of metrics, without the need for machine learning knowledge or labeled data. Dependencies and inter-correlations between up to 300 different signals are now automatically counted as key factors. This new capability helps you to proactively protect your complex systems such as software applications, servers, factory machines, spacecraft, or even your business, from failures. +The **Multivariate Anomaly Detection** APIs further enable developers by easily integrating advanced AI for detecting +anomalies from groups of metrics, without the need for machine learning knowledge or labeled data. Dependencies and +inter-correlations between up to 300 different signals are now automatically counted as key factors. This new +capability helps you to proactively protect your complex systems such as software applications, servers, factory +machines, spacecraft, or even your business, from failures. -With the Multivariate Anomaly Detection, you can automatically detect anomalies throughout your time series data, or as they occur in real-time. There are three processes to use Multivariate Anomaly Detection. +With the Multivariate Anomaly Detection, you can automatically detect anomalies throughout your time series data, or as +they occur in real-time. There are three processes to use Multivariate Anomaly Detection. - **Training**: Use Train Model API to create and train a model, then use Get Model Status API to get the status and model metadata. - **Inference**: @@ -112,11 +136,13 @@ With the Multivariate Anomaly Detection, you can automatically detect anomalies ### Thread safety -We guarantee that all client instance methods are thread-safe and independent of each other ([guideline](https://azure.github.io/azure-sdk/dotnet_introduction.html#dotnet-service-methods-thread-safety)). This ensures that the recommendation of reusing client instances is always safe, even across threads. +We guarantee that all client instance methods are thread-safe and independent of each other. This +ensures that the recommendation of reusing client instances is always safe, even across threads. ## Examples -The following section provides several code snippets covering some of the most common Anomaly Detector service tasks, including: +The following section provides several code snippets covering some of the most common Anomaly Detector service tasks, +including: - [Univariate Anomaly Detection - Batch detection](#batch-detection) - [Univariate Anomaly Detection - Streaming detection](#streaming-detection) @@ -129,24 +155,31 @@ The following section provides several code snippets covering some of the most c String endpoint = Configuration.getGlobalConfiguration().get("AZURE_ANOMALY_DETECTOR_ENDPOINT"); String key = Configuration.getGlobalConfiguration().get("AZURE_ANOMALY_DETECTOR_API_KEY"); -AnomalyDetectorClient anomalyDetectorClient = - new AnomalyDetectorClientBuilder() - .credential(new AzureKeyCredential(key)) - .endpoint(endpoint) - .buildClient(); +MultivariateClient multivariateClient = new AnomalyDetectorClientBuilder() + .credential(new AzureKeyCredential(key)) + .endpoint(endpoint) + .buildMultivariateClient(); + +UnivariateClient univariateClient = new AnomalyDetectorClientBuilder() + .credential(new AzureKeyCredential(key)) + .endpoint(endpoint) + .buildUnivariateClient(); ``` ### Batch detection -For batch detection in univariate anomaly detection, please go to this sample for better understanding the workflow: [DetectAnomaliesEntireSeries.java](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/anomalydetector/azure-ai-anomalydetector/src/samples/java/com/azure/ai/anomalydetector/DetectAnomaliesEntireSeries.java) +For batch detection in univariate anomaly detection, please go to this sample for better understanding the workflow: +[DetectAnomaliesEntireSeries.java](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/anomalydetector/azure-ai-anomalydetector/src/samples/java/com/azure/ai/anomalydetector/DetectAnomaliesEntireSeries.java) ### Streaming detection -For streaming/last detection in univariate anomaly detection, please go to this sample for better understanding the workflow: [DetectAnomaliesLastPoint.java](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/anomalydetector/azure-ai-anomalydetector/src/samples/java/com/azure/ai/anomalydetector/DetectAnomaliesLastPoint.java) +For streaming/last detection in univariate anomaly detection, please go to this sample for better understanding the +workflow: [DetectAnomaliesLastPoint.java](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/anomalydetector/azure-ai-anomalydetector/src/samples/java/com/azure/ai/anomalydetector/DetectAnomaliesLastPoint.java) ### Detect change points -For change points detection in univariate anomaly detection, please go to this sample for better understanding the workflow: [DetectChangePoints.java](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/anomalydetector/azure-ai-anomalydetector/src/samples/java/com/azure/ai/anomalydetector/DetectChangePoints.java) +For change points detection in univariate anomaly detection, please go to this sample for better understanding the +workflow: [DetectChangePoints.java](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/anomalydetector/azure-ai-anomalydetector/src/samples/java/com/azure/ai/anomalydetector/DetectChangePoints.java) ### Multivariate Anomaly Detection Sample @@ -162,17 +195,24 @@ locate the root issue. View the [logging][logging] wiki for guidance about enabl ## Next steps -These code samples show common scenario operations with the Azure Anomaly Detector library. More samples can be found under the [samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/anomalydetector/azure-ai-anomalydetector/src/samples/java/com/azure/ai/anomalydetector) directory. +These code samples show common scenario operations with the Azure Anomaly Detector library. More samples can be found +under the [samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/anomalydetector/azure-ai-anomalydetector/src/samples/java/com/azure/ai/anomalydetector) directory. -For more extensive documentation on Azure Anomaly Detector, see the [Anomaly Detector documentation](https://learn.microsoft.com/azure/cognitive-services/anomaly-detector/overview) on docs.microsoft.com. +For more extensive documentation on Azure Anomaly Detector, see the [Anomaly Detector documentation](https://learn.microsoft.com/azure/cognitive-services/anomaly-detector/overview) on +docs.microsoft.com. ## Contributing -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 [cla.microsoft.com][cla]. +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 [cla.microsoft.com][cla]. -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 repos using our CLA. +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 repos using our CLA. -This project has adopted the [Microsoft Open Source Code of Conduct][code_of_conduct]. For more information see the [Code of Conduct FAQ][coc_faq] or contact [opencode@microsoft.com][coc_contact] with any additional questions or comments. +This project has adopted the [Microsoft Open Source Code of Conduct][code_of_conduct]. For more information see the +[Code of Conduct FAQ][coc_faq] or contact [opencode@microsoft.com][coc_contact] with any additional questions or comments. [cla]: https://cla.microsoft.com @@ -186,7 +226,10 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [api_reference_doc]: https://azure.github.io/azure-sdk-for-java/ [product_documentation]: https://docs.microsoft.com/azure/cognitive-services/anomaly-detector/ [cognitive_resource_cli]: https://docs.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account-cli -[anomaly_detector_client_class]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/AnomalyDetectorClient.java +[multivariate_client_class]: https://github.com/Azure/azure-sdk-for-java/blob/8b2622353dd8c4a03a87c7e04a6f82bf0712bab5/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/MultivariateClient.java +[multivariate_async_client_class]: https://github.com/Azure/azure-sdk-for-java/blob/8b2622353dd8c4a03a87c7e04a6f82bf0712bab5/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/MultivariateAsyncClient.java +[univariate_client_class]: https://github.com/Azure/azure-sdk-for-java/blob/8b2622353dd8c4a03a87c7e04a6f82bf0712bab5/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/UnivariateClient.java +[univariate_async_client_class]: https://github.com/Azure/azure-sdk-for-java/blob/8b2622353dd8c4a03a87c7e04a6f82bf0712bab5/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/UnivariateAsyncClient.java [azure_cli]: https://docs.microsoft.com/cli/azure [azure_portal]: https://portal.azure.com [azure_identity]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/identity/azure-identity diff --git a/sdk/anomalydetector/azure-ai-anomalydetector/pom.xml b/sdk/anomalydetector/azure-ai-anomalydetector/pom.xml index fc9d9e5d3bdd..ee03d31397b7 100644 --- a/sdk/anomalydetector/azure-ai-anomalydetector/pom.xml +++ b/sdk/anomalydetector/azure-ai-anomalydetector/pom.xml @@ -38,19 +38,19 @@ UTF-8 - 0.1 - 0.1 + 0.11 + 0.07 com.azure azure-core - 1.49.1 + 1.50.0 com.azure azure-core-http-netty - 1.15.1 + 1.15.2 @@ -75,13 +75,13 @@ com.azure azure-core-test - 1.26.0 + 1.26.1 test com.azure azure-identity - 1.13.0 + 1.13.1 test @@ -90,17 +90,5 @@ 1.7.36 test - - javax.json - javax.json-api - 1.1.4 - test - - - org.glassfish - javax.json - 1.1.4 - test - diff --git a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/AnomalyDetectorAsyncClient.java b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/AnomalyDetectorAsyncClient.java deleted file mode 100644 index 40e17f4d59a9..000000000000 --- a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/AnomalyDetectorAsyncClient.java +++ /dev/null @@ -1,1124 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.ai.anomalydetector; - -import com.azure.ai.anomalydetector.implementation.AnomalyDetectorClientImpl; -import com.azure.ai.anomalydetector.models.AnomalyDetectionModel; -import com.azure.ai.anomalydetector.models.ModelInfo; -import com.azure.ai.anomalydetector.models.MultivariateBatchDetectionOptions; -import com.azure.ai.anomalydetector.models.MultivariateDetectionResult; -import com.azure.ai.anomalydetector.models.MultivariateLastDetectionOptions; -import com.azure.ai.anomalydetector.models.MultivariateLastDetectionResult; -import com.azure.ai.anomalydetector.models.UnivariateChangePointDetectionOptions; -import com.azure.ai.anomalydetector.models.UnivariateChangePointDetectionResult; -import com.azure.ai.anomalydetector.models.UnivariateDetectionOptions; -import com.azure.ai.anomalydetector.models.UnivariateEntireDetectionResult; -import com.azure.ai.anomalydetector.models.UnivariateLastDetectionResult; -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.FluxUtil; -import java.util.stream.Collectors; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** Initializes a new instance of the asynchronous AnomalyDetectorClient type. */ -@ServiceClient(builder = AnomalyDetectorClientBuilder.class, isAsync = true) -public final class AnomalyDetectorAsyncClient { - - @Generated private final AnomalyDetectorClientImpl serviceClient; - - /** - * Initializes an instance of AnomalyDetectorAsyncClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - AnomalyDetectorAsyncClient(AnomalyDetectorClientImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * Detect anomalies for the entire series in batch. - * - *

This operation generates a model with an entire series, each point is detected with the same model. With this - * method, points before and after a certain point are used to determine whether it is an anomaly. The entire - * detection can give user an overall status of the time series. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     series (Required): [
-     *          (Required){
-     *             timestamp: OffsetDateTime (Optional)
-     *             value: double (Required)
-     *         }
-     *     ]
-     *     granularity: String(yearly/monthly/weekly/daily/hourly/minutely/secondly/microsecond/none) (Optional)
-     *     customInterval: Integer (Optional)
-     *     period: Integer (Optional)
-     *     maxAnomalyRatio: Double (Optional)
-     *     sensitivity: Integer (Optional)
-     *     imputeMode: String(auto/previous/linear/fixed/zero/notFill) (Optional)
-     *     imputeFixedValue: Double (Optional)
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     period: int (Required)
-     *     expectedValues (Required): [
-     *         double (Required)
-     *     ]
-     *     upperMargins (Required): [
-     *         double (Required)
-     *     ]
-     *     lowerMargins (Required): [
-     *         double (Required)
-     *     ]
-     *     isAnomaly (Required): [
-     *         boolean (Required)
-     *     ]
-     *     isNegativeAnomaly (Required): [
-     *         boolean (Required)
-     *     ]
-     *     isPositiveAnomaly (Required): [
-     *         boolean (Required)
-     *     ]
-     *     severity (Optional): [
-     *         double (Optional)
-     *     ]
-     * }
-     * }
- * - * @param options Method of univariate anomaly detection. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response of entire anomaly detection along with {@link Response} on successful completion of {@link - * Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> detectUnivariateEntireSeriesWithResponse( - BinaryData options, RequestOptions requestOptions) { - return this.serviceClient.detectUnivariateEntireSeriesWithResponseAsync(options, requestOptions); - } - - /** - * Detect anomaly status of the latest point in time series. - * - *

This operation generates a model using the points that you sent into the API, and based on all data to - * determine whether the last point is anomalous. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     series (Required): [
-     *          (Required){
-     *             timestamp: OffsetDateTime (Optional)
-     *             value: double (Required)
-     *         }
-     *     ]
-     *     granularity: String(yearly/monthly/weekly/daily/hourly/minutely/secondly/microsecond/none) (Optional)
-     *     customInterval: Integer (Optional)
-     *     period: Integer (Optional)
-     *     maxAnomalyRatio: Double (Optional)
-     *     sensitivity: Integer (Optional)
-     *     imputeMode: String(auto/previous/linear/fixed/zero/notFill) (Optional)
-     *     imputeFixedValue: Double (Optional)
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     period: int (Required)
-     *     suggestedWindow: int (Required)
-     *     expectedValue: double (Required)
-     *     upperMargin: double (Required)
-     *     lowerMargin: double (Required)
-     *     isAnomaly: boolean (Required)
-     *     isNegativeAnomaly: boolean (Required)
-     *     isPositiveAnomaly: boolean (Required)
-     *     severity: Double (Optional)
-     * }
-     * }
- * - * @param options Method of univariate anomaly detection. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response of last anomaly detection along with {@link Response} on successful completion of {@link - * Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> detectUnivariateLastPointWithResponse( - BinaryData options, RequestOptions requestOptions) { - return this.serviceClient.detectUnivariateLastPointWithResponseAsync(options, requestOptions); - } - - /** - * Detect change point for the entire series - * - *

Evaluate change point score of every series point. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     series (Required): [
-     *          (Required){
-     *             timestamp: OffsetDateTime (Optional)
-     *             value: double (Required)
-     *         }
-     *     ]
-     *     granularity: String(yearly/monthly/weekly/daily/hourly/minutely/secondly/microsecond/none) (Required)
-     *     customInterval: Integer (Optional)
-     *     period: Integer (Optional)
-     *     stableTrendWindow: Integer (Optional)
-     *     threshold: Double (Optional)
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     period: Integer (Optional)
-     *     isChangePoint (Optional): [
-     *         boolean (Optional)
-     *     ]
-     *     confidenceScores (Optional): [
-     *         double (Optional)
-     *     ]
-     * }
-     * }
- * - * @param options Method of univariate anomaly detection. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response of change point detection along with {@link Response} on successful completion of {@link - * Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> detectUnivariateChangePointWithResponse( - BinaryData options, RequestOptions requestOptions) { - return this.serviceClient.detectUnivariateChangePointWithResponseAsync(options, requestOptions); - } - - /** - * Get Multivariate Anomaly Detection Result - * - *

For asynchronous inference, get multivariate anomaly detection result based on resultId returned by the - * BatchDetectAnomaly api. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     resultId: String (Required)
-     *     summary (Required): {
-     *         status: String(CREATED/RUNNING/READY/FAILED) (Required)
-     *         errors (Optional): [
-     *              (Optional){
-     *                 code: String (Required)
-     *                 message: String (Required)
-     *             }
-     *         ]
-     *         variableStates (Optional): [
-     *              (Optional){
-     *                 variable: String (Optional)
-     *                 filledNARatio: Double (Optional)
-     *                 effectiveCount: Integer (Optional)
-     *                 firstTimestamp: OffsetDateTime (Optional)
-     *                 lastTimestamp: OffsetDateTime (Optional)
-     *             }
-     *         ]
-     *         setupInfo (Required): {
-     *             dataSource: String (Required)
-     *             topContributorCount: int (Required)
-     *             startTime: OffsetDateTime (Required)
-     *             endTime: OffsetDateTime (Required)
-     *         }
-     *     }
-     *     results (Required): [
-     *          (Required){
-     *             timestamp: OffsetDateTime (Required)
-     *             value (Optional): {
-     *                 isAnomaly: boolean (Required)
-     *                 severity: double (Required)
-     *                 score: double (Required)
-     *                 interpretation (Optional): [
-     *                      (Optional){
-     *                         variable: String (Optional)
-     *                         contributionScore: Double (Optional)
-     *                         correlationChanges (Optional): {
-     *                             changedVariables (Optional): [
-     *                                 String (Optional)
-     *                             ]
-     *                         }
-     *                     }
-     *                 ]
-     *             }
-     *             errors (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *     ]
-     * }
-     * }
- * - * @param resultId ID of a batch detection result. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return detection results for the given resultId along with {@link Response} on successful completion of {@link - * Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getMultivariateBatchDetectionResultWithResponse( - String resultId, RequestOptions requestOptions) { - return this.serviceClient.getMultivariateBatchDetectionResultWithResponseAsync(resultId, requestOptions); - } - - /** - * Train a Multivariate Anomaly Detection Model - * - *

Create and train a multivariate anomaly detection model. The request must include a source parameter to - * indicate an externally accessible Azure blob storage URI.There are two types of data input: An URI pointed to an - * Azure blob storage folder which contains multiple CSV files, and each CSV file contains two columns, timestamp - * and variable. Another type of input is an URI pointed to a CSV file in Azure blob storage, which contains all the - * variables and a timestamp column. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     dataSource: String (Required)
-     *     dataSchema: String(OneTable/MultiTable) (Optional)
-     *     startTime: OffsetDateTime (Required)
-     *     endTime: OffsetDateTime (Required)
-     *     displayName: String (Optional)
-     *     slidingWindow: Integer (Optional)
-     *     alignPolicy (Optional): {
-     *         alignMode: String(Inner/Outer) (Optional)
-     *         fillNAMethod: String(Previous/Subsequent/Linear/Zero/Fixed) (Optional)
-     *         paddingValue: Double (Optional)
-     *     }
-     *     status: String(CREATED/RUNNING/READY/FAILED) (Optional)
-     *     errors (Optional): [
-     *          (Optional){
-     *             code: String (Required)
-     *             message: String (Required)
-     *         }
-     *     ]
-     *     diagnosticsInfo (Optional): {
-     *         modelState (Optional): {
-     *             epochIds (Optional): [
-     *                 int (Optional)
-     *             ]
-     *             trainLosses (Optional): [
-     *                 double (Optional)
-     *             ]
-     *             validationLosses (Optional): [
-     *                 double (Optional)
-     *             ]
-     *             latenciesInSeconds (Optional): [
-     *                 double (Optional)
-     *             ]
-     *         }
-     *         variableStates (Optional): [
-     *              (Optional){
-     *                 variable: String (Optional)
-     *                 filledNARatio: Double (Optional)
-     *                 effectiveCount: Integer (Optional)
-     *                 firstTimestamp: OffsetDateTime (Optional)
-     *                 lastTimestamp: OffsetDateTime (Optional)
-     *             }
-     *         ]
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     modelId: String (Required)
-     *     createdTime: OffsetDateTime (Required)
-     *     lastUpdatedTime: OffsetDateTime (Required)
-     *     modelInfo (Optional): {
-     *         dataSource: String (Required)
-     *         dataSchema: String(OneTable/MultiTable) (Optional)
-     *         startTime: OffsetDateTime (Required)
-     *         endTime: OffsetDateTime (Required)
-     *         displayName: String (Optional)
-     *         slidingWindow: Integer (Optional)
-     *         alignPolicy (Optional): {
-     *             alignMode: String(Inner/Outer) (Optional)
-     *             fillNAMethod: String(Previous/Subsequent/Linear/Zero/Fixed) (Optional)
-     *             paddingValue: Double (Optional)
-     *         }
-     *         status: String(CREATED/RUNNING/READY/FAILED) (Optional)
-     *         errors (Optional): [
-     *              (Optional){
-     *                 code: String (Required)
-     *                 message: String (Required)
-     *             }
-     *         ]
-     *         diagnosticsInfo (Optional): {
-     *             modelState (Optional): {
-     *                 epochIds (Optional): [
-     *                     int (Optional)
-     *                 ]
-     *                 trainLosses (Optional): [
-     *                     double (Optional)
-     *                 ]
-     *                 validationLosses (Optional): [
-     *                     double (Optional)
-     *                 ]
-     *                 latenciesInSeconds (Optional): [
-     *                     double (Optional)
-     *                 ]
-     *             }
-     *             variableStates (Optional): [
-     *                  (Optional){
-     *                     variable: String (Optional)
-     *                     filledNARatio: Double (Optional)
-     *                     effectiveCount: Integer (Optional)
-     *                     firstTimestamp: OffsetDateTime (Optional)
-     *                     lastTimestamp: OffsetDateTime (Optional)
-     *                 }
-     *             ]
-     *         }
-     *     }
-     * }
-     * }
- * - * @param modelInfo Model information. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return response of getting a model along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> trainMultivariateModelWithResponse( - BinaryData modelInfo, RequestOptions requestOptions) { - return this.serviceClient.trainMultivariateModelWithResponseAsync(modelInfo, requestOptions); - } - - /** - * List Multivariate Models - * - *

List models of a resource. - * - *

Query Parameters - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
skipIntegerNoSkip indicates how many models will be skipped.
topIntegerNoTop indicates how many models will be fetched.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     modelId: String (Required)
-     *     createdTime: OffsetDateTime (Required)
-     *     lastUpdatedTime: OffsetDateTime (Required)
-     *     modelInfo (Optional): {
-     *         dataSource: String (Required)
-     *         dataSchema: String(OneTable/MultiTable) (Optional)
-     *         startTime: OffsetDateTime (Required)
-     *         endTime: OffsetDateTime (Required)
-     *         displayName: String (Optional)
-     *         slidingWindow: Integer (Optional)
-     *         alignPolicy (Optional): {
-     *             alignMode: String(Inner/Outer) (Optional)
-     *             fillNAMethod: String(Previous/Subsequent/Linear/Zero/Fixed) (Optional)
-     *             paddingValue: Double (Optional)
-     *         }
-     *         status: String(CREATED/RUNNING/READY/FAILED) (Optional)
-     *         errors (Optional): [
-     *              (Optional){
-     *                 code: String (Required)
-     *                 message: String (Required)
-     *             }
-     *         ]
-     *         diagnosticsInfo (Optional): {
-     *             modelState (Optional): {
-     *                 epochIds (Optional): [
-     *                     int (Optional)
-     *                 ]
-     *                 trainLosses (Optional): [
-     *                     double (Optional)
-     *                 ]
-     *                 validationLosses (Optional): [
-     *                     double (Optional)
-     *                 ]
-     *                 latenciesInSeconds (Optional): [
-     *                     double (Optional)
-     *                 ]
-     *             }
-     *             variableStates (Optional): [
-     *                  (Optional){
-     *                     variable: String (Optional)
-     *                     filledNARatio: Double (Optional)
-     *                     effectiveCount: Integer (Optional)
-     *                     firstTimestamp: OffsetDateTime (Optional)
-     *                     lastTimestamp: OffsetDateTime (Optional)
-     *                 }
-     *             ]
-     *         }
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return response of listing models as paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listMultivariateModels(RequestOptions requestOptions) { - return this.serviceClient.listMultivariateModelsAsync(requestOptions); - } - - /** - * Delete Multivariate Model - * - *

Delete an existing multivariate model according to the modelId. - * - * @param modelId Model identifier. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteMultivariateModelWithResponse(String modelId, RequestOptions requestOptions) { - return this.serviceClient.deleteMultivariateModelWithResponseAsync(modelId, requestOptions); - } - - /** - * Get Multivariate Model - * - *

Get detailed information of multivariate model, including the training status and variables used in the model. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     modelId: String (Required)
-     *     createdTime: OffsetDateTime (Required)
-     *     lastUpdatedTime: OffsetDateTime (Required)
-     *     modelInfo (Optional): {
-     *         dataSource: String (Required)
-     *         dataSchema: String(OneTable/MultiTable) (Optional)
-     *         startTime: OffsetDateTime (Required)
-     *         endTime: OffsetDateTime (Required)
-     *         displayName: String (Optional)
-     *         slidingWindow: Integer (Optional)
-     *         alignPolicy (Optional): {
-     *             alignMode: String(Inner/Outer) (Optional)
-     *             fillNAMethod: String(Previous/Subsequent/Linear/Zero/Fixed) (Optional)
-     *             paddingValue: Double (Optional)
-     *         }
-     *         status: String(CREATED/RUNNING/READY/FAILED) (Optional)
-     *         errors (Optional): [
-     *              (Optional){
-     *                 code: String (Required)
-     *                 message: String (Required)
-     *             }
-     *         ]
-     *         diagnosticsInfo (Optional): {
-     *             modelState (Optional): {
-     *                 epochIds (Optional): [
-     *                     int (Optional)
-     *                 ]
-     *                 trainLosses (Optional): [
-     *                     double (Optional)
-     *                 ]
-     *                 validationLosses (Optional): [
-     *                     double (Optional)
-     *                 ]
-     *                 latenciesInSeconds (Optional): [
-     *                     double (Optional)
-     *                 ]
-     *             }
-     *             variableStates (Optional): [
-     *                  (Optional){
-     *                     variable: String (Optional)
-     *                     filledNARatio: Double (Optional)
-     *                     effectiveCount: Integer (Optional)
-     *                     firstTimestamp: OffsetDateTime (Optional)
-     *                     lastTimestamp: OffsetDateTime (Optional)
-     *                 }
-     *             ]
-     *         }
-     *     }
-     * }
-     * }
- * - * @param modelId Model identifier. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return detailed information of multivariate model, including the training status and variables used in the model - * along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getMultivariateModelWithResponse(String modelId, RequestOptions requestOptions) { - return this.serviceClient.getMultivariateModelWithResponseAsync(modelId, requestOptions); - } - - /** - * Detect Multivariate Anomaly - * - *

Submit multivariate anomaly detection task with the modelId of trained model and inference data, the input - * schema should be the same with the training request. The request will complete asynchronously and return a - * resultId to query the detection result.The request should be a source link to indicate an externally accessible - * Azure storage Uri, either pointed to an Azure blob storage folder, or pointed to a CSV file in Azure blob - * storage. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     dataSource: String (Required)
-     *     topContributorCount: int (Required)
-     *     startTime: OffsetDateTime (Required)
-     *     endTime: OffsetDateTime (Required)
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     resultId: String (Required)
-     *     summary (Required): {
-     *         status: String(CREATED/RUNNING/READY/FAILED) (Required)
-     *         errors (Optional): [
-     *              (Optional){
-     *                 code: String (Required)
-     *                 message: String (Required)
-     *             }
-     *         ]
-     *         variableStates (Optional): [
-     *              (Optional){
-     *                 variable: String (Optional)
-     *                 filledNARatio: Double (Optional)
-     *                 effectiveCount: Integer (Optional)
-     *                 firstTimestamp: OffsetDateTime (Optional)
-     *                 lastTimestamp: OffsetDateTime (Optional)
-     *             }
-     *         ]
-     *         setupInfo (Required): {
-     *             dataSource: String (Required)
-     *             topContributorCount: int (Required)
-     *             startTime: OffsetDateTime (Required)
-     *             endTime: OffsetDateTime (Required)
-     *         }
-     *     }
-     *     results (Required): [
-     *          (Required){
-     *             timestamp: OffsetDateTime (Required)
-     *             value (Optional): {
-     *                 isAnomaly: boolean (Required)
-     *                 severity: double (Required)
-     *                 score: double (Required)
-     *                 interpretation (Optional): [
-     *                      (Optional){
-     *                         variable: String (Optional)
-     *                         contributionScore: Double (Optional)
-     *                         correlationChanges (Optional): {
-     *                             changedVariables (Optional): [
-     *                                 String (Optional)
-     *                             ]
-     *                         }
-     *                     }
-     *                 ]
-     *             }
-     *             errors (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *     ]
-     * }
-     * }
- * - * @param modelId Model identifier. - * @param options Request of multivariate anomaly detection. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return detection results for the given resultId along with {@link Response} on successful completion of {@link - * Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> detectMultivariateBatchAnomalyWithResponse( - String modelId, BinaryData options, RequestOptions requestOptions) { - return this.serviceClient.detectMultivariateBatchAnomalyWithResponseAsync(modelId, options, requestOptions); - } - - /** - * Detect anomalies in the last point of the request body - * - *

Submit multivariate anomaly detection task with the modelId of trained model and inference data, and the - * inference data should be put into request body in a JSON format. The request will complete synchronously and - * return the detection immediately in the response body. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     variables (Required): [
-     *          (Required){
-     *             variable: String (Required)
-     *             timestamps (Required): [
-     *                 String (Required)
-     *             ]
-     *             values (Required): [
-     *                 double (Required)
-     *             ]
-     *         }
-     *     ]
-     *     topContributorCount: int (Required)
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     variableStates (Optional): [
-     *          (Optional){
-     *             variable: String (Optional)
-     *             filledNARatio: Double (Optional)
-     *             effectiveCount: Integer (Optional)
-     *             firstTimestamp: OffsetDateTime (Optional)
-     *             lastTimestamp: OffsetDateTime (Optional)
-     *         }
-     *     ]
-     *     results (Optional): [
-     *          (Optional){
-     *             timestamp: OffsetDateTime (Required)
-     *             value (Optional): {
-     *                 isAnomaly: boolean (Required)
-     *                 severity: double (Required)
-     *                 score: double (Required)
-     *                 interpretation (Optional): [
-     *                      (Optional){
-     *                         variable: String (Optional)
-     *                         contributionScore: Double (Optional)
-     *                         correlationChanges (Optional): {
-     *                             changedVariables (Optional): [
-     *                                 String (Optional)
-     *                             ]
-     *                         }
-     *                     }
-     *                 ]
-     *             }
-     *             errors (Optional): [
-     *                  (Optional){
-     *                     code: String (Required)
-     *                     message: String (Required)
-     *                 }
-     *             ]
-     *         }
-     *     ]
-     * }
-     * }
- * - * @param modelId Model identifier. - * @param options Request of last detection. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return results of last detection along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> detectMultivariateLastAnomalyWithResponse( - String modelId, BinaryData options, RequestOptions requestOptions) { - return this.serviceClient.detectMultivariateLastAnomalyWithResponseAsync(modelId, options, requestOptions); - } - - /** - * Detect anomalies for the entire series in batch. - * - *

This operation generates a model with an entire series, each point is detected with the same model. With this - * method, points before and after a certain point are used to determine whether it is an anomaly. The entire - * detection can give user an overall status of the time series. - * - * @param options Method of univariate anomaly detection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of entire anomaly detection on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono detectUnivariateEntireSeries(UnivariateDetectionOptions options) { - // Generated convenience method for detectUnivariateEntireSeriesWithResponse - RequestOptions requestOptions = new RequestOptions(); - return detectUnivariateEntireSeriesWithResponse(BinaryData.fromObject(options), requestOptions) - .flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(UnivariateEntireDetectionResult.class)); - } - - /** - * Detect anomaly status of the latest point in time series. - * - *

This operation generates a model using the points that you sent into the API, and based on all data to - * determine whether the last point is anomalous. - * - * @param options Method of univariate anomaly detection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of last anomaly detection on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono detectUnivariateLastPoint(UnivariateDetectionOptions options) { - // Generated convenience method for detectUnivariateLastPointWithResponse - RequestOptions requestOptions = new RequestOptions(); - return detectUnivariateLastPointWithResponse(BinaryData.fromObject(options), requestOptions) - .flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(UnivariateLastDetectionResult.class)); - } - - /** - * Detect change point for the entire series - * - *

Evaluate change point score of every series point. - * - * @param options Method of univariate anomaly detection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of change point detection on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono detectUnivariateChangePoint( - UnivariateChangePointDetectionOptions options) { - // Generated convenience method for detectUnivariateChangePointWithResponse - RequestOptions requestOptions = new RequestOptions(); - return detectUnivariateChangePointWithResponse(BinaryData.fromObject(options), requestOptions) - .flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(UnivariateChangePointDetectionResult.class)); - } - - /** - * Get Multivariate Anomaly Detection Result - * - *

For asynchronous inference, get multivariate anomaly detection result based on resultId returned by the - * BatchDetectAnomaly api. - * - * @param resultId ID of a batch detection result. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return detection results for the given resultId on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getMultivariateBatchDetectionResult(String resultId) { - // Generated convenience method for getMultivariateBatchDetectionResultWithResponse - RequestOptions requestOptions = new RequestOptions(); - return getMultivariateBatchDetectionResultWithResponse(resultId, requestOptions) - .flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(MultivariateDetectionResult.class)); - } - - /** - * Train a Multivariate Anomaly Detection Model - * - *

Create and train a multivariate anomaly detection model. The request must include a source parameter to - * indicate an externally accessible Azure blob storage URI.There are two types of data input: An URI pointed to an - * Azure blob storage folder which contains multiple CSV files, and each CSV file contains two columns, timestamp - * and variable. Another type of input is an URI pointed to a CSV file in Azure blob storage, which contains all the - * variables and a timestamp column. - * - * @param modelInfo Model information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of getting a model on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono trainMultivariateModel(ModelInfo modelInfo) { - // Generated convenience method for trainMultivariateModelWithResponse - RequestOptions requestOptions = new RequestOptions(); - return trainMultivariateModelWithResponse(BinaryData.fromObject(modelInfo), requestOptions) - .flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(AnomalyDetectionModel.class)); - } - - /** - * List Multivariate Models - * - *

List models of a resource. - * - * @param skip Skip indicates how many models will be skipped. - * @param top Top indicates how many models will be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.exception.HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of listing models as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listMultivariateModels(Integer skip, Integer top) { - // Generated convenience method for listMultivariateModels - RequestOptions requestOptions = new RequestOptions(); - if (skip != null) { - requestOptions.addQueryParam("skip", String.valueOf(skip)); - } - if (top != null) { - requestOptions.addQueryParam("top", String.valueOf(top)); - } - PagedFlux pagedFluxResponse = listMultivariateModels(requestOptions); - return PagedFlux.create( - () -> - (continuationToken, pageSize) -> { - Flux> flux = - (continuationToken == null) - ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationToken).take(1); - return flux.map( - pagedResponse -> - new PagedResponseBase( - pagedResponse.getRequest(), - pagedResponse.getStatusCode(), - pagedResponse.getHeaders(), - pagedResponse.getValue().stream() - .map( - protocolMethodData -> - protocolMethodData.toObject( - AnomalyDetectionModel.class)) - .collect(Collectors.toList()), - pagedResponse.getContinuationToken(), - null)); - }); - } - - /** - * List Multivariate Models - * - *

List models of a resource. - * - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of listing models as paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listMultivariateModels() { - // Generated convenience method for listMultivariateModels - RequestOptions requestOptions = new RequestOptions(); - PagedFlux pagedFluxResponse = listMultivariateModels(requestOptions); - return PagedFlux.create( - () -> - (continuationToken, pageSize) -> { - Flux> flux = - (continuationToken == null) - ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationToken).take(1); - return flux.map( - pagedResponse -> - new PagedResponseBase( - pagedResponse.getRequest(), - pagedResponse.getStatusCode(), - pagedResponse.getHeaders(), - pagedResponse.getValue().stream() - .map( - protocolMethodData -> - protocolMethodData.toObject( - AnomalyDetectionModel.class)) - .collect(Collectors.toList()), - pagedResponse.getContinuationToken(), - null)); - }); - } - - /** - * Delete Multivariate Model - * - *

Delete an existing multivariate model according to the modelId. - * - * @param modelId Model identifier. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @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. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteMultivariateModel(String modelId) { - // Generated convenience method for deleteMultivariateModelWithResponse - RequestOptions requestOptions = new RequestOptions(); - return deleteMultivariateModelWithResponse(modelId, requestOptions).flatMap(FluxUtil::toMono); - } - - /** - * Get Multivariate Model - * - *

Get detailed information of multivariate model, including the training status and variables used in the model. - * - * @param modelId Model identifier. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return detailed information of multivariate model, including the training status and variables used in the model - * on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getMultivariateModel(String modelId) { - // Generated convenience method for getMultivariateModelWithResponse - RequestOptions requestOptions = new RequestOptions(); - return getMultivariateModelWithResponse(modelId, requestOptions) - .flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(AnomalyDetectionModel.class)); - } - - /** - * Detect Multivariate Anomaly - * - *

Submit multivariate anomaly detection task with the modelId of trained model and inference data, the input - * schema should be the same with the training request. The request will complete asynchronously and return a - * resultId to query the detection result.The request should be a source link to indicate an externally accessible - * Azure storage Uri, either pointed to an Azure blob storage folder, or pointed to a CSV file in Azure blob - * storage. - * - * @param modelId Model identifier. - * @param options Request of multivariate anomaly detection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return detection results for the given resultId on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono detectMultivariateBatchAnomaly( - String modelId, MultivariateBatchDetectionOptions options) { - // Generated convenience method for detectMultivariateBatchAnomalyWithResponse - RequestOptions requestOptions = new RequestOptions(); - return detectMultivariateBatchAnomalyWithResponse(modelId, BinaryData.fromObject(options), requestOptions) - .flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(MultivariateDetectionResult.class)); - } - - /** - * Detect anomalies in the last point of the request body - * - *

Submit multivariate anomaly detection task with the modelId of trained model and inference data, and the - * inference data should be put into request body in a JSON format. The request will complete synchronously and - * return the detection immediately in the response body. - * - * @param modelId Model identifier. - * @param options Request of last detection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return results of last detection on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono detectMultivariateLastAnomaly( - String modelId, MultivariateLastDetectionOptions options) { - // Generated convenience method for detectMultivariateLastAnomalyWithResponse - RequestOptions requestOptions = new RequestOptions(); - return detectMultivariateLastAnomalyWithResponse(modelId, BinaryData.fromObject(options), requestOptions) - .flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(MultivariateLastDetectionResult.class)); - } -} diff --git a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/AnomalyDetectorClient.java b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/AnomalyDetectorClient.java deleted file mode 100644 index 3b37c4eeb688..000000000000 --- a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/AnomalyDetectorClient.java +++ /dev/null @@ -1,1059 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.ai.anomalydetector; - -import com.azure.ai.anomalydetector.models.AnomalyDetectionModel; -import com.azure.ai.anomalydetector.models.ModelInfo; -import com.azure.ai.anomalydetector.models.MultivariateBatchDetectionOptions; -import com.azure.ai.anomalydetector.models.MultivariateDetectionResult; -import com.azure.ai.anomalydetector.models.MultivariateLastDetectionOptions; -import com.azure.ai.anomalydetector.models.MultivariateLastDetectionResult; -import com.azure.ai.anomalydetector.models.UnivariateChangePointDetectionOptions; -import com.azure.ai.anomalydetector.models.UnivariateChangePointDetectionResult; -import com.azure.ai.anomalydetector.models.UnivariateDetectionOptions; -import com.azure.ai.anomalydetector.models.UnivariateEntireDetectionResult; -import com.azure.ai.anomalydetector.models.UnivariateLastDetectionResult; -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; - -/** Initializes a new instance of the synchronous AnomalyDetectorClient type. */ -@ServiceClient(builder = AnomalyDetectorClientBuilder.class) -public final class AnomalyDetectorClient { - - @Generated private final AnomalyDetectorAsyncClient client; - - /** - * Initializes an instance of AnomalyDetectorClient class. - * - * @param client the async client. - */ - @Generated - AnomalyDetectorClient(AnomalyDetectorAsyncClient client) { - this.client = client; - } - - /** - * Detect anomalies for the entire series in batch. - * - *

This operation generates a model with an entire series, each point is detected with the same model. With this - * method, points before and after a certain point are used to determine whether it is an anomaly. The entire - * detection can give user an overall status of the time series. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     series (Required): [
-     *          (Required){
-     *             timestamp: OffsetDateTime (Optional)
-     *             value: double (Required)
-     *         }
-     *     ]
-     *     granularity: String(yearly/monthly/weekly/daily/hourly/minutely/secondly/microsecond/none) (Optional)
-     *     customInterval: Integer (Optional)
-     *     period: Integer (Optional)
-     *     maxAnomalyRatio: Double (Optional)
-     *     sensitivity: Integer (Optional)
-     *     imputeMode: String(auto/previous/linear/fixed/zero/notFill) (Optional)
-     *     imputeFixedValue: Double (Optional)
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     period: int (Required)
-     *     expectedValues (Required): [
-     *         double (Required)
-     *     ]
-     *     upperMargins (Required): [
-     *         double (Required)
-     *     ]
-     *     lowerMargins (Required): [
-     *         double (Required)
-     *     ]
-     *     isAnomaly (Required): [
-     *         boolean (Required)
-     *     ]
-     *     isNegativeAnomaly (Required): [
-     *         boolean (Required)
-     *     ]
-     *     isPositiveAnomaly (Required): [
-     *         boolean (Required)
-     *     ]
-     *     severity (Optional): [
-     *         double (Optional)
-     *     ]
-     * }
-     * }
- * - * @param options Method of univariate anomaly detection. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response of entire anomaly detection along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response detectUnivariateEntireSeriesWithResponse( - BinaryData options, RequestOptions requestOptions) { - return this.client.detectUnivariateEntireSeriesWithResponse(options, requestOptions).block(); - } - - /** - * Detect anomaly status of the latest point in time series. - * - *

This operation generates a model using the points that you sent into the API, and based on all data to - * determine whether the last point is anomalous. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     series (Required): [
-     *          (Required){
-     *             timestamp: OffsetDateTime (Optional)
-     *             value: double (Required)
-     *         }
-     *     ]
-     *     granularity: String(yearly/monthly/weekly/daily/hourly/minutely/secondly/microsecond/none) (Optional)
-     *     customInterval: Integer (Optional)
-     *     period: Integer (Optional)
-     *     maxAnomalyRatio: Double (Optional)
-     *     sensitivity: Integer (Optional)
-     *     imputeMode: String(auto/previous/linear/fixed/zero/notFill) (Optional)
-     *     imputeFixedValue: Double (Optional)
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     period: int (Required)
-     *     suggestedWindow: int (Required)
-     *     expectedValue: double (Required)
-     *     upperMargin: double (Required)
-     *     lowerMargin: double (Required)
-     *     isAnomaly: boolean (Required)
-     *     isNegativeAnomaly: boolean (Required)
-     *     isPositiveAnomaly: boolean (Required)
-     *     severity: Double (Optional)
-     * }
-     * }
- * - * @param options Method of univariate anomaly detection. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response of last anomaly detection along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response detectUnivariateLastPointWithResponse( - BinaryData options, RequestOptions requestOptions) { - return this.client.detectUnivariateLastPointWithResponse(options, requestOptions).block(); - } - - /** - * Detect change point for the entire series - * - *

Evaluate change point score of every series point. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     series (Required): [
-     *          (Required){
-     *             timestamp: OffsetDateTime (Optional)
-     *             value: double (Required)
-     *         }
-     *     ]
-     *     granularity: String(yearly/monthly/weekly/daily/hourly/minutely/secondly/microsecond/none) (Required)
-     *     customInterval: Integer (Optional)
-     *     period: Integer (Optional)
-     *     stableTrendWindow: Integer (Optional)
-     *     threshold: Double (Optional)
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     period: Integer (Optional)
-     *     isChangePoint (Optional): [
-     *         boolean (Optional)
-     *     ]
-     *     confidenceScores (Optional): [
-     *         double (Optional)
-     *     ]
-     * }
-     * }
- * - * @param options Method of univariate anomaly detection. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response of change point detection along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response detectUnivariateChangePointWithResponse( - BinaryData options, RequestOptions requestOptions) { - return this.client.detectUnivariateChangePointWithResponse(options, requestOptions).block(); - } - - /** - * Get Multivariate Anomaly Detection Result - * - *

For asynchronous inference, get multivariate anomaly detection result based on resultId returned by the - * BatchDetectAnomaly api. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     resultId: String (Required)
-     *     summary (Required): {
-     *         status: String(CREATED/RUNNING/READY/FAILED) (Required)
-     *         errors (Optional): [
-     *              (Optional){
-     *                 code: String (Required)
-     *                 message: String (Required)
-     *             }
-     *         ]
-     *         variableStates (Optional): [
-     *              (Optional){
-     *                 variable: String (Optional)
-     *                 filledNARatio: Double (Optional)
-     *                 effectiveCount: Integer (Optional)
-     *                 firstTimestamp: OffsetDateTime (Optional)
-     *                 lastTimestamp: OffsetDateTime (Optional)
-     *             }
-     *         ]
-     *         setupInfo (Required): {
-     *             dataSource: String (Required)
-     *             topContributorCount: int (Required)
-     *             startTime: OffsetDateTime (Required)
-     *             endTime: OffsetDateTime (Required)
-     *         }
-     *     }
-     *     results (Required): [
-     *          (Required){
-     *             timestamp: OffsetDateTime (Required)
-     *             value (Optional): {
-     *                 isAnomaly: boolean (Required)
-     *                 severity: double (Required)
-     *                 score: double (Required)
-     *                 interpretation (Optional): [
-     *                      (Optional){
-     *                         variable: String (Optional)
-     *                         contributionScore: Double (Optional)
-     *                         correlationChanges (Optional): {
-     *                             changedVariables (Optional): [
-     *                                 String (Optional)
-     *                             ]
-     *                         }
-     *                     }
-     *                 ]
-     *             }
-     *             errors (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *     ]
-     * }
-     * }
- * - * @param resultId ID of a batch detection result. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return detection results for the given resultId along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getMultivariateBatchDetectionResultWithResponse( - String resultId, RequestOptions requestOptions) { - return this.client.getMultivariateBatchDetectionResultWithResponse(resultId, requestOptions).block(); - } - - /** - * Train a Multivariate Anomaly Detection Model - * - *

Create and train a multivariate anomaly detection model. The request must include a source parameter to - * indicate an externally accessible Azure blob storage URI.There are two types of data input: An URI pointed to an - * Azure blob storage folder which contains multiple CSV files, and each CSV file contains two columns, timestamp - * and variable. Another type of input is an URI pointed to a CSV file in Azure blob storage, which contains all the - * variables and a timestamp column. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     dataSource: String (Required)
-     *     dataSchema: String(OneTable/MultiTable) (Optional)
-     *     startTime: OffsetDateTime (Required)
-     *     endTime: OffsetDateTime (Required)
-     *     displayName: String (Optional)
-     *     slidingWindow: Integer (Optional)
-     *     alignPolicy (Optional): {
-     *         alignMode: String(Inner/Outer) (Optional)
-     *         fillNAMethod: String(Previous/Subsequent/Linear/Zero/Fixed) (Optional)
-     *         paddingValue: Double (Optional)
-     *     }
-     *     status: String(CREATED/RUNNING/READY/FAILED) (Optional)
-     *     errors (Optional): [
-     *          (Optional){
-     *             code: String (Required)
-     *             message: String (Required)
-     *         }
-     *     ]
-     *     diagnosticsInfo (Optional): {
-     *         modelState (Optional): {
-     *             epochIds (Optional): [
-     *                 int (Optional)
-     *             ]
-     *             trainLosses (Optional): [
-     *                 double (Optional)
-     *             ]
-     *             validationLosses (Optional): [
-     *                 double (Optional)
-     *             ]
-     *             latenciesInSeconds (Optional): [
-     *                 double (Optional)
-     *             ]
-     *         }
-     *         variableStates (Optional): [
-     *              (Optional){
-     *                 variable: String (Optional)
-     *                 filledNARatio: Double (Optional)
-     *                 effectiveCount: Integer (Optional)
-     *                 firstTimestamp: OffsetDateTime (Optional)
-     *                 lastTimestamp: OffsetDateTime (Optional)
-     *             }
-     *         ]
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     modelId: String (Required)
-     *     createdTime: OffsetDateTime (Required)
-     *     lastUpdatedTime: OffsetDateTime (Required)
-     *     modelInfo (Optional): {
-     *         dataSource: String (Required)
-     *         dataSchema: String(OneTable/MultiTable) (Optional)
-     *         startTime: OffsetDateTime (Required)
-     *         endTime: OffsetDateTime (Required)
-     *         displayName: String (Optional)
-     *         slidingWindow: Integer (Optional)
-     *         alignPolicy (Optional): {
-     *             alignMode: String(Inner/Outer) (Optional)
-     *             fillNAMethod: String(Previous/Subsequent/Linear/Zero/Fixed) (Optional)
-     *             paddingValue: Double (Optional)
-     *         }
-     *         status: String(CREATED/RUNNING/READY/FAILED) (Optional)
-     *         errors (Optional): [
-     *              (Optional){
-     *                 code: String (Required)
-     *                 message: String (Required)
-     *             }
-     *         ]
-     *         diagnosticsInfo (Optional): {
-     *             modelState (Optional): {
-     *                 epochIds (Optional): [
-     *                     int (Optional)
-     *                 ]
-     *                 trainLosses (Optional): [
-     *                     double (Optional)
-     *                 ]
-     *                 validationLosses (Optional): [
-     *                     double (Optional)
-     *                 ]
-     *                 latenciesInSeconds (Optional): [
-     *                     double (Optional)
-     *                 ]
-     *             }
-     *             variableStates (Optional): [
-     *                  (Optional){
-     *                     variable: String (Optional)
-     *                     filledNARatio: Double (Optional)
-     *                     effectiveCount: Integer (Optional)
-     *                     firstTimestamp: OffsetDateTime (Optional)
-     *                     lastTimestamp: OffsetDateTime (Optional)
-     *                 }
-     *             ]
-     *         }
-     *     }
-     * }
-     * }
- * - * @param modelInfo Model information. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return response of getting a model along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response trainMultivariateModelWithResponse( - BinaryData modelInfo, RequestOptions requestOptions) { - return this.client.trainMultivariateModelWithResponse(modelInfo, requestOptions).block(); - } - - /** - * List Multivariate Models - * - *

List models of a resource. - * - *

Query Parameters - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
skipIntegerNoSkip indicates how many models will be skipped.
topIntegerNoTop indicates how many models will be fetched.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     modelId: String (Required)
-     *     createdTime: OffsetDateTime (Required)
-     *     lastUpdatedTime: OffsetDateTime (Required)
-     *     modelInfo (Optional): {
-     *         dataSource: String (Required)
-     *         dataSchema: String(OneTable/MultiTable) (Optional)
-     *         startTime: OffsetDateTime (Required)
-     *         endTime: OffsetDateTime (Required)
-     *         displayName: String (Optional)
-     *         slidingWindow: Integer (Optional)
-     *         alignPolicy (Optional): {
-     *             alignMode: String(Inner/Outer) (Optional)
-     *             fillNAMethod: String(Previous/Subsequent/Linear/Zero/Fixed) (Optional)
-     *             paddingValue: Double (Optional)
-     *         }
-     *         status: String(CREATED/RUNNING/READY/FAILED) (Optional)
-     *         errors (Optional): [
-     *              (Optional){
-     *                 code: String (Required)
-     *                 message: String (Required)
-     *             }
-     *         ]
-     *         diagnosticsInfo (Optional): {
-     *             modelState (Optional): {
-     *                 epochIds (Optional): [
-     *                     int (Optional)
-     *                 ]
-     *                 trainLosses (Optional): [
-     *                     double (Optional)
-     *                 ]
-     *                 validationLosses (Optional): [
-     *                     double (Optional)
-     *                 ]
-     *                 latenciesInSeconds (Optional): [
-     *                     double (Optional)
-     *                 ]
-     *             }
-     *             variableStates (Optional): [
-     *                  (Optional){
-     *                     variable: String (Optional)
-     *                     filledNARatio: Double (Optional)
-     *                     effectiveCount: Integer (Optional)
-     *                     firstTimestamp: OffsetDateTime (Optional)
-     *                     lastTimestamp: OffsetDateTime (Optional)
-     *                 }
-     *             ]
-     *         }
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return response of listing models as paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listMultivariateModels(RequestOptions requestOptions) { - return new PagedIterable<>(this.client.listMultivariateModels(requestOptions)); - } - - /** - * Delete Multivariate Model - * - *

Delete an existing multivariate model according to the modelId. - * - * @param modelId Model identifier. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteMultivariateModelWithResponse(String modelId, RequestOptions requestOptions) { - return this.client.deleteMultivariateModelWithResponse(modelId, requestOptions).block(); - } - - /** - * Get Multivariate Model - * - *

Get detailed information of multivariate model, including the training status and variables used in the model. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     modelId: String (Required)
-     *     createdTime: OffsetDateTime (Required)
-     *     lastUpdatedTime: OffsetDateTime (Required)
-     *     modelInfo (Optional): {
-     *         dataSource: String (Required)
-     *         dataSchema: String(OneTable/MultiTable) (Optional)
-     *         startTime: OffsetDateTime (Required)
-     *         endTime: OffsetDateTime (Required)
-     *         displayName: String (Optional)
-     *         slidingWindow: Integer (Optional)
-     *         alignPolicy (Optional): {
-     *             alignMode: String(Inner/Outer) (Optional)
-     *             fillNAMethod: String(Previous/Subsequent/Linear/Zero/Fixed) (Optional)
-     *             paddingValue: Double (Optional)
-     *         }
-     *         status: String(CREATED/RUNNING/READY/FAILED) (Optional)
-     *         errors (Optional): [
-     *              (Optional){
-     *                 code: String (Required)
-     *                 message: String (Required)
-     *             }
-     *         ]
-     *         diagnosticsInfo (Optional): {
-     *             modelState (Optional): {
-     *                 epochIds (Optional): [
-     *                     int (Optional)
-     *                 ]
-     *                 trainLosses (Optional): [
-     *                     double (Optional)
-     *                 ]
-     *                 validationLosses (Optional): [
-     *                     double (Optional)
-     *                 ]
-     *                 latenciesInSeconds (Optional): [
-     *                     double (Optional)
-     *                 ]
-     *             }
-     *             variableStates (Optional): [
-     *                  (Optional){
-     *                     variable: String (Optional)
-     *                     filledNARatio: Double (Optional)
-     *                     effectiveCount: Integer (Optional)
-     *                     firstTimestamp: OffsetDateTime (Optional)
-     *                     lastTimestamp: OffsetDateTime (Optional)
-     *                 }
-     *             ]
-     *         }
-     *     }
-     * }
-     * }
- * - * @param modelId Model identifier. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return detailed information of multivariate model, including the training status and variables used in the model - * along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getMultivariateModelWithResponse(String modelId, RequestOptions requestOptions) { - return this.client.getMultivariateModelWithResponse(modelId, requestOptions).block(); - } - - /** - * Detect Multivariate Anomaly - * - *

Submit multivariate anomaly detection task with the modelId of trained model and inference data, the input - * schema should be the same with the training request. The request will complete asynchronously and return a - * resultId to query the detection result.The request should be a source link to indicate an externally accessible - * Azure storage Uri, either pointed to an Azure blob storage folder, or pointed to a CSV file in Azure blob - * storage. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     dataSource: String (Required)
-     *     topContributorCount: int (Required)
-     *     startTime: OffsetDateTime (Required)
-     *     endTime: OffsetDateTime (Required)
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     resultId: String (Required)
-     *     summary (Required): {
-     *         status: String(CREATED/RUNNING/READY/FAILED) (Required)
-     *         errors (Optional): [
-     *              (Optional){
-     *                 code: String (Required)
-     *                 message: String (Required)
-     *             }
-     *         ]
-     *         variableStates (Optional): [
-     *              (Optional){
-     *                 variable: String (Optional)
-     *                 filledNARatio: Double (Optional)
-     *                 effectiveCount: Integer (Optional)
-     *                 firstTimestamp: OffsetDateTime (Optional)
-     *                 lastTimestamp: OffsetDateTime (Optional)
-     *             }
-     *         ]
-     *         setupInfo (Required): {
-     *             dataSource: String (Required)
-     *             topContributorCount: int (Required)
-     *             startTime: OffsetDateTime (Required)
-     *             endTime: OffsetDateTime (Required)
-     *         }
-     *     }
-     *     results (Required): [
-     *          (Required){
-     *             timestamp: OffsetDateTime (Required)
-     *             value (Optional): {
-     *                 isAnomaly: boolean (Required)
-     *                 severity: double (Required)
-     *                 score: double (Required)
-     *                 interpretation (Optional): [
-     *                      (Optional){
-     *                         variable: String (Optional)
-     *                         contributionScore: Double (Optional)
-     *                         correlationChanges (Optional): {
-     *                             changedVariables (Optional): [
-     *                                 String (Optional)
-     *                             ]
-     *                         }
-     *                     }
-     *                 ]
-     *             }
-     *             errors (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *     ]
-     * }
-     * }
- * - * @param modelId Model identifier. - * @param options Request of multivariate anomaly detection. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return detection results for the given resultId along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response detectMultivariateBatchAnomalyWithResponse( - String modelId, BinaryData options, RequestOptions requestOptions) { - return this.client.detectMultivariateBatchAnomalyWithResponse(modelId, options, requestOptions).block(); - } - - /** - * Detect anomalies in the last point of the request body - * - *

Submit multivariate anomaly detection task with the modelId of trained model and inference data, and the - * inference data should be put into request body in a JSON format. The request will complete synchronously and - * return the detection immediately in the response body. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     variables (Required): [
-     *          (Required){
-     *             variable: String (Required)
-     *             timestamps (Required): [
-     *                 String (Required)
-     *             ]
-     *             values (Required): [
-     *                 double (Required)
-     *             ]
-     *         }
-     *     ]
-     *     topContributorCount: int (Required)
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     variableStates (Optional): [
-     *          (Optional){
-     *             variable: String (Optional)
-     *             filledNARatio: Double (Optional)
-     *             effectiveCount: Integer (Optional)
-     *             firstTimestamp: OffsetDateTime (Optional)
-     *             lastTimestamp: OffsetDateTime (Optional)
-     *         }
-     *     ]
-     *     results (Optional): [
-     *          (Optional){
-     *             timestamp: OffsetDateTime (Required)
-     *             value (Optional): {
-     *                 isAnomaly: boolean (Required)
-     *                 severity: double (Required)
-     *                 score: double (Required)
-     *                 interpretation (Optional): [
-     *                      (Optional){
-     *                         variable: String (Optional)
-     *                         contributionScore: Double (Optional)
-     *                         correlationChanges (Optional): {
-     *                             changedVariables (Optional): [
-     *                                 String (Optional)
-     *                             ]
-     *                         }
-     *                     }
-     *                 ]
-     *             }
-     *             errors (Optional): [
-     *                  (Optional){
-     *                     code: String (Required)
-     *                     message: String (Required)
-     *                 }
-     *             ]
-     *         }
-     *     ]
-     * }
-     * }
- * - * @param modelId Model identifier. - * @param options Request of last detection. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return results of last detection along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response detectMultivariateLastAnomalyWithResponse( - String modelId, BinaryData options, RequestOptions requestOptions) { - return this.client.detectMultivariateLastAnomalyWithResponse(modelId, options, requestOptions).block(); - } - - /** - * Detect anomalies for the entire series in batch. - * - *

This operation generates a model with an entire series, each point is detected with the same model. With this - * method, points before and after a certain point are used to determine whether it is an anomaly. The entire - * detection can give user an overall status of the time series. - * - * @param options Method of univariate anomaly detection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of entire anomaly detection. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public UnivariateEntireDetectionResult detectUnivariateEntireSeries(UnivariateDetectionOptions options) { - // Generated convenience method for detectUnivariateEntireSeriesWithResponse - RequestOptions requestOptions = new RequestOptions(); - return detectUnivariateEntireSeriesWithResponse(BinaryData.fromObject(options), requestOptions) - .getValue() - .toObject(UnivariateEntireDetectionResult.class); - } - - /** - * Detect anomaly status of the latest point in time series. - * - *

This operation generates a model using the points that you sent into the API, and based on all data to - * determine whether the last point is anomalous. - * - * @param options Method of univariate anomaly detection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of last anomaly detection. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public UnivariateLastDetectionResult detectUnivariateLastPoint(UnivariateDetectionOptions options) { - // Generated convenience method for detectUnivariateLastPointWithResponse - RequestOptions requestOptions = new RequestOptions(); - return detectUnivariateLastPointWithResponse(BinaryData.fromObject(options), requestOptions) - .getValue() - .toObject(UnivariateLastDetectionResult.class); - } - - /** - * Detect change point for the entire series - * - *

Evaluate change point score of every series point. - * - * @param options Method of univariate anomaly detection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of change point detection. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public UnivariateChangePointDetectionResult detectUnivariateChangePoint( - UnivariateChangePointDetectionOptions options) { - // Generated convenience method for detectUnivariateChangePointWithResponse - RequestOptions requestOptions = new RequestOptions(); - return detectUnivariateChangePointWithResponse(BinaryData.fromObject(options), requestOptions) - .getValue() - .toObject(UnivariateChangePointDetectionResult.class); - } - - /** - * Get Multivariate Anomaly Detection Result - * - *

For asynchronous inference, get multivariate anomaly detection result based on resultId returned by the - * BatchDetectAnomaly api. - * - * @param resultId ID of a batch detection result. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return detection results for the given resultId. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public MultivariateDetectionResult getMultivariateBatchDetectionResult(String resultId) { - // Generated convenience method for getMultivariateBatchDetectionResultWithResponse - RequestOptions requestOptions = new RequestOptions(); - return getMultivariateBatchDetectionResultWithResponse(resultId, requestOptions) - .getValue() - .toObject(MultivariateDetectionResult.class); - } - - /** - * Train a Multivariate Anomaly Detection Model - * - *

Create and train a multivariate anomaly detection model. The request must include a source parameter to - * indicate an externally accessible Azure blob storage URI.There are two types of data input: An URI pointed to an - * Azure blob storage folder which contains multiple CSV files, and each CSV file contains two columns, timestamp - * and variable. Another type of input is an URI pointed to a CSV file in Azure blob storage, which contains all the - * variables and a timestamp column. - * - * @param modelInfo Model information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of getting a model. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public AnomalyDetectionModel trainMultivariateModel(ModelInfo modelInfo) { - // Generated convenience method for trainMultivariateModelWithResponse - RequestOptions requestOptions = new RequestOptions(); - return trainMultivariateModelWithResponse(BinaryData.fromObject(modelInfo), requestOptions) - .getValue() - .toObject(AnomalyDetectionModel.class); - } - - /** - * List Multivariate Models - * - *

List models of a resource. - * - * @param skip Skip indicates how many models will be skipped. - * @param top Top indicates how many models will be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.exception.HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of listing models as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listMultivariateModels(Integer skip, Integer top) { - // Generated convenience method for listMultivariateModels - return new PagedIterable<>(client.listMultivariateModels(skip, top)); - } - - /** - * List Multivariate Models - * - *

List models of a resource. - * - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of listing models as paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listMultivariateModels() { - // Generated convenience method for listMultivariateModels - return new PagedIterable<>(client.listMultivariateModels()); - } - - /** - * Delete Multivariate Model - * - *

Delete an existing multivariate model according to the modelId. - * - * @param modelId Model identifier. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteMultivariateModel(String modelId) { - // Generated convenience method for deleteMultivariateModelWithResponse - RequestOptions requestOptions = new RequestOptions(); - deleteMultivariateModelWithResponse(modelId, requestOptions).getValue(); - } - - /** - * Get Multivariate Model - * - *

Get detailed information of multivariate model, including the training status and variables used in the model. - * - * @param modelId Model identifier. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return detailed information of multivariate model, including the training status and variables used in the - * model. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public AnomalyDetectionModel getMultivariateModel(String modelId) { - // Generated convenience method for getMultivariateModelWithResponse - RequestOptions requestOptions = new RequestOptions(); - return getMultivariateModelWithResponse(modelId, requestOptions) - .getValue() - .toObject(AnomalyDetectionModel.class); - } - - /** - * Detect Multivariate Anomaly - * - *

Submit multivariate anomaly detection task with the modelId of trained model and inference data, the input - * schema should be the same with the training request. The request will complete asynchronously and return a - * resultId to query the detection result.The request should be a source link to indicate an externally accessible - * Azure storage Uri, either pointed to an Azure blob storage folder, or pointed to a CSV file in Azure blob - * storage. - * - * @param modelId Model identifier. - * @param options Request of multivariate anomaly detection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return detection results for the given resultId. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public MultivariateDetectionResult detectMultivariateBatchAnomaly( - String modelId, MultivariateBatchDetectionOptions options) { - // Generated convenience method for detectMultivariateBatchAnomalyWithResponse - RequestOptions requestOptions = new RequestOptions(); - return detectMultivariateBatchAnomalyWithResponse(modelId, BinaryData.fromObject(options), requestOptions) - .getValue() - .toObject(MultivariateDetectionResult.class); - } - - /** - * Detect anomalies in the last point of the request body - * - *

Submit multivariate anomaly detection task with the modelId of trained model and inference data, and the - * inference data should be put into request body in a JSON format. The request will complete synchronously and - * return the detection immediately in the response body. - * - * @param modelId Model identifier. - * @param options Request of last detection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return results of last detection. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public MultivariateLastDetectionResult detectMultivariateLastAnomaly( - String modelId, MultivariateLastDetectionOptions options) { - // Generated convenience method for detectMultivariateLastAnomalyWithResponse - RequestOptions requestOptions = new RequestOptions(); - return detectMultivariateLastAnomalyWithResponse(modelId, BinaryData.fromObject(options), requestOptions) - .getValue() - .toObject(MultivariateLastDetectionResult.class); - } -} diff --git a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/AnomalyDetectorClientBuilder.java b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/AnomalyDetectorClientBuilder.java index 8b7440be2953..17fa8734becc 100644 --- a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/AnomalyDetectorClientBuilder.java +++ b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/AnomalyDetectorClientBuilder.java @@ -1,16 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.anomalydetector; import com.azure.ai.anomalydetector.implementation.AnomalyDetectorClientImpl; import com.azure.core.annotation.Generated; import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.client.traits.AzureKeyCredentialTrait; import com.azure.core.client.traits.ConfigurationTrait; import com.azure.core.client.traits.EndpointTrait; import com.azure.core.client.traits.HttpTrait; -import com.azure.core.credential.AzureKeyCredential; +import com.azure.core.client.traits.KeyCredentialTrait; +import com.azure.core.credential.KeyCredential; import com.azure.core.http.HttpClient; import com.azure.core.http.HttpHeaders; import com.azure.core.http.HttpPipeline; @@ -19,12 +19,11 @@ import com.azure.core.http.policy.AddDatePolicy; import com.azure.core.http.policy.AddHeadersFromContextPolicy; import com.azure.core.http.policy.AddHeadersPolicy; -import com.azure.core.http.policy.AzureKeyCredentialPolicy; -import com.azure.core.http.policy.CookiePolicy; -import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpPipelinePolicy; import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.KeyCredentialPolicy; import com.azure.core.http.policy.RequestIdPolicy; import com.azure.core.http.policy.RetryOptions; import com.azure.core.http.policy.RetryPolicy; @@ -33,31 +32,42 @@ import com.azure.core.util.Configuration; import com.azure.core.util.CoreUtils; import com.azure.core.util.builder.ClientBuilderUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.serializer.JacksonAdapter; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Objects; -/** A builder for creating a new instance of the AnomalyDetectorClient type. */ -@ServiceClientBuilder(serviceClients = {AnomalyDetectorClient.class, AnomalyDetectorAsyncClient.class}) +/** + * A builder for creating a new instance of the AnomalyDetectorClient type. + */ +@ServiceClientBuilder( + serviceClients = { + UnivariateClient.class, + MultivariateClient.class, + UnivariateAsyncClient.class, + MultivariateAsyncClient.class }) public final class AnomalyDetectorClientBuilder - implements HttpTrait, - ConfigurationTrait, - AzureKeyCredentialTrait, - EndpointTrait { + implements HttpTrait, ConfigurationTrait, + KeyCredentialTrait, EndpointTrait { - @Generated private static final String SDK_NAME = "name"; + @Generated + private static final String SDK_NAME = "name"; - @Generated private static final String SDK_VERSION = "version"; + @Generated + private static final String SDK_VERSION = "version"; @Generated - private static final Map PROPERTIES = - CoreUtils.getProperties("azure-ai-anomalydetector.properties"); + private static final Map PROPERTIES + = CoreUtils.getProperties("azure-ai-anomalydetector.properties"); - @Generated private final List pipelinePolicies; + @Generated + private final List pipelinePolicies; - /** Create an instance of the AnomalyDetectorClientBuilder. */ + /** + * Create an instance of the AnomalyDetectorClientBuilder. + */ @Generated public AnomalyDetectorClientBuilder() { this.pipelinePolicies = new ArrayList<>(); @@ -66,12 +76,18 @@ public AnomalyDetectorClientBuilder() { /* * The HTTP pipeline to send requests through. */ - @Generated private HttpPipeline pipeline; + @Generated + private HttpPipeline pipeline; - /** {@inheritDoc}. */ + /** + * {@inheritDoc}. + */ @Generated @Override public AnomalyDetectorClientBuilder pipeline(HttpPipeline pipeline) { + if (this.pipeline != null && pipeline == null) { + LOGGER.atInfo().log("HttpPipeline is being set to 'null' when it was previously configured."); + } this.pipeline = pipeline; return this; } @@ -79,9 +95,12 @@ public AnomalyDetectorClientBuilder pipeline(HttpPipeline pipeline) { /* * The HTTP client used to send the request. */ - @Generated private HttpClient httpClient; + @Generated + private HttpClient httpClient; - /** {@inheritDoc}. */ + /** + * {@inheritDoc}. + */ @Generated @Override public AnomalyDetectorClientBuilder httpClient(HttpClient httpClient) { @@ -92,9 +111,12 @@ public AnomalyDetectorClientBuilder httpClient(HttpClient httpClient) { /* * The logging configuration for HTTP requests and responses. */ - @Generated private HttpLogOptions httpLogOptions; + @Generated + private HttpLogOptions httpLogOptions; - /** {@inheritDoc}. */ + /** + * {@inheritDoc}. + */ @Generated @Override public AnomalyDetectorClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { @@ -105,9 +127,12 @@ public AnomalyDetectorClientBuilder httpLogOptions(HttpLogOptions httpLogOptions /* * The client options such as application ID and custom headers to set on a request. */ - @Generated private ClientOptions clientOptions; + @Generated + private ClientOptions clientOptions; - /** {@inheritDoc}. */ + /** + * {@inheritDoc}. + */ @Generated @Override public AnomalyDetectorClientBuilder clientOptions(ClientOptions clientOptions) { @@ -118,9 +143,12 @@ public AnomalyDetectorClientBuilder clientOptions(ClientOptions clientOptions) { /* * The retry options to configure retry policy for failed requests. */ - @Generated private RetryOptions retryOptions; + @Generated + private RetryOptions retryOptions; - /** {@inheritDoc}. */ + /** + * {@inheritDoc}. + */ @Generated @Override public AnomalyDetectorClientBuilder retryOptions(RetryOptions retryOptions) { @@ -128,7 +156,9 @@ public AnomalyDetectorClientBuilder retryOptions(RetryOptions retryOptions) { return this; } - /** {@inheritDoc}. */ + /** + * {@inheritDoc}. + */ @Generated @Override public AnomalyDetectorClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { @@ -140,9 +170,12 @@ public AnomalyDetectorClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { /* * The configuration store that is used during construction of the service client. */ - @Generated private Configuration configuration; + @Generated + private Configuration configuration; - /** {@inheritDoc}. */ + /** + * {@inheritDoc}. + */ @Generated @Override public AnomalyDetectorClientBuilder configuration(Configuration configuration) { @@ -151,24 +184,14 @@ public AnomalyDetectorClientBuilder configuration(Configuration configuration) { } /* - * The AzureKeyCredential used for authentication. + * The service endpoint */ - @Generated private AzureKeyCredential azureKeyCredential; - - /** {@inheritDoc}. */ @Generated - @Override - public AnomalyDetectorClientBuilder credential(AzureKeyCredential azureKeyCredential) { - this.azureKeyCredential = azureKeyCredential; - return this; - } + private String endpoint; - /* - * The service endpoint + /** + * {@inheritDoc}. */ - @Generated private String endpoint; - - /** {@inheritDoc}. */ @Generated @Override public AnomalyDetectorClientBuilder endpoint(String endpoint) { @@ -179,7 +202,8 @@ public AnomalyDetectorClientBuilder endpoint(String endpoint) { /* * Service version */ - @Generated private AnomalyDetectorServiceVersion serviceVersion; + @Generated + private AnomalyDetectorServiceVersion serviceVersion; /** * Sets Service version. @@ -196,7 +220,8 @@ public AnomalyDetectorClientBuilder serviceVersion(AnomalyDetectorServiceVersion /* * The retry policy that will attempt to retry failed requests, if applicable. */ - @Generated private RetryPolicy retryPolicy; + @Generated + private RetryPolicy retryPolicy; /** * Sets The retry policy that will attempt to retry failed requests, if applicable. @@ -217,19 +242,19 @@ public AnomalyDetectorClientBuilder retryPolicy(RetryPolicy retryPolicy) { */ @Generated private AnomalyDetectorClientImpl buildInnerClient() { + this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - AnomalyDetectorServiceVersion localServiceVersion = - (serviceVersion != null) ? serviceVersion : AnomalyDetectorServiceVersion.getLatest(); - AnomalyDetectorClientImpl client = - new AnomalyDetectorClientImpl( - localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, localServiceVersion); + AnomalyDetectorServiceVersion localServiceVersion + = (serviceVersion != null) ? serviceVersion : AnomalyDetectorServiceVersion.getLatest(); + AnomalyDetectorClientImpl client = new AnomalyDetectorClientImpl(localPipeline, + JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint, localServiceVersion); return client; } @Generated private HttpPipeline createHttpPipeline() { - Configuration buildConfiguration = - (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; + Configuration buildConfiguration + = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions; ClientOptions localClientOptions = this.clientOptions == null ? new ClientOptions() : this.clientOptions; List policies = new ArrayList<>(); @@ -239,52 +264,93 @@ private HttpPipeline createHttpPipeline() { policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); policies.add(new RequestIdPolicy()); policies.add(new AddHeadersFromContextPolicy()); - HttpHeaders headers = new HttpHeaders(); - localClientOptions.getHeaders().forEach(header -> headers.set(header.getName(), header.getValue())); - if (headers.getSize() > 0) { + HttpHeaders headers = CoreUtils.createHttpHeadersFromClientOptions(localClientOptions); + if (headers != null) { policies.add(new AddHeadersPolicy(headers)); } this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .forEach(p -> policies.add(p)); + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .forEach(p -> policies.add(p)); HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); policies.add(new AddDatePolicy()); - policies.add(new CookiePolicy()); - if (azureKeyCredential != null) { - policies.add(new AzureKeyCredentialPolicy("Ocp-Apim-Subscription-Key", azureKeyCredential)); + if (keyCredential != null) { + policies.add(new KeyCredentialPolicy("Ocp-Apim-Subscription-Key", keyCredential)); } this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .forEach(p -> policies.add(p)); + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .forEach(p -> policies.add(p)); HttpPolicyProviders.addAfterRetryPolicies(policies); - policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = - new HttpPipelineBuilder() - .policies(policies.toArray(new HttpPipelinePolicy[0])) - .httpClient(httpClient) - .clientOptions(localClientOptions) - .build(); + policies.add(new HttpLoggingPolicy(localHttpLogOptions)); + HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) + .httpClient(httpClient) + .clientOptions(localClientOptions) + .build(); return httpPipeline; } + /* + * The KeyCredential used for authentication. + */ + @Generated + private KeyCredential keyCredential; + /** - * Builds an instance of AnomalyDetectorAsyncClient class. + * {@inheritDoc}. + */ + @Generated + @Override + public AnomalyDetectorClientBuilder credential(KeyCredential keyCredential) { + this.keyCredential = keyCredential; + return this; + } + + @Generated + private void validateClient() { + // This method is invoked from 'buildInnerClient'/'buildClient' method. + // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); + } + + /** + * Builds an instance of UnivariateAsyncClient class. + * + * @return an instance of UnivariateAsyncClient. + */ + @Generated + public UnivariateAsyncClient buildUnivariateAsyncClient() { + return new UnivariateAsyncClient(buildInnerClient().getUnivariates()); + } + + /** + * Builds an instance of MultivariateAsyncClient class. + * + * @return an instance of MultivariateAsyncClient. + */ + @Generated + public MultivariateAsyncClient buildMultivariateAsyncClient() { + return new MultivariateAsyncClient(buildInnerClient().getMultivariates()); + } + + /** + * Builds an instance of UnivariateClient class. * - * @return an instance of AnomalyDetectorAsyncClient. + * @return an instance of UnivariateClient. */ @Generated - public AnomalyDetectorAsyncClient buildAsyncClient() { - return new AnomalyDetectorAsyncClient(buildInnerClient()); + public UnivariateClient buildUnivariateClient() { + return new UnivariateClient(buildInnerClient().getUnivariates()); } /** - * Builds an instance of AnomalyDetectorClient class. + * Builds an instance of MultivariateClient class. * - * @return an instance of AnomalyDetectorClient. + * @return an instance of MultivariateClient. */ @Generated - public AnomalyDetectorClient buildClient() { - return new AnomalyDetectorClient(new AnomalyDetectorAsyncClient(buildInnerClient())); + public MultivariateClient buildMultivariateClient() { + return new MultivariateClient(buildInnerClient().getMultivariates()); } + + private static final ClientLogger LOGGER = new ClientLogger(AnomalyDetectorClientBuilder.class); } diff --git a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/AnomalyDetectorServiceVersion.java b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/AnomalyDetectorServiceVersion.java index fbe008c5bba5..12d5cce92701 100644 --- a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/AnomalyDetectorServiceVersion.java +++ b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/AnomalyDetectorServiceVersion.java @@ -1,14 +1,18 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.anomalydetector; import com.azure.core.util.ServiceVersion; -/** Service version of AnomalyDetectorClient. */ +/** + * Service version of AnomalyDetectorClient. + */ public enum AnomalyDetectorServiceVersion implements ServiceVersion { - /** Enum value v1.1. */ + /** + * Enum value v1.1. + */ V1_1("v1.1"); private final String version; @@ -17,7 +21,9 @@ public enum AnomalyDetectorServiceVersion implements ServiceVersion { this.version = version; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public String getVersion() { return this.version; @@ -25,7 +31,7 @@ public String getVersion() { /** * Gets the latest service version supported by this client library. - * + * * @return The latest {@link AnomalyDetectorServiceVersion}. */ public static AnomalyDetectorServiceVersion getLatest() { diff --git a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/MultivariateAsyncClient.java b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/MultivariateAsyncClient.java new file mode 100644 index 000000000000..86a7d27c7b00 --- /dev/null +++ b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/MultivariateAsyncClient.java @@ -0,0 +1,855 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.anomalydetector; + +import com.azure.ai.anomalydetector.implementation.MultivariatesImpl; +import com.azure.ai.anomalydetector.models.AnomalyDetectionModel; +import com.azure.ai.anomalydetector.models.ModelInfo; +import com.azure.ai.anomalydetector.models.MultivariateBatchDetectionOptions; +import com.azure.ai.anomalydetector.models.MultivariateDetectionResult; +import com.azure.ai.anomalydetector.models.MultivariateLastDetectionOptions; +import com.azure.ai.anomalydetector.models.MultivariateLastDetectionResult; +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.FluxUtil; +import java.util.stream.Collectors; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous AnomalyDetectorClient type. + */ +@ServiceClient(builder = AnomalyDetectorClientBuilder.class, isAsync = true) +public final class MultivariateAsyncClient { + + @Generated + private final MultivariatesImpl serviceClient; + + /** + * Initializes an instance of MultivariateAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + MultivariateAsyncClient(MultivariatesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * Get Multivariate Anomaly Detection Result + * + * For asynchronous inference, get a multivariate anomaly detection result based on the + * resultId value that the BatchDetectAnomaly API returns. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     resultId: String (Required)
+     *     summary (Required): {
+     *         status: String(CREATED/RUNNING/READY/FAILED) (Required)
+     *         errors (Optional): [
+     *              (Optional){
+     *                 code: String (Required)
+     *                 message: String (Required)
+     *             }
+     *         ]
+     *         variableStates (Optional): [
+     *              (Optional){
+     *                 variable: String (Optional)
+     *                 filledNARatio: Double (Optional)
+     *                 effectiveCount: Integer (Optional)
+     *                 firstTimestamp: OffsetDateTime (Optional)
+     *                 lastTimestamp: OffsetDateTime (Optional)
+     *             }
+     *         ]
+     *         setupInfo (Required): {
+     *             dataSource: String (Required)
+     *             topContributorCount: Integer (Optional)
+     *             startTime: OffsetDateTime (Required)
+     *             endTime: OffsetDateTime (Required)
+     *         }
+     *     }
+     *     results (Required): [
+     *          (Required){
+     *             timestamp: OffsetDateTime (Required)
+     *             value (Optional): {
+     *                 isAnomaly: boolean (Required)
+     *                 severity: double (Required)
+     *                 score: double (Required)
+     *                 interpretation (Optional): [
+     *                      (Optional){
+     *                         variable: String (Optional)
+     *                         contributionScore: Double (Optional)
+     *                         correlationChanges (Optional): {
+     *                             changedVariables (Optional): [
+     *                                 String (Optional)
+     *                             ]
+     *                         }
+     *                     }
+     *                 ]
+     *             }
+     *             errors (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param resultId ID of a batch detection result. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return detection results for the resultId value along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getMultivariateBatchDetectionResultWithResponse(String resultId, + RequestOptions requestOptions) { + return this.serviceClient.getMultivariateBatchDetectionResultWithResponseAsync(resultId, requestOptions); + } + + /** + * Train a Multivariate Anomaly Detection Model + * + * Create and train a multivariate anomaly detection model. The request must + * include a source parameter to indicate an Azure Blob + * Storage URI that's accessible to the service. There are two types of data input. The Blob Storage URI can point + * to an Azure Blob + * Storage folder that contains multiple CSV files, where each CSV file has + * two columns, time stamp and variable. Or the Blob Storage URI can point to a single blob that contains a CSV file + * that has all the variables and a + * time stamp column. + * The model object will be created and returned in the response, but the + * training process happens asynchronously. To check the training status, call + * GetMultivariateModel with the modelId value and check the status field in the + * modelInfo object. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     dataSource: String (Required)
+     *     dataSchema: String(OneTable/MultiTable) (Optional)
+     *     startTime: OffsetDateTime (Required)
+     *     endTime: OffsetDateTime (Required)
+     *     displayName: String (Optional)
+     *     slidingWindow: Integer (Optional)
+     *     alignPolicy (Optional): {
+     *         alignMode: String(Inner/Outer) (Optional)
+     *         fillNAMethod: String(Previous/Subsequent/Linear/Zero/Fixed) (Optional)
+     *         paddingValue: Double (Optional)
+     *     }
+     *     status: String(CREATED/RUNNING/READY/FAILED) (Optional)
+     *     errors (Optional): [
+     *          (Optional){
+     *             code: String (Required)
+     *             message: String (Required)
+     *         }
+     *     ]
+     *     diagnosticsInfo (Optional): {
+     *         modelState (Optional): {
+     *             epochIds (Optional): [
+     *                 int (Optional)
+     *             ]
+     *             trainLosses (Optional): [
+     *                 double (Optional)
+     *             ]
+     *             validationLosses (Optional): [
+     *                 double (Optional)
+     *             ]
+     *             latenciesInSeconds (Optional): [
+     *                 double (Optional)
+     *             ]
+     *         }
+     *         variableStates (Optional): [
+     *              (Optional){
+     *                 variable: String (Optional)
+     *                 filledNARatio: Double (Optional)
+     *                 effectiveCount: Integer (Optional)
+     *                 firstTimestamp: OffsetDateTime (Optional)
+     *                 lastTimestamp: OffsetDateTime (Optional)
+     *             }
+     *         ]
+     *     }
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     modelId: String (Required)
+     *     createdTime: OffsetDateTime (Required)
+     *     lastUpdatedTime: OffsetDateTime (Required)
+     *     modelInfo (Optional): {
+     *         dataSource: String (Required)
+     *         dataSchema: String(OneTable/MultiTable) (Optional)
+     *         startTime: OffsetDateTime (Required)
+     *         endTime: OffsetDateTime (Required)
+     *         displayName: String (Optional)
+     *         slidingWindow: Integer (Optional)
+     *         alignPolicy (Optional): {
+     *             alignMode: String(Inner/Outer) (Optional)
+     *             fillNAMethod: String(Previous/Subsequent/Linear/Zero/Fixed) (Optional)
+     *             paddingValue: Double (Optional)
+     *         }
+     *         status: String(CREATED/RUNNING/READY/FAILED) (Optional)
+     *         errors (Optional): [
+     *              (Optional){
+     *                 code: String (Required)
+     *                 message: String (Required)
+     *             }
+     *         ]
+     *         diagnosticsInfo (Optional): {
+     *             modelState (Optional): {
+     *                 epochIds (Optional): [
+     *                     int (Optional)
+     *                 ]
+     *                 trainLosses (Optional): [
+     *                     double (Optional)
+     *                 ]
+     *                 validationLosses (Optional): [
+     *                     double (Optional)
+     *                 ]
+     *                 latenciesInSeconds (Optional): [
+     *                     double (Optional)
+     *                 ]
+     *             }
+     *             variableStates (Optional): [
+     *                  (Optional){
+     *                     variable: String (Optional)
+     *                     filledNARatio: Double (Optional)
+     *                     effectiveCount: Integer (Optional)
+     *                     firstTimestamp: OffsetDateTime (Optional)
+     *                     lastTimestamp: OffsetDateTime (Optional)
+     *                 }
+     *             ]
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param modelInfo Model information. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response of getting a model along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> trainMultivariateModelWithResponse(BinaryData modelInfo, + RequestOptions requestOptions) { + return this.serviceClient.trainMultivariateModelWithResponseAsync(modelInfo, requestOptions); + } + + /** + * List Multivariate Models + * + * List models of a resource. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
skipIntegerNoThe number of result items to skip.
topIntegerNoThe number of result items to return.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     modelId: String (Required)
+     *     createdTime: OffsetDateTime (Required)
+     *     lastUpdatedTime: OffsetDateTime (Required)
+     *     modelInfo (Optional): {
+     *         dataSource: String (Required)
+     *         dataSchema: String(OneTable/MultiTable) (Optional)
+     *         startTime: OffsetDateTime (Required)
+     *         endTime: OffsetDateTime (Required)
+     *         displayName: String (Optional)
+     *         slidingWindow: Integer (Optional)
+     *         alignPolicy (Optional): {
+     *             alignMode: String(Inner/Outer) (Optional)
+     *             fillNAMethod: String(Previous/Subsequent/Linear/Zero/Fixed) (Optional)
+     *             paddingValue: Double (Optional)
+     *         }
+     *         status: String(CREATED/RUNNING/READY/FAILED) (Optional)
+     *         errors (Optional): [
+     *              (Optional){
+     *                 code: String (Required)
+     *                 message: String (Required)
+     *             }
+     *         ]
+     *         diagnosticsInfo (Optional): {
+     *             modelState (Optional): {
+     *                 epochIds (Optional): [
+     *                     int (Optional)
+     *                 ]
+     *                 trainLosses (Optional): [
+     *                     double (Optional)
+     *                 ]
+     *                 validationLosses (Optional): [
+     *                     double (Optional)
+     *                 ]
+     *                 latenciesInSeconds (Optional): [
+     *                     double (Optional)
+     *                 ]
+     *             }
+     *             variableStates (Optional): [
+     *                  (Optional){
+     *                     variable: String (Optional)
+     *                     filledNARatio: Double (Optional)
+     *                     effectiveCount: Integer (Optional)
+     *                     firstTimestamp: OffsetDateTime (Optional)
+     *                     lastTimestamp: OffsetDateTime (Optional)
+     *                 }
+     *             ]
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response of listing models as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listMultivariateModels(RequestOptions requestOptions) { + return this.serviceClient.listMultivariateModelsAsync(requestOptions); + } + + /** + * Delete Multivariate Model + * + * Delete an existing multivariate model according to the modelId value. + * + * @param modelId Model identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteMultivariateModelWithResponse(String modelId, RequestOptions requestOptions) { + return this.serviceClient.deleteMultivariateModelWithResponseAsync(modelId, requestOptions); + } + + /** + * Get Multivariate Model + * + * Get detailed information about the multivariate model, including the training status + * and variables used in the model. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     modelId: String (Required)
+     *     createdTime: OffsetDateTime (Required)
+     *     lastUpdatedTime: OffsetDateTime (Required)
+     *     modelInfo (Optional): {
+     *         dataSource: String (Required)
+     *         dataSchema: String(OneTable/MultiTable) (Optional)
+     *         startTime: OffsetDateTime (Required)
+     *         endTime: OffsetDateTime (Required)
+     *         displayName: String (Optional)
+     *         slidingWindow: Integer (Optional)
+     *         alignPolicy (Optional): {
+     *             alignMode: String(Inner/Outer) (Optional)
+     *             fillNAMethod: String(Previous/Subsequent/Linear/Zero/Fixed) (Optional)
+     *             paddingValue: Double (Optional)
+     *         }
+     *         status: String(CREATED/RUNNING/READY/FAILED) (Optional)
+     *         errors (Optional): [
+     *              (Optional){
+     *                 code: String (Required)
+     *                 message: String (Required)
+     *             }
+     *         ]
+     *         diagnosticsInfo (Optional): {
+     *             modelState (Optional): {
+     *                 epochIds (Optional): [
+     *                     int (Optional)
+     *                 ]
+     *                 trainLosses (Optional): [
+     *                     double (Optional)
+     *                 ]
+     *                 validationLosses (Optional): [
+     *                     double (Optional)
+     *                 ]
+     *                 latenciesInSeconds (Optional): [
+     *                     double (Optional)
+     *                 ]
+     *             }
+     *             variableStates (Optional): [
+     *                  (Optional){
+     *                     variable: String (Optional)
+     *                     filledNARatio: Double (Optional)
+     *                     effectiveCount: Integer (Optional)
+     *                     firstTimestamp: OffsetDateTime (Optional)
+     *                     lastTimestamp: OffsetDateTime (Optional)
+     *                 }
+     *             ]
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param modelId Model identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return detailed information about the multivariate model, including the training status + * and variables used in the model along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getMultivariateModelWithResponse(String modelId, RequestOptions requestOptions) { + return this.serviceClient.getMultivariateModelWithResponseAsync(modelId, requestOptions); + } + + /** + * Detect Multivariate Anomaly + * + * Submit a multivariate anomaly detection task with the modelId value of a trained model + * and inference data. The input schema should be the same with the training + * request. The request will finish asynchronously and return a resultId value to + * query the detection result. The request should be a source link to indicate an + * externally accessible Azure Storage URI that either points to an Azure Blob + * Storage folder or points to a CSV file in Azure Blob Storage. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     dataSource: String (Required)
+     *     topContributorCount: Integer (Optional)
+     *     startTime: OffsetDateTime (Required)
+     *     endTime: OffsetDateTime (Required)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     resultId: String (Required)
+     *     summary (Required): {
+     *         status: String(CREATED/RUNNING/READY/FAILED) (Required)
+     *         errors (Optional): [
+     *              (Optional){
+     *                 code: String (Required)
+     *                 message: String (Required)
+     *             }
+     *         ]
+     *         variableStates (Optional): [
+     *              (Optional){
+     *                 variable: String (Optional)
+     *                 filledNARatio: Double (Optional)
+     *                 effectiveCount: Integer (Optional)
+     *                 firstTimestamp: OffsetDateTime (Optional)
+     *                 lastTimestamp: OffsetDateTime (Optional)
+     *             }
+     *         ]
+     *         setupInfo (Required): {
+     *             dataSource: String (Required)
+     *             topContributorCount: Integer (Optional)
+     *             startTime: OffsetDateTime (Required)
+     *             endTime: OffsetDateTime (Required)
+     *         }
+     *     }
+     *     results (Required): [
+     *          (Required){
+     *             timestamp: OffsetDateTime (Required)
+     *             value (Optional): {
+     *                 isAnomaly: boolean (Required)
+     *                 severity: double (Required)
+     *                 score: double (Required)
+     *                 interpretation (Optional): [
+     *                      (Optional){
+     *                         variable: String (Optional)
+     *                         contributionScore: Double (Optional)
+     *                         correlationChanges (Optional): {
+     *                             changedVariables (Optional): [
+     *                                 String (Optional)
+     *                             ]
+     *                         }
+     *                     }
+     *                 ]
+     *             }
+     *             errors (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param modelId Model identifier. + * @param options Request of multivariate anomaly detection. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return detection results for the resultId value along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> detectMultivariateBatchAnomalyWithResponse(String modelId, BinaryData options, + RequestOptions requestOptions) { + return this.serviceClient.detectMultivariateBatchAnomalyWithResponseAsync(modelId, options, requestOptions); + } + + /** + * Detect anomalies in the last point of the request body + * + * Submit a multivariate anomaly detection task with the modelId value of a trained model + * and inference data. The inference data should be put into the request body in + * JSON format. The request will finish synchronously and return the detection + * immediately in the response body. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     variables (Required): [
+     *          (Required){
+     *             variable: String (Required)
+     *             timestamps (Required): [
+     *                 String (Required)
+     *             ]
+     *             values (Required): [
+     *                 double (Required)
+     *             ]
+     *         }
+     *     ]
+     *     topContributorCount: Integer (Optional)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     variableStates (Optional): [
+     *          (Optional){
+     *             variable: String (Optional)
+     *             filledNARatio: Double (Optional)
+     *             effectiveCount: Integer (Optional)
+     *             firstTimestamp: OffsetDateTime (Optional)
+     *             lastTimestamp: OffsetDateTime (Optional)
+     *         }
+     *     ]
+     *     results (Optional): [
+     *          (Optional){
+     *             timestamp: OffsetDateTime (Required)
+     *             value (Optional): {
+     *                 isAnomaly: boolean (Required)
+     *                 severity: double (Required)
+     *                 score: double (Required)
+     *                 interpretation (Optional): [
+     *                      (Optional){
+     *                         variable: String (Optional)
+     *                         contributionScore: Double (Optional)
+     *                         correlationChanges (Optional): {
+     *                             changedVariables (Optional): [
+     *                                 String (Optional)
+     *                             ]
+     *                         }
+     *                     }
+     *                 ]
+     *             }
+     *             errors (Optional): [
+     *                  (Optional){
+     *                     code: String (Required)
+     *                     message: String (Required)
+     *                 }
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param modelId Model identifier. + * @param options Request of the last detection. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return results of the last detection along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> detectMultivariateLastAnomalyWithResponse(String modelId, BinaryData options, + RequestOptions requestOptions) { + return this.serviceClient.detectMultivariateLastAnomalyWithResponseAsync(modelId, options, requestOptions); + } + + /** + * Get Multivariate Anomaly Detection Result + * + * For asynchronous inference, get a multivariate anomaly detection result based on the + * resultId value that the BatchDetectAnomaly API returns. + * + * @param resultId ID of a batch detection result. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return detection results for the resultId value on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getMultivariateBatchDetectionResult(String resultId) { + // Generated convenience method for getMultivariateBatchDetectionResultWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getMultivariateBatchDetectionResultWithResponse(resultId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(MultivariateDetectionResult.class)); + } + + /** + * Train a Multivariate Anomaly Detection Model + * + * Create and train a multivariate anomaly detection model. The request must + * include a source parameter to indicate an Azure Blob + * Storage URI that's accessible to the service. There are two types of data input. The Blob Storage URI can point + * to an Azure Blob + * Storage folder that contains multiple CSV files, where each CSV file has + * two columns, time stamp and variable. Or the Blob Storage URI can point to a single blob that contains a CSV file + * that has all the variables and a + * time stamp column. + * The model object will be created and returned in the response, but the + * training process happens asynchronously. To check the training status, call + * GetMultivariateModel with the modelId value and check the status field in the + * modelInfo object. + * + * @param modelInfo Model information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of getting a model on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono trainMultivariateModel(ModelInfo modelInfo) { + // Generated convenience method for trainMultivariateModelWithResponse + RequestOptions requestOptions = new RequestOptions(); + return trainMultivariateModelWithResponse(BinaryData.fromObject(modelInfo), requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(AnomalyDetectionModel.class)); + } + + /** + * List Multivariate Models + * + * List models of a resource. + * + * @param skip The number of result items to skip. + * @param top The number of result items to return. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of listing models as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listMultivariateModels(Integer skip, Integer top) { + // Generated convenience method for listMultivariateModels + RequestOptions requestOptions = new RequestOptions(); + if (skip != null) { + requestOptions.addQueryParam("skip", String.valueOf(skip), false); + } + if (top != null) { + requestOptions.addQueryParam("top", String.valueOf(top), false); + } + PagedFlux pagedFluxResponse = listMultivariateModels(requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux + .map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(AnomalyDetectionModel.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * List Multivariate Models + * + * List models of a resource. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of listing models as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listMultivariateModels() { + // Generated convenience method for listMultivariateModels + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = listMultivariateModels(requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux + .map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(AnomalyDetectionModel.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Delete Multivariate Model + * + * Delete an existing multivariate model according to the modelId value. + * + * @param modelId Model identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @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. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteMultivariateModel(String modelId) { + // Generated convenience method for deleteMultivariateModelWithResponse + RequestOptions requestOptions = new RequestOptions(); + return deleteMultivariateModelWithResponse(modelId, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Get Multivariate Model + * + * Get detailed information about the multivariate model, including the training status + * and variables used in the model. + * + * @param modelId Model identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return detailed information about the multivariate model, including the training status + * and variables used in the model on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getMultivariateModel(String modelId) { + // Generated convenience method for getMultivariateModelWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getMultivariateModelWithResponse(modelId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(AnomalyDetectionModel.class)); + } + + /** + * Detect Multivariate Anomaly + * + * Submit a multivariate anomaly detection task with the modelId value of a trained model + * and inference data. The input schema should be the same with the training + * request. The request will finish asynchronously and return a resultId value to + * query the detection result. The request should be a source link to indicate an + * externally accessible Azure Storage URI that either points to an Azure Blob + * Storage folder or points to a CSV file in Azure Blob Storage. + * + * @param modelId Model identifier. + * @param options Request of multivariate anomaly detection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return detection results for the resultId value on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono detectMultivariateBatchAnomaly(String modelId, + MultivariateBatchDetectionOptions options) { + // Generated convenience method for detectMultivariateBatchAnomalyWithResponse + RequestOptions requestOptions = new RequestOptions(); + return detectMultivariateBatchAnomalyWithResponse(modelId, BinaryData.fromObject(options), requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(MultivariateDetectionResult.class)); + } + + /** + * Detect anomalies in the last point of the request body + * + * Submit a multivariate anomaly detection task with the modelId value of a trained model + * and inference data. The inference data should be put into the request body in + * JSON format. The request will finish synchronously and return the detection + * immediately in the response body. + * + * @param modelId Model identifier. + * @param options Request of the last detection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the last detection on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono detectMultivariateLastAnomaly(String modelId, + MultivariateLastDetectionOptions options) { + // Generated convenience method for detectMultivariateLastAnomalyWithResponse + RequestOptions requestOptions = new RequestOptions(); + return detectMultivariateLastAnomalyWithResponse(modelId, BinaryData.fromObject(options), requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(MultivariateLastDetectionResult.class)); + } +} diff --git a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/MultivariateClient.java b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/MultivariateClient.java new file mode 100644 index 000000000000..8a10933d3aad --- /dev/null +++ b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/MultivariateClient.java @@ -0,0 +1,821 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.anomalydetector; + +import com.azure.ai.anomalydetector.implementation.MultivariatesImpl; +import com.azure.ai.anomalydetector.models.AnomalyDetectionModel; +import com.azure.ai.anomalydetector.models.ModelInfo; +import com.azure.ai.anomalydetector.models.MultivariateBatchDetectionOptions; +import com.azure.ai.anomalydetector.models.MultivariateDetectionResult; +import com.azure.ai.anomalydetector.models.MultivariateLastDetectionOptions; +import com.azure.ai.anomalydetector.models.MultivariateLastDetectionResult; +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; + +/** + * Initializes a new instance of the synchronous AnomalyDetectorClient type. + */ +@ServiceClient(builder = AnomalyDetectorClientBuilder.class) +public final class MultivariateClient { + + @Generated + private final MultivariatesImpl serviceClient; + + /** + * Initializes an instance of MultivariateClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + MultivariateClient(MultivariatesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * Get Multivariate Anomaly Detection Result + * + * For asynchronous inference, get a multivariate anomaly detection result based on the + * resultId value that the BatchDetectAnomaly API returns. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     resultId: String (Required)
+     *     summary (Required): {
+     *         status: String(CREATED/RUNNING/READY/FAILED) (Required)
+     *         errors (Optional): [
+     *              (Optional){
+     *                 code: String (Required)
+     *                 message: String (Required)
+     *             }
+     *         ]
+     *         variableStates (Optional): [
+     *              (Optional){
+     *                 variable: String (Optional)
+     *                 filledNARatio: Double (Optional)
+     *                 effectiveCount: Integer (Optional)
+     *                 firstTimestamp: OffsetDateTime (Optional)
+     *                 lastTimestamp: OffsetDateTime (Optional)
+     *             }
+     *         ]
+     *         setupInfo (Required): {
+     *             dataSource: String (Required)
+     *             topContributorCount: Integer (Optional)
+     *             startTime: OffsetDateTime (Required)
+     *             endTime: OffsetDateTime (Required)
+     *         }
+     *     }
+     *     results (Required): [
+     *          (Required){
+     *             timestamp: OffsetDateTime (Required)
+     *             value (Optional): {
+     *                 isAnomaly: boolean (Required)
+     *                 severity: double (Required)
+     *                 score: double (Required)
+     *                 interpretation (Optional): [
+     *                      (Optional){
+     *                         variable: String (Optional)
+     *                         contributionScore: Double (Optional)
+     *                         correlationChanges (Optional): {
+     *                             changedVariables (Optional): [
+     *                                 String (Optional)
+     *                             ]
+     *                         }
+     *                     }
+     *                 ]
+     *             }
+     *             errors (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param resultId ID of a batch detection result. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return detection results for the resultId value along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getMultivariateBatchDetectionResultWithResponse(String resultId, + RequestOptions requestOptions) { + return this.serviceClient.getMultivariateBatchDetectionResultWithResponse(resultId, requestOptions); + } + + /** + * Train a Multivariate Anomaly Detection Model + * + * Create and train a multivariate anomaly detection model. The request must + * include a source parameter to indicate an Azure Blob + * Storage URI that's accessible to the service. There are two types of data input. The Blob Storage URI can point + * to an Azure Blob + * Storage folder that contains multiple CSV files, where each CSV file has + * two columns, time stamp and variable. Or the Blob Storage URI can point to a single blob that contains a CSV file + * that has all the variables and a + * time stamp column. + * The model object will be created and returned in the response, but the + * training process happens asynchronously. To check the training status, call + * GetMultivariateModel with the modelId value and check the status field in the + * modelInfo object. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     dataSource: String (Required)
+     *     dataSchema: String(OneTable/MultiTable) (Optional)
+     *     startTime: OffsetDateTime (Required)
+     *     endTime: OffsetDateTime (Required)
+     *     displayName: String (Optional)
+     *     slidingWindow: Integer (Optional)
+     *     alignPolicy (Optional): {
+     *         alignMode: String(Inner/Outer) (Optional)
+     *         fillNAMethod: String(Previous/Subsequent/Linear/Zero/Fixed) (Optional)
+     *         paddingValue: Double (Optional)
+     *     }
+     *     status: String(CREATED/RUNNING/READY/FAILED) (Optional)
+     *     errors (Optional): [
+     *          (Optional){
+     *             code: String (Required)
+     *             message: String (Required)
+     *         }
+     *     ]
+     *     diagnosticsInfo (Optional): {
+     *         modelState (Optional): {
+     *             epochIds (Optional): [
+     *                 int (Optional)
+     *             ]
+     *             trainLosses (Optional): [
+     *                 double (Optional)
+     *             ]
+     *             validationLosses (Optional): [
+     *                 double (Optional)
+     *             ]
+     *             latenciesInSeconds (Optional): [
+     *                 double (Optional)
+     *             ]
+     *         }
+     *         variableStates (Optional): [
+     *              (Optional){
+     *                 variable: String (Optional)
+     *                 filledNARatio: Double (Optional)
+     *                 effectiveCount: Integer (Optional)
+     *                 firstTimestamp: OffsetDateTime (Optional)
+     *                 lastTimestamp: OffsetDateTime (Optional)
+     *             }
+     *         ]
+     *     }
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     modelId: String (Required)
+     *     createdTime: OffsetDateTime (Required)
+     *     lastUpdatedTime: OffsetDateTime (Required)
+     *     modelInfo (Optional): {
+     *         dataSource: String (Required)
+     *         dataSchema: String(OneTable/MultiTable) (Optional)
+     *         startTime: OffsetDateTime (Required)
+     *         endTime: OffsetDateTime (Required)
+     *         displayName: String (Optional)
+     *         slidingWindow: Integer (Optional)
+     *         alignPolicy (Optional): {
+     *             alignMode: String(Inner/Outer) (Optional)
+     *             fillNAMethod: String(Previous/Subsequent/Linear/Zero/Fixed) (Optional)
+     *             paddingValue: Double (Optional)
+     *         }
+     *         status: String(CREATED/RUNNING/READY/FAILED) (Optional)
+     *         errors (Optional): [
+     *              (Optional){
+     *                 code: String (Required)
+     *                 message: String (Required)
+     *             }
+     *         ]
+     *         diagnosticsInfo (Optional): {
+     *             modelState (Optional): {
+     *                 epochIds (Optional): [
+     *                     int (Optional)
+     *                 ]
+     *                 trainLosses (Optional): [
+     *                     double (Optional)
+     *                 ]
+     *                 validationLosses (Optional): [
+     *                     double (Optional)
+     *                 ]
+     *                 latenciesInSeconds (Optional): [
+     *                     double (Optional)
+     *                 ]
+     *             }
+     *             variableStates (Optional): [
+     *                  (Optional){
+     *                     variable: String (Optional)
+     *                     filledNARatio: Double (Optional)
+     *                     effectiveCount: Integer (Optional)
+     *                     firstTimestamp: OffsetDateTime (Optional)
+     *                     lastTimestamp: OffsetDateTime (Optional)
+     *                 }
+     *             ]
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param modelInfo Model information. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response of getting a model along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response trainMultivariateModelWithResponse(BinaryData modelInfo, + RequestOptions requestOptions) { + return this.serviceClient.trainMultivariateModelWithResponse(modelInfo, requestOptions); + } + + /** + * List Multivariate Models + * + * List models of a resource. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
skipIntegerNoThe number of result items to skip.
topIntegerNoThe number of result items to return.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     modelId: String (Required)
+     *     createdTime: OffsetDateTime (Required)
+     *     lastUpdatedTime: OffsetDateTime (Required)
+     *     modelInfo (Optional): {
+     *         dataSource: String (Required)
+     *         dataSchema: String(OneTable/MultiTable) (Optional)
+     *         startTime: OffsetDateTime (Required)
+     *         endTime: OffsetDateTime (Required)
+     *         displayName: String (Optional)
+     *         slidingWindow: Integer (Optional)
+     *         alignPolicy (Optional): {
+     *             alignMode: String(Inner/Outer) (Optional)
+     *             fillNAMethod: String(Previous/Subsequent/Linear/Zero/Fixed) (Optional)
+     *             paddingValue: Double (Optional)
+     *         }
+     *         status: String(CREATED/RUNNING/READY/FAILED) (Optional)
+     *         errors (Optional): [
+     *              (Optional){
+     *                 code: String (Required)
+     *                 message: String (Required)
+     *             }
+     *         ]
+     *         diagnosticsInfo (Optional): {
+     *             modelState (Optional): {
+     *                 epochIds (Optional): [
+     *                     int (Optional)
+     *                 ]
+     *                 trainLosses (Optional): [
+     *                     double (Optional)
+     *                 ]
+     *                 validationLosses (Optional): [
+     *                     double (Optional)
+     *                 ]
+     *                 latenciesInSeconds (Optional): [
+     *                     double (Optional)
+     *                 ]
+     *             }
+     *             variableStates (Optional): [
+     *                  (Optional){
+     *                     variable: String (Optional)
+     *                     filledNARatio: Double (Optional)
+     *                     effectiveCount: Integer (Optional)
+     *                     firstTimestamp: OffsetDateTime (Optional)
+     *                     lastTimestamp: OffsetDateTime (Optional)
+     *                 }
+     *             ]
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response of listing models as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listMultivariateModels(RequestOptions requestOptions) { + return this.serviceClient.listMultivariateModels(requestOptions); + } + + /** + * Delete Multivariate Model + * + * Delete an existing multivariate model according to the modelId value. + * + * @param modelId Model identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteMultivariateModelWithResponse(String modelId, RequestOptions requestOptions) { + return this.serviceClient.deleteMultivariateModelWithResponse(modelId, requestOptions); + } + + /** + * Get Multivariate Model + * + * Get detailed information about the multivariate model, including the training status + * and variables used in the model. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     modelId: String (Required)
+     *     createdTime: OffsetDateTime (Required)
+     *     lastUpdatedTime: OffsetDateTime (Required)
+     *     modelInfo (Optional): {
+     *         dataSource: String (Required)
+     *         dataSchema: String(OneTable/MultiTable) (Optional)
+     *         startTime: OffsetDateTime (Required)
+     *         endTime: OffsetDateTime (Required)
+     *         displayName: String (Optional)
+     *         slidingWindow: Integer (Optional)
+     *         alignPolicy (Optional): {
+     *             alignMode: String(Inner/Outer) (Optional)
+     *             fillNAMethod: String(Previous/Subsequent/Linear/Zero/Fixed) (Optional)
+     *             paddingValue: Double (Optional)
+     *         }
+     *         status: String(CREATED/RUNNING/READY/FAILED) (Optional)
+     *         errors (Optional): [
+     *              (Optional){
+     *                 code: String (Required)
+     *                 message: String (Required)
+     *             }
+     *         ]
+     *         diagnosticsInfo (Optional): {
+     *             modelState (Optional): {
+     *                 epochIds (Optional): [
+     *                     int (Optional)
+     *                 ]
+     *                 trainLosses (Optional): [
+     *                     double (Optional)
+     *                 ]
+     *                 validationLosses (Optional): [
+     *                     double (Optional)
+     *                 ]
+     *                 latenciesInSeconds (Optional): [
+     *                     double (Optional)
+     *                 ]
+     *             }
+     *             variableStates (Optional): [
+     *                  (Optional){
+     *                     variable: String (Optional)
+     *                     filledNARatio: Double (Optional)
+     *                     effectiveCount: Integer (Optional)
+     *                     firstTimestamp: OffsetDateTime (Optional)
+     *                     lastTimestamp: OffsetDateTime (Optional)
+     *                 }
+     *             ]
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param modelId Model identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return detailed information about the multivariate model, including the training status + * and variables used in the model along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getMultivariateModelWithResponse(String modelId, RequestOptions requestOptions) { + return this.serviceClient.getMultivariateModelWithResponse(modelId, requestOptions); + } + + /** + * Detect Multivariate Anomaly + * + * Submit a multivariate anomaly detection task with the modelId value of a trained model + * and inference data. The input schema should be the same with the training + * request. The request will finish asynchronously and return a resultId value to + * query the detection result. The request should be a source link to indicate an + * externally accessible Azure Storage URI that either points to an Azure Blob + * Storage folder or points to a CSV file in Azure Blob Storage. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     dataSource: String (Required)
+     *     topContributorCount: Integer (Optional)
+     *     startTime: OffsetDateTime (Required)
+     *     endTime: OffsetDateTime (Required)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     resultId: String (Required)
+     *     summary (Required): {
+     *         status: String(CREATED/RUNNING/READY/FAILED) (Required)
+     *         errors (Optional): [
+     *              (Optional){
+     *                 code: String (Required)
+     *                 message: String (Required)
+     *             }
+     *         ]
+     *         variableStates (Optional): [
+     *              (Optional){
+     *                 variable: String (Optional)
+     *                 filledNARatio: Double (Optional)
+     *                 effectiveCount: Integer (Optional)
+     *                 firstTimestamp: OffsetDateTime (Optional)
+     *                 lastTimestamp: OffsetDateTime (Optional)
+     *             }
+     *         ]
+     *         setupInfo (Required): {
+     *             dataSource: String (Required)
+     *             topContributorCount: Integer (Optional)
+     *             startTime: OffsetDateTime (Required)
+     *             endTime: OffsetDateTime (Required)
+     *         }
+     *     }
+     *     results (Required): [
+     *          (Required){
+     *             timestamp: OffsetDateTime (Required)
+     *             value (Optional): {
+     *                 isAnomaly: boolean (Required)
+     *                 severity: double (Required)
+     *                 score: double (Required)
+     *                 interpretation (Optional): [
+     *                      (Optional){
+     *                         variable: String (Optional)
+     *                         contributionScore: Double (Optional)
+     *                         correlationChanges (Optional): {
+     *                             changedVariables (Optional): [
+     *                                 String (Optional)
+     *                             ]
+     *                         }
+     *                     }
+     *                 ]
+     *             }
+     *             errors (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param modelId Model identifier. + * @param options Request of multivariate anomaly detection. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return detection results for the resultId value along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response detectMultivariateBatchAnomalyWithResponse(String modelId, BinaryData options, + RequestOptions requestOptions) { + return this.serviceClient.detectMultivariateBatchAnomalyWithResponse(modelId, options, requestOptions); + } + + /** + * Detect anomalies in the last point of the request body + * + * Submit a multivariate anomaly detection task with the modelId value of a trained model + * and inference data. The inference data should be put into the request body in + * JSON format. The request will finish synchronously and return the detection + * immediately in the response body. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     variables (Required): [
+     *          (Required){
+     *             variable: String (Required)
+     *             timestamps (Required): [
+     *                 String (Required)
+     *             ]
+     *             values (Required): [
+     *                 double (Required)
+     *             ]
+     *         }
+     *     ]
+     *     topContributorCount: Integer (Optional)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     variableStates (Optional): [
+     *          (Optional){
+     *             variable: String (Optional)
+     *             filledNARatio: Double (Optional)
+     *             effectiveCount: Integer (Optional)
+     *             firstTimestamp: OffsetDateTime (Optional)
+     *             lastTimestamp: OffsetDateTime (Optional)
+     *         }
+     *     ]
+     *     results (Optional): [
+     *          (Optional){
+     *             timestamp: OffsetDateTime (Required)
+     *             value (Optional): {
+     *                 isAnomaly: boolean (Required)
+     *                 severity: double (Required)
+     *                 score: double (Required)
+     *                 interpretation (Optional): [
+     *                      (Optional){
+     *                         variable: String (Optional)
+     *                         contributionScore: Double (Optional)
+     *                         correlationChanges (Optional): {
+     *                             changedVariables (Optional): [
+     *                                 String (Optional)
+     *                             ]
+     *                         }
+     *                     }
+     *                 ]
+     *             }
+     *             errors (Optional): [
+     *                  (Optional){
+     *                     code: String (Required)
+     *                     message: String (Required)
+     *                 }
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param modelId Model identifier. + * @param options Request of the last detection. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return results of the last detection along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response detectMultivariateLastAnomalyWithResponse(String modelId, BinaryData options, + RequestOptions requestOptions) { + return this.serviceClient.detectMultivariateLastAnomalyWithResponse(modelId, options, requestOptions); + } + + /** + * Get Multivariate Anomaly Detection Result + * + * For asynchronous inference, get a multivariate anomaly detection result based on the + * resultId value that the BatchDetectAnomaly API returns. + * + * @param resultId ID of a batch detection result. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return detection results for the resultId value. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public MultivariateDetectionResult getMultivariateBatchDetectionResult(String resultId) { + // Generated convenience method for getMultivariateBatchDetectionResultWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getMultivariateBatchDetectionResultWithResponse(resultId, requestOptions).getValue() + .toObject(MultivariateDetectionResult.class); + } + + /** + * Train a Multivariate Anomaly Detection Model + * + * Create and train a multivariate anomaly detection model. The request must + * include a source parameter to indicate an Azure Blob + * Storage URI that's accessible to the service. There are two types of data input. The Blob Storage URI can point + * to an Azure Blob + * Storage folder that contains multiple CSV files, where each CSV file has + * two columns, time stamp and variable. Or the Blob Storage URI can point to a single blob that contains a CSV file + * that has all the variables and a + * time stamp column. + * The model object will be created and returned in the response, but the + * training process happens asynchronously. To check the training status, call + * GetMultivariateModel with the modelId value and check the status field in the + * modelInfo object. + * + * @param modelInfo Model information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of getting a model. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public AnomalyDetectionModel trainMultivariateModel(ModelInfo modelInfo) { + // Generated convenience method for trainMultivariateModelWithResponse + RequestOptions requestOptions = new RequestOptions(); + return trainMultivariateModelWithResponse(BinaryData.fromObject(modelInfo), requestOptions).getValue() + .toObject(AnomalyDetectionModel.class); + } + + /** + * List Multivariate Models + * + * List models of a resource. + * + * @param skip The number of result items to skip. + * @param top The number of result items to return. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of listing models as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listMultivariateModels(Integer skip, Integer top) { + // Generated convenience method for listMultivariateModels + RequestOptions requestOptions = new RequestOptions(); + if (skip != null) { + requestOptions.addQueryParam("skip", String.valueOf(skip), false); + } + if (top != null) { + requestOptions.addQueryParam("top", String.valueOf(top), false); + } + return serviceClient.listMultivariateModels(requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(AnomalyDetectionModel.class)); + } + + /** + * List Multivariate Models + * + * List models of a resource. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of listing models as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listMultivariateModels() { + // Generated convenience method for listMultivariateModels + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.listMultivariateModels(requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(AnomalyDetectionModel.class)); + } + + /** + * Delete Multivariate Model + * + * Delete an existing multivariate model according to the modelId value. + * + * @param modelId Model identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteMultivariateModel(String modelId) { + // Generated convenience method for deleteMultivariateModelWithResponse + RequestOptions requestOptions = new RequestOptions(); + deleteMultivariateModelWithResponse(modelId, requestOptions).getValue(); + } + + /** + * Get Multivariate Model + * + * Get detailed information about the multivariate model, including the training status + * and variables used in the model. + * + * @param modelId Model identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return detailed information about the multivariate model, including the training status + * and variables used in the model. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public AnomalyDetectionModel getMultivariateModel(String modelId) { + // Generated convenience method for getMultivariateModelWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getMultivariateModelWithResponse(modelId, requestOptions).getValue() + .toObject(AnomalyDetectionModel.class); + } + + /** + * Detect Multivariate Anomaly + * + * Submit a multivariate anomaly detection task with the modelId value of a trained model + * and inference data. The input schema should be the same with the training + * request. The request will finish asynchronously and return a resultId value to + * query the detection result. The request should be a source link to indicate an + * externally accessible Azure Storage URI that either points to an Azure Blob + * Storage folder or points to a CSV file in Azure Blob Storage. + * + * @param modelId Model identifier. + * @param options Request of multivariate anomaly detection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return detection results for the resultId value. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public MultivariateDetectionResult detectMultivariateBatchAnomaly(String modelId, + MultivariateBatchDetectionOptions options) { + // Generated convenience method for detectMultivariateBatchAnomalyWithResponse + RequestOptions requestOptions = new RequestOptions(); + return detectMultivariateBatchAnomalyWithResponse(modelId, BinaryData.fromObject(options), requestOptions) + .getValue() + .toObject(MultivariateDetectionResult.class); + } + + /** + * Detect anomalies in the last point of the request body + * + * Submit a multivariate anomaly detection task with the modelId value of a trained model + * and inference data. The inference data should be put into the request body in + * JSON format. The request will finish synchronously and return the detection + * immediately in the response body. + * + * @param modelId Model identifier. + * @param options Request of the last detection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the last detection. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public MultivariateLastDetectionResult detectMultivariateLastAnomaly(String modelId, + MultivariateLastDetectionOptions options) { + // Generated convenience method for detectMultivariateLastAnomalyWithResponse + RequestOptions requestOptions = new RequestOptions(); + return detectMultivariateLastAnomalyWithResponse(modelId, BinaryData.fromObject(options), requestOptions) + .getValue() + .toObject(MultivariateLastDetectionResult.class); + } +} diff --git a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/UnivariateAsyncClient.java b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/UnivariateAsyncClient.java new file mode 100644 index 000000000000..3f5096cd1a9b --- /dev/null +++ b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/UnivariateAsyncClient.java @@ -0,0 +1,273 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.anomalydetector; + +import com.azure.ai.anomalydetector.implementation.UnivariatesImpl; +import com.azure.ai.anomalydetector.models.UnivariateChangePointDetectionOptions; +import com.azure.ai.anomalydetector.models.UnivariateChangePointDetectionResult; +import com.azure.ai.anomalydetector.models.UnivariateDetectionOptions; +import com.azure.ai.anomalydetector.models.UnivariateLastDetectionResult; +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.FluxUtil; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous AnomalyDetectorClient type. + */ +@ServiceClient(builder = AnomalyDetectorClientBuilder.class, isAsync = true) +public final class UnivariateAsyncClient { + + @Generated + private final UnivariatesImpl serviceClient; + + /** + * Initializes an instance of UnivariateAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + UnivariateAsyncClient(UnivariatesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * Detect anomalies for the entire series in batch. + * + * This operation generates a model with an entire series. Each point is detected + * with the same model. With this method, points before and after a certain point + * are used to determine whether it's an anomaly. The entire detection can give the + * user an overall status of the time series. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     series (Required): [
+     *          (Required){
+     *             timestamp: OffsetDateTime (Optional)
+     *             value: double (Required)
+     *         }
+     *     ]
+     *     granularity: String(yearly/monthly/weekly/daily/hourly/minutely/secondly/microsecond/none) (Optional)
+     *     customInterval: Integer (Optional)
+     *     period: Integer (Optional)
+     *     maxAnomalyRatio: Double (Optional)
+     *     sensitivity: Integer (Optional)
+     *     imputeMode: String(auto/previous/linear/fixed/zero/notFill) (Optional)
+     *     imputeFixedValue: Double (Optional)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     period: int (Required)
+     *     expectedValues (Required): [
+     *         double (Required)
+     *     ]
+     *     upperMargins (Required): [
+     *         double (Required)
+     *     ]
+     *     lowerMargins (Required): [
+     *         double (Required)
+     *     ]
+     *     isAnomaly (Required): [
+     *         boolean (Required)
+     *     ]
+     *     isNegativeAnomaly (Required): [
+     *         boolean (Required)
+     *     ]
+     *     isPositiveAnomaly (Required): [
+     *         boolean (Required)
+     *     ]
+     *     severity (Optional): [
+     *         double (Optional)
+     *     ]
+     * }
+     * }
+ * + * @param options Method of univariate anomaly detection. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response of the entire anomaly detection along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> detectUnivariateEntireSeriesWithResponse(BinaryData options, + RequestOptions requestOptions) { + return this.serviceClient.detectUnivariateEntireSeriesWithResponseAsync(options, requestOptions); + } + + /** + * Detect anomaly status of the latest point in time series. + * + * This operation generates a model by using the points that you sent in to the API + * and based on all data to determine whether the last point is anomalous. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     series (Required): [
+     *          (Required){
+     *             timestamp: OffsetDateTime (Optional)
+     *             value: double (Required)
+     *         }
+     *     ]
+     *     granularity: String(yearly/monthly/weekly/daily/hourly/minutely/secondly/microsecond/none) (Optional)
+     *     customInterval: Integer (Optional)
+     *     period: Integer (Optional)
+     *     maxAnomalyRatio: Double (Optional)
+     *     sensitivity: Integer (Optional)
+     *     imputeMode: String(auto/previous/linear/fixed/zero/notFill) (Optional)
+     *     imputeFixedValue: Double (Optional)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     period: int (Required)
+     *     suggestedWindow: int (Required)
+     *     expectedValue: double (Required)
+     *     upperMargin: double (Required)
+     *     lowerMargin: double (Required)
+     *     isAnomaly: boolean (Required)
+     *     isNegativeAnomaly: boolean (Required)
+     *     isPositiveAnomaly: boolean (Required)
+     *     severity: Double (Optional)
+     * }
+     * }
+ * + * @param options Method of univariate anomaly detection. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response of the last anomaly detection along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> detectUnivariateLastPointWithResponse(BinaryData options, + RequestOptions requestOptions) { + return this.serviceClient.detectUnivariateLastPointWithResponseAsync(options, requestOptions); + } + + /** + * Detect change point for the entire series + * + * Evaluate the change point score of every series point. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     series (Required): [
+     *          (Required){
+     *             timestamp: OffsetDateTime (Optional)
+     *             value: double (Required)
+     *         }
+     *     ]
+     *     granularity: String(yearly/monthly/weekly/daily/hourly/minutely/secondly/microsecond/none) (Required)
+     *     customInterval: Integer (Optional)
+     *     period: Integer (Optional)
+     *     stableTrendWindow: Integer (Optional)
+     *     threshold: Double (Optional)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     period: Integer (Optional)
+     *     isChangePoint (Optional): [
+     *         boolean (Optional)
+     *     ]
+     *     confidenceScores (Optional): [
+     *         double (Optional)
+     *     ]
+     * }
+     * }
+ * + * @param options Method of univariate anomaly detection. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response of change point detection along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> detectUnivariateChangePointWithResponse(BinaryData options, + RequestOptions requestOptions) { + return this.serviceClient.detectUnivariateChangePointWithResponseAsync(options, requestOptions); + } + + /** + * Detect anomaly status of the latest point in time series. + * + * This operation generates a model by using the points that you sent in to the API + * and based on all data to determine whether the last point is anomalous. + * + * @param options Method of univariate anomaly detection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of the last anomaly detection on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono detectUnivariateLastPoint(UnivariateDetectionOptions options) { + // Generated convenience method for detectUnivariateLastPointWithResponse + RequestOptions requestOptions = new RequestOptions(); + return detectUnivariateLastPointWithResponse(BinaryData.fromObject(options), requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(UnivariateLastDetectionResult.class)); + } + + /** + * Detect change point for the entire series + * + * Evaluate the change point score of every series point. + * + * @param options Method of univariate anomaly detection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of change point detection on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono + detectUnivariateChangePoint(UnivariateChangePointDetectionOptions options) { + // Generated convenience method for detectUnivariateChangePointWithResponse + RequestOptions requestOptions = new RequestOptions(); + return detectUnivariateChangePointWithResponse(BinaryData.fromObject(options), requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(UnivariateChangePointDetectionResult.class)); + } +} diff --git a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/UnivariateClient.java b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/UnivariateClient.java new file mode 100644 index 000000000000..e5be7393f27d --- /dev/null +++ b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/UnivariateClient.java @@ -0,0 +1,289 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.anomalydetector; + +import com.azure.ai.anomalydetector.implementation.UnivariatesImpl; +import com.azure.ai.anomalydetector.models.UnivariateChangePointDetectionOptions; +import com.azure.ai.anomalydetector.models.UnivariateChangePointDetectionResult; +import com.azure.ai.anomalydetector.models.UnivariateDetectionOptions; +import com.azure.ai.anomalydetector.models.UnivariateLastDetectionResult; +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.ai.anomalydetector.models.UnivariateEntireDetectionResult; + +/** + * Initializes a new instance of the synchronous AnomalyDetectorClient type. + */ +@ServiceClient(builder = AnomalyDetectorClientBuilder.class) +public final class UnivariateClient { + + @Generated + private final UnivariatesImpl serviceClient; + + /** + * Initializes an instance of UnivariateClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + UnivariateClient(UnivariatesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * Detect anomalies for the entire series in batch. + * + * This operation generates a model with an entire series. Each point is detected + * with the same model. With this method, points before and after a certain point + * are used to determine whether it's an anomaly. The entire detection can give the + * user an overall status of the time series. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     series (Required): [
+     *          (Required){
+     *             timestamp: OffsetDateTime (Optional)
+     *             value: double (Required)
+     *         }
+     *     ]
+     *     granularity: String(yearly/monthly/weekly/daily/hourly/minutely/secondly/microsecond/none) (Optional)
+     *     customInterval: Integer (Optional)
+     *     period: Integer (Optional)
+     *     maxAnomalyRatio: Double (Optional)
+     *     sensitivity: Integer (Optional)
+     *     imputeMode: String(auto/previous/linear/fixed/zero/notFill) (Optional)
+     *     imputeFixedValue: Double (Optional)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     period: int (Required)
+     *     expectedValues (Required): [
+     *         double (Required)
+     *     ]
+     *     upperMargins (Required): [
+     *         double (Required)
+     *     ]
+     *     lowerMargins (Required): [
+     *         double (Required)
+     *     ]
+     *     isAnomaly (Required): [
+     *         boolean (Required)
+     *     ]
+     *     isNegativeAnomaly (Required): [
+     *         boolean (Required)
+     *     ]
+     *     isPositiveAnomaly (Required): [
+     *         boolean (Required)
+     *     ]
+     *     severity (Optional): [
+     *         double (Optional)
+     *     ]
+     * }
+     * }
+ * + * @param options Method of univariate anomaly detection. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response of the entire anomaly detection along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response detectUnivariateEntireSeriesWithResponse(BinaryData options, + RequestOptions requestOptions) { + return this.serviceClient.detectUnivariateEntireSeriesWithResponse(options, requestOptions); + } + + /** + * Detect anomaly status of the latest point in time series. + * + * This operation generates a model by using the points that you sent in to the API + * and based on all data to determine whether the last point is anomalous. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     series (Required): [
+     *          (Required){
+     *             timestamp: OffsetDateTime (Optional)
+     *             value: double (Required)
+     *         }
+     *     ]
+     *     granularity: String(yearly/monthly/weekly/daily/hourly/minutely/secondly/microsecond/none) (Optional)
+     *     customInterval: Integer (Optional)
+     *     period: Integer (Optional)
+     *     maxAnomalyRatio: Double (Optional)
+     *     sensitivity: Integer (Optional)
+     *     imputeMode: String(auto/previous/linear/fixed/zero/notFill) (Optional)
+     *     imputeFixedValue: Double (Optional)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     period: int (Required)
+     *     suggestedWindow: int (Required)
+     *     expectedValue: double (Required)
+     *     upperMargin: double (Required)
+     *     lowerMargin: double (Required)
+     *     isAnomaly: boolean (Required)
+     *     isNegativeAnomaly: boolean (Required)
+     *     isPositiveAnomaly: boolean (Required)
+     *     severity: Double (Optional)
+     * }
+     * }
+ * + * @param options Method of univariate anomaly detection. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response of the last anomaly detection along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response detectUnivariateLastPointWithResponse(BinaryData options, + RequestOptions requestOptions) { + return this.serviceClient.detectUnivariateLastPointWithResponse(options, requestOptions); + } + + /** + * Detect change point for the entire series + * + * Evaluate the change point score of every series point. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     series (Required): [
+     *          (Required){
+     *             timestamp: OffsetDateTime (Optional)
+     *             value: double (Required)
+     *         }
+     *     ]
+     *     granularity: String(yearly/monthly/weekly/daily/hourly/minutely/secondly/microsecond/none) (Required)
+     *     customInterval: Integer (Optional)
+     *     period: Integer (Optional)
+     *     stableTrendWindow: Integer (Optional)
+     *     threshold: Double (Optional)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     period: Integer (Optional)
+     *     isChangePoint (Optional): [
+     *         boolean (Optional)
+     *     ]
+     *     confidenceScores (Optional): [
+     *         double (Optional)
+     *     ]
+     * }
+     * }
+ * + * @param options Method of univariate anomaly detection. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response of change point detection along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response detectUnivariateChangePointWithResponse(BinaryData options, + RequestOptions requestOptions) { + return this.serviceClient.detectUnivariateChangePointWithResponse(options, requestOptions); + } + + /** + * Detect anomalies for the entire series in batch. + * + * This operation generates a model with an entire series. Each point is detected + * with the same model. With this method, points before and after a certain point + * are used to determine whether it's an anomaly. The entire detection can give the + * user an overall status of the time series. + * + * @param options Method of univariate anomaly detection. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response of the entire anomaly detection along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public UnivariateEntireDetectionResult detectUnivariateEntireSeries(UnivariateDetectionOptions options) { + return detectUnivariateEntireSeriesWithResponse(BinaryData.fromObject(options), new RequestOptions()).getValue() + .toObject(UnivariateEntireDetectionResult.class); + } + + /** + * Detect anomaly status of the latest point in time series. + * + * This operation generates a model by using the points that you sent in to the API + * and based on all data to determine whether the last point is anomalous. + * + * @param options Method of univariate anomaly detection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of the last anomaly detection. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public UnivariateLastDetectionResult detectUnivariateLastPoint(UnivariateDetectionOptions options) { + // Generated convenience method for detectUnivariateLastPointWithResponse + RequestOptions requestOptions = new RequestOptions(); + return detectUnivariateLastPointWithResponse(BinaryData.fromObject(options), requestOptions).getValue() + .toObject(UnivariateLastDetectionResult.class); + } + + /** + * Detect change point for the entire series + * + * Evaluate the change point score of every series point. + * + * @param options Method of univariate anomaly detection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of change point detection. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public UnivariateChangePointDetectionResult + detectUnivariateChangePoint(UnivariateChangePointDetectionOptions options) { + // Generated convenience method for detectUnivariateChangePointWithResponse + RequestOptions requestOptions = new RequestOptions(); + return detectUnivariateChangePointWithResponse(BinaryData.fromObject(options), requestOptions).getValue() + .toObject(UnivariateChangePointDetectionResult.class); + } +} diff --git a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/implementation/AnomalyDetectorClientImpl.java b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/implementation/AnomalyDetectorClientImpl.java index c691ab0a7989..dd611410e1d8 100644 --- a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/implementation/AnomalyDetectorClientImpl.java +++ b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/implementation/AnomalyDetectorClientImpl.java @@ -1,2155 +1,148 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.anomalydetector.implementation; import com.azure.ai.anomalydetector.AnomalyDetectorServiceVersion; -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.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -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.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.policy.CookiePolicy; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.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.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; import com.azure.core.util.serializer.JacksonAdapter; import com.azure.core.util.serializer.SerializerAdapter; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; -import reactor.core.publisher.Mono; -/** Initializes a new instance of the AnomalyDetectorClient type. */ +/** + * Initializes a new instance of the AnomalyDetectorClient type. + */ public final class AnomalyDetectorClientImpl { - /** The proxy service used to perform REST calls. */ - private final AnomalyDetectorClientService service; - /** - * Supported Cognitive Services endpoints (protocol and hostname, for example: + * Supported Azure Cognitive Services endpoints (protocol and host name, such as * https://westus2.api.cognitive.microsoft.com). */ private final String endpoint; /** - * Gets Supported Cognitive Services endpoints (protocol and hostname, for example: + * Gets Supported Azure Cognitive Services endpoints (protocol and host name, such as * https://westus2.api.cognitive.microsoft.com). - * + * * @return the endpoint value. */ public String getEndpoint() { return this.endpoint; } - /** Service version. */ + /** + * Service version. + */ private final AnomalyDetectorServiceVersion serviceVersion; /** * Gets Service version. - * + * * @return the serviceVersion value. */ public AnomalyDetectorServiceVersion getServiceVersion() { return this.serviceVersion; } - /** The HTTP pipeline to send requests through. */ + /** + * The HTTP pipeline to send requests through. + */ private final HttpPipeline httpPipeline; /** * Gets The HTTP pipeline to send requests through. - * + * * @return the httpPipeline value. */ public HttpPipeline getHttpPipeline() { return this.httpPipeline; } - /** The serializer to serialize an object into a string. */ + /** + * The serializer to serialize an object into a string. + */ private final SerializerAdapter serializerAdapter; /** * Gets The serializer to serialize an object into a string. - * + * * @return the serializerAdapter value. */ public SerializerAdapter getSerializerAdapter() { return this.serializerAdapter; } + /** + * The UnivariatesImpl object to access its operations. + */ + private final UnivariatesImpl univariates; + + /** + * Gets the UnivariatesImpl object to access its operations. + * + * @return the UnivariatesImpl object. + */ + public UnivariatesImpl getUnivariates() { + return this.univariates; + } + + /** + * The MultivariatesImpl object to access its operations. + */ + private final MultivariatesImpl multivariates; + + /** + * Gets the MultivariatesImpl object to access its operations. + * + * @return the MultivariatesImpl object. + */ + public MultivariatesImpl getMultivariates() { + return this.multivariates; + } + /** * Initializes an instance of AnomalyDetectorClient client. - * - * @param endpoint Supported Cognitive Services endpoints (protocol and hostname, for example: - * https://westus2.api.cognitive.microsoft.com). + * + * @param endpoint Supported Azure Cognitive Services endpoints (protocol and host name, such as + * https://westus2.api.cognitive.microsoft.com). * @param serviceVersion Service version. */ public AnomalyDetectorClientImpl(String endpoint, AnomalyDetectorServiceVersion serviceVersion) { - this( - new HttpPipelineBuilder() - .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) - .build(), - JacksonAdapter.createDefaultSerializerAdapter(), - endpoint, - serviceVersion); + this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), + JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); } /** * Initializes an instance of AnomalyDetectorClient client. - * + * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Supported Cognitive Services endpoints (protocol and hostname, for example: - * https://westus2.api.cognitive.microsoft.com). + * @param endpoint Supported Azure Cognitive Services endpoints (protocol and host name, such as + * https://westus2.api.cognitive.microsoft.com). * @param serviceVersion Service version. */ - public AnomalyDetectorClientImpl( - HttpPipeline httpPipeline, String endpoint, AnomalyDetectorServiceVersion serviceVersion) { + public AnomalyDetectorClientImpl(HttpPipeline httpPipeline, String endpoint, + AnomalyDetectorServiceVersion serviceVersion) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); } /** * Initializes an instance of AnomalyDetectorClient client. - * + * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint Supported Cognitive Services endpoints (protocol and hostname, for example: - * https://westus2.api.cognitive.microsoft.com). + * @param endpoint Supported Azure Cognitive Services endpoints (protocol and host name, such as + * https://westus2.api.cognitive.microsoft.com). * @param serviceVersion Service version. */ - public AnomalyDetectorClientImpl( - HttpPipeline httpPipeline, - SerializerAdapter serializerAdapter, - String endpoint, - AnomalyDetectorServiceVersion serviceVersion) { + public AnomalyDetectorClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, + AnomalyDetectorServiceVersion serviceVersion) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.endpoint = endpoint; this.serviceVersion = serviceVersion; - this.service = - RestProxy.create(AnomalyDetectorClientService.class, this.httpPipeline, this.getSerializerAdapter()); - } - - /** - * The interface defining all the services for AnomalyDetectorClient to be used by the proxy service to perform REST - * calls. - */ - @Host("{Endpoint}/anomalydetector/{ApiVersion}") - @ServiceInterface(name = "AnomalyDetectorClien") - public interface AnomalyDetectorClientService { - @Post("/timeseries/entire/detect") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType( - value = ClientAuthenticationException.class, - code = {401}) - @UnexpectedResponseExceptionType( - value = ResourceNotFoundException.class, - code = {404}) - @UnexpectedResponseExceptionType( - value = ResourceModifiedException.class, - code = {409}) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> detectUnivariateEntireSeries( - @HostParam("Endpoint") String endpoint, - @HostParam("ApiVersion") String apiVersion, - @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData options, - RequestOptions requestOptions, - Context context); - - @Post("/timeseries/last/detect") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType( - value = ClientAuthenticationException.class, - code = {401}) - @UnexpectedResponseExceptionType( - value = ResourceNotFoundException.class, - code = {404}) - @UnexpectedResponseExceptionType( - value = ResourceModifiedException.class, - code = {409}) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> detectUnivariateLastPoint( - @HostParam("Endpoint") String endpoint, - @HostParam("ApiVersion") String apiVersion, - @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData options, - RequestOptions requestOptions, - Context context); - - @Post("/timeseries/changepoint/detect") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType( - value = ClientAuthenticationException.class, - code = {401}) - @UnexpectedResponseExceptionType( - value = ResourceNotFoundException.class, - code = {404}) - @UnexpectedResponseExceptionType( - value = ResourceModifiedException.class, - code = {409}) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> detectUnivariateChangePoint( - @HostParam("Endpoint") String endpoint, - @HostParam("ApiVersion") String apiVersion, - @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData options, - RequestOptions requestOptions, - Context context); - - @Get("/multivariate/detect-batch/{resultId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType( - value = ClientAuthenticationException.class, - code = {401}) - @UnexpectedResponseExceptionType( - value = ResourceNotFoundException.class, - code = {404}) - @UnexpectedResponseExceptionType( - value = ResourceModifiedException.class, - code = {409}) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getMultivariateBatchDetectionResult( - @HostParam("Endpoint") String endpoint, - @HostParam("ApiVersion") String apiVersion, - @PathParam("resultId") String resultId, - @HeaderParam("accept") String accept, - RequestOptions requestOptions, - Context context); - - @Post("/multivariate/models") - @ExpectedResponses({201}) - @UnexpectedResponseExceptionType( - value = ClientAuthenticationException.class, - code = {401}) - @UnexpectedResponseExceptionType( - value = ResourceNotFoundException.class, - code = {404}) - @UnexpectedResponseExceptionType( - value = ResourceModifiedException.class, - code = {409}) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> trainMultivariateModel( - @HostParam("Endpoint") String endpoint, - @HostParam("ApiVersion") String apiVersion, - @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData modelInfo, - RequestOptions requestOptions, - Context context); - - @Get("/multivariate/models") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType( - value = ClientAuthenticationException.class, - code = {401}) - @UnexpectedResponseExceptionType( - value = ResourceNotFoundException.class, - code = {404}) - @UnexpectedResponseExceptionType( - value = ResourceModifiedException.class, - code = {409}) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listMultivariateModels( - @HostParam("Endpoint") String endpoint, - @HostParam("ApiVersion") String apiVersion, - @HeaderParam("accept") String accept, - RequestOptions requestOptions, - Context context); - - @Delete("/multivariate/models/{modelId}") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType( - value = ClientAuthenticationException.class, - code = {401}) - @UnexpectedResponseExceptionType( - value = ResourceNotFoundException.class, - code = {404}) - @UnexpectedResponseExceptionType( - value = ResourceModifiedException.class, - code = {409}) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> deleteMultivariateModel( - @HostParam("Endpoint") String endpoint, - @HostParam("ApiVersion") String apiVersion, - @PathParam("modelId") String modelId, - @HeaderParam("accept") String accept, - RequestOptions requestOptions, - Context context); - - @Get("/multivariate/models/{modelId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType( - value = ClientAuthenticationException.class, - code = {401}) - @UnexpectedResponseExceptionType( - value = ResourceNotFoundException.class, - code = {404}) - @UnexpectedResponseExceptionType( - value = ResourceModifiedException.class, - code = {409}) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getMultivariateModel( - @HostParam("Endpoint") String endpoint, - @HostParam("ApiVersion") String apiVersion, - @PathParam("modelId") String modelId, - @HeaderParam("accept") String accept, - RequestOptions requestOptions, - Context context); - - @Post("/multivariate/models/{modelId}:detect-batch") - @ExpectedResponses({202}) - @UnexpectedResponseExceptionType( - value = ClientAuthenticationException.class, - code = {401}) - @UnexpectedResponseExceptionType( - value = ResourceNotFoundException.class, - code = {404}) - @UnexpectedResponseExceptionType( - value = ResourceModifiedException.class, - code = {409}) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> detectMultivariateBatchAnomaly( - @HostParam("Endpoint") String endpoint, - @HostParam("ApiVersion") String apiVersion, - @PathParam("modelId") String modelId, - @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData options, - RequestOptions requestOptions, - Context context); - - @Post("/multivariate/models/{modelId}:detect-last") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType( - value = ClientAuthenticationException.class, - code = {401}) - @UnexpectedResponseExceptionType( - value = ResourceNotFoundException.class, - code = {404}) - @UnexpectedResponseExceptionType( - value = ResourceModifiedException.class, - code = {409}) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> detectMultivariateLastAnomaly( - @HostParam("Endpoint") String endpoint, - @HostParam("ApiVersion") String apiVersion, - @PathParam("modelId") String modelId, - @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData options, - RequestOptions requestOptions, - Context context); - - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType( - value = ClientAuthenticationException.class, - code = {401}) - @UnexpectedResponseExceptionType( - value = ResourceNotFoundException.class, - code = {404}) - @UnexpectedResponseExceptionType( - value = ResourceModifiedException.class, - code = {409}) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listMultivariateModelsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("Endpoint") String endpoint, - @HostParam("ApiVersion") String apiVersion, - @HeaderParam("accept") String accept, - RequestOptions requestOptions, - Context context); - } - - /** - * Detect anomalies for the entire series in batch. - * - *

This operation generates a model with an entire series, each point is detected with the same model. With this - * method, points before and after a certain point are used to determine whether it is an anomaly. The entire - * detection can give user an overall status of the time series. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     series (Required): [
-     *          (Required){
-     *             timestamp: OffsetDateTime (Optional)
-     *             value: double (Required)
-     *         }
-     *     ]
-     *     granularity: String(yearly/monthly/weekly/daily/hourly/minutely/secondly/microsecond/none) (Optional)
-     *     customInterval: Integer (Optional)
-     *     period: Integer (Optional)
-     *     maxAnomalyRatio: Double (Optional)
-     *     sensitivity: Integer (Optional)
-     *     imputeMode: String(auto/previous/linear/fixed/zero/notFill) (Optional)
-     *     imputeFixedValue: Double (Optional)
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     period: int (Required)
-     *     expectedValues (Required): [
-     *         double (Required)
-     *     ]
-     *     upperMargins (Required): [
-     *         double (Required)
-     *     ]
-     *     lowerMargins (Required): [
-     *         double (Required)
-     *     ]
-     *     isAnomaly (Required): [
-     *         boolean (Required)
-     *     ]
-     *     isNegativeAnomaly (Required): [
-     *         boolean (Required)
-     *     ]
-     *     isPositiveAnomaly (Required): [
-     *         boolean (Required)
-     *     ]
-     *     severity (Optional): [
-     *         double (Optional)
-     *     ]
-     * }
-     * }
- * - * @param options Method of univariate anomaly detection. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response of entire anomaly detection along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> detectUnivariateEntireSeriesWithResponseAsync( - BinaryData options, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> - service.detectUnivariateEntireSeries( - this.getEndpoint(), - this.getServiceVersion().getVersion(), - accept, - options, - requestOptions, - context)); - } - - /** - * Detect anomalies for the entire series in batch. - * - *

This operation generates a model with an entire series, each point is detected with the same model. With this - * method, points before and after a certain point are used to determine whether it is an anomaly. The entire - * detection can give user an overall status of the time series. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     series (Required): [
-     *          (Required){
-     *             timestamp: OffsetDateTime (Optional)
-     *             value: double (Required)
-     *         }
-     *     ]
-     *     granularity: String(yearly/monthly/weekly/daily/hourly/minutely/secondly/microsecond/none) (Optional)
-     *     customInterval: Integer (Optional)
-     *     period: Integer (Optional)
-     *     maxAnomalyRatio: Double (Optional)
-     *     sensitivity: Integer (Optional)
-     *     imputeMode: String(auto/previous/linear/fixed/zero/notFill) (Optional)
-     *     imputeFixedValue: Double (Optional)
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     period: int (Required)
-     *     expectedValues (Required): [
-     *         double (Required)
-     *     ]
-     *     upperMargins (Required): [
-     *         double (Required)
-     *     ]
-     *     lowerMargins (Required): [
-     *         double (Required)
-     *     ]
-     *     isAnomaly (Required): [
-     *         boolean (Required)
-     *     ]
-     *     isNegativeAnomaly (Required): [
-     *         boolean (Required)
-     *     ]
-     *     isPositiveAnomaly (Required): [
-     *         boolean (Required)
-     *     ]
-     *     severity (Optional): [
-     *         double (Optional)
-     *     ]
-     * }
-     * }
- * - * @param options Method of univariate anomaly detection. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response of entire anomaly detection along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response detectUnivariateEntireSeriesWithResponse( - BinaryData options, RequestOptions requestOptions) { - return detectUnivariateEntireSeriesWithResponseAsync(options, requestOptions).block(); - } - - /** - * Detect anomaly status of the latest point in time series. - * - *

This operation generates a model using the points that you sent into the API, and based on all data to - * determine whether the last point is anomalous. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     series (Required): [
-     *          (Required){
-     *             timestamp: OffsetDateTime (Optional)
-     *             value: double (Required)
-     *         }
-     *     ]
-     *     granularity: String(yearly/monthly/weekly/daily/hourly/minutely/secondly/microsecond/none) (Optional)
-     *     customInterval: Integer (Optional)
-     *     period: Integer (Optional)
-     *     maxAnomalyRatio: Double (Optional)
-     *     sensitivity: Integer (Optional)
-     *     imputeMode: String(auto/previous/linear/fixed/zero/notFill) (Optional)
-     *     imputeFixedValue: Double (Optional)
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     period: int (Required)
-     *     suggestedWindow: int (Required)
-     *     expectedValue: double (Required)
-     *     upperMargin: double (Required)
-     *     lowerMargin: double (Required)
-     *     isAnomaly: boolean (Required)
-     *     isNegativeAnomaly: boolean (Required)
-     *     isPositiveAnomaly: boolean (Required)
-     *     severity: Double (Optional)
-     * }
-     * }
- * - * @param options Method of univariate anomaly detection. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response of last anomaly detection along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> detectUnivariateLastPointWithResponseAsync( - BinaryData options, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> - service.detectUnivariateLastPoint( - this.getEndpoint(), - this.getServiceVersion().getVersion(), - accept, - options, - requestOptions, - context)); - } - - /** - * Detect anomaly status of the latest point in time series. - * - *

This operation generates a model using the points that you sent into the API, and based on all data to - * determine whether the last point is anomalous. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     series (Required): [
-     *          (Required){
-     *             timestamp: OffsetDateTime (Optional)
-     *             value: double (Required)
-     *         }
-     *     ]
-     *     granularity: String(yearly/monthly/weekly/daily/hourly/minutely/secondly/microsecond/none) (Optional)
-     *     customInterval: Integer (Optional)
-     *     period: Integer (Optional)
-     *     maxAnomalyRatio: Double (Optional)
-     *     sensitivity: Integer (Optional)
-     *     imputeMode: String(auto/previous/linear/fixed/zero/notFill) (Optional)
-     *     imputeFixedValue: Double (Optional)
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     period: int (Required)
-     *     suggestedWindow: int (Required)
-     *     expectedValue: double (Required)
-     *     upperMargin: double (Required)
-     *     lowerMargin: double (Required)
-     *     isAnomaly: boolean (Required)
-     *     isNegativeAnomaly: boolean (Required)
-     *     isPositiveAnomaly: boolean (Required)
-     *     severity: Double (Optional)
-     * }
-     * }
- * - * @param options Method of univariate anomaly detection. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response of last anomaly detection along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response detectUnivariateLastPointWithResponse( - BinaryData options, RequestOptions requestOptions) { - return detectUnivariateLastPointWithResponseAsync(options, requestOptions).block(); - } - - /** - * Detect change point for the entire series - * - *

Evaluate change point score of every series point. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     series (Required): [
-     *          (Required){
-     *             timestamp: OffsetDateTime (Optional)
-     *             value: double (Required)
-     *         }
-     *     ]
-     *     granularity: String(yearly/monthly/weekly/daily/hourly/minutely/secondly/microsecond/none) (Required)
-     *     customInterval: Integer (Optional)
-     *     period: Integer (Optional)
-     *     stableTrendWindow: Integer (Optional)
-     *     threshold: Double (Optional)
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     period: Integer (Optional)
-     *     isChangePoint (Optional): [
-     *         boolean (Optional)
-     *     ]
-     *     confidenceScores (Optional): [
-     *         double (Optional)
-     *     ]
-     * }
-     * }
- * - * @param options Method of univariate anomaly detection. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response of change point detection along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> detectUnivariateChangePointWithResponseAsync( - BinaryData options, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> - service.detectUnivariateChangePoint( - this.getEndpoint(), - this.getServiceVersion().getVersion(), - accept, - options, - requestOptions, - context)); - } - - /** - * Detect change point for the entire series - * - *

Evaluate change point score of every series point. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     series (Required): [
-     *          (Required){
-     *             timestamp: OffsetDateTime (Optional)
-     *             value: double (Required)
-     *         }
-     *     ]
-     *     granularity: String(yearly/monthly/weekly/daily/hourly/minutely/secondly/microsecond/none) (Required)
-     *     customInterval: Integer (Optional)
-     *     period: Integer (Optional)
-     *     stableTrendWindow: Integer (Optional)
-     *     threshold: Double (Optional)
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     period: Integer (Optional)
-     *     isChangePoint (Optional): [
-     *         boolean (Optional)
-     *     ]
-     *     confidenceScores (Optional): [
-     *         double (Optional)
-     *     ]
-     * }
-     * }
- * - * @param options Method of univariate anomaly detection. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response of change point detection along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response detectUnivariateChangePointWithResponse( - BinaryData options, RequestOptions requestOptions) { - return detectUnivariateChangePointWithResponseAsync(options, requestOptions).block(); - } - - /** - * Get Multivariate Anomaly Detection Result - * - *

For asynchronous inference, get multivariate anomaly detection result based on resultId returned by the - * BatchDetectAnomaly api. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     resultId: String (Required)
-     *     summary (Required): {
-     *         status: String(CREATED/RUNNING/READY/FAILED) (Required)
-     *         errors (Optional): [
-     *              (Optional){
-     *                 code: String (Required)
-     *                 message: String (Required)
-     *             }
-     *         ]
-     *         variableStates (Optional): [
-     *              (Optional){
-     *                 variable: String (Optional)
-     *                 filledNARatio: Double (Optional)
-     *                 effectiveCount: Integer (Optional)
-     *                 firstTimestamp: OffsetDateTime (Optional)
-     *                 lastTimestamp: OffsetDateTime (Optional)
-     *             }
-     *         ]
-     *         setupInfo (Required): {
-     *             dataSource: String (Required)
-     *             topContributorCount: int (Required)
-     *             startTime: OffsetDateTime (Required)
-     *             endTime: OffsetDateTime (Required)
-     *         }
-     *     }
-     *     results (Required): [
-     *          (Required){
-     *             timestamp: OffsetDateTime (Required)
-     *             value (Optional): {
-     *                 isAnomaly: boolean (Required)
-     *                 severity: double (Required)
-     *                 score: double (Required)
-     *                 interpretation (Optional): [
-     *                      (Optional){
-     *                         variable: String (Optional)
-     *                         contributionScore: Double (Optional)
-     *                         correlationChanges (Optional): {
-     *                             changedVariables (Optional): [
-     *                                 String (Optional)
-     *                             ]
-     *                         }
-     *                     }
-     *                 ]
-     *             }
-     *             errors (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *     ]
-     * }
-     * }
- * - * @param resultId ID of a batch detection result. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return detection results for the given resultId along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getMultivariateBatchDetectionResultWithResponseAsync( - String resultId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> - service.getMultivariateBatchDetectionResult( - this.getEndpoint(), - this.getServiceVersion().getVersion(), - resultId, - accept, - requestOptions, - context)); - } - - /** - * Get Multivariate Anomaly Detection Result - * - *

For asynchronous inference, get multivariate anomaly detection result based on resultId returned by the - * BatchDetectAnomaly api. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     resultId: String (Required)
-     *     summary (Required): {
-     *         status: String(CREATED/RUNNING/READY/FAILED) (Required)
-     *         errors (Optional): [
-     *              (Optional){
-     *                 code: String (Required)
-     *                 message: String (Required)
-     *             }
-     *         ]
-     *         variableStates (Optional): [
-     *              (Optional){
-     *                 variable: String (Optional)
-     *                 filledNARatio: Double (Optional)
-     *                 effectiveCount: Integer (Optional)
-     *                 firstTimestamp: OffsetDateTime (Optional)
-     *                 lastTimestamp: OffsetDateTime (Optional)
-     *             }
-     *         ]
-     *         setupInfo (Required): {
-     *             dataSource: String (Required)
-     *             topContributorCount: int (Required)
-     *             startTime: OffsetDateTime (Required)
-     *             endTime: OffsetDateTime (Required)
-     *         }
-     *     }
-     *     results (Required): [
-     *          (Required){
-     *             timestamp: OffsetDateTime (Required)
-     *             value (Optional): {
-     *                 isAnomaly: boolean (Required)
-     *                 severity: double (Required)
-     *                 score: double (Required)
-     *                 interpretation (Optional): [
-     *                      (Optional){
-     *                         variable: String (Optional)
-     *                         contributionScore: Double (Optional)
-     *                         correlationChanges (Optional): {
-     *                             changedVariables (Optional): [
-     *                                 String (Optional)
-     *                             ]
-     *                         }
-     *                     }
-     *                 ]
-     *             }
-     *             errors (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *     ]
-     * }
-     * }
- * - * @param resultId ID of a batch detection result. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return detection results for the given resultId along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getMultivariateBatchDetectionResultWithResponse( - String resultId, RequestOptions requestOptions) { - return getMultivariateBatchDetectionResultWithResponseAsync(resultId, requestOptions).block(); - } - - /** - * Train a Multivariate Anomaly Detection Model - * - *

Create and train a multivariate anomaly detection model. The request must include a source parameter to - * indicate an externally accessible Azure blob storage URI.There are two types of data input: An URI pointed to an - * Azure blob storage folder which contains multiple CSV files, and each CSV file contains two columns, timestamp - * and variable. Another type of input is an URI pointed to a CSV file in Azure blob storage, which contains all the - * variables and a timestamp column. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     dataSource: String (Required)
-     *     dataSchema: String(OneTable/MultiTable) (Optional)
-     *     startTime: OffsetDateTime (Required)
-     *     endTime: OffsetDateTime (Required)
-     *     displayName: String (Optional)
-     *     slidingWindow: Integer (Optional)
-     *     alignPolicy (Optional): {
-     *         alignMode: String(Inner/Outer) (Optional)
-     *         fillNAMethod: String(Previous/Subsequent/Linear/Zero/Fixed) (Optional)
-     *         paddingValue: Double (Optional)
-     *     }
-     *     status: String(CREATED/RUNNING/READY/FAILED) (Optional)
-     *     errors (Optional): [
-     *          (Optional){
-     *             code: String (Required)
-     *             message: String (Required)
-     *         }
-     *     ]
-     *     diagnosticsInfo (Optional): {
-     *         modelState (Optional): {
-     *             epochIds (Optional): [
-     *                 int (Optional)
-     *             ]
-     *             trainLosses (Optional): [
-     *                 double (Optional)
-     *             ]
-     *             validationLosses (Optional): [
-     *                 double (Optional)
-     *             ]
-     *             latenciesInSeconds (Optional): [
-     *                 double (Optional)
-     *             ]
-     *         }
-     *         variableStates (Optional): [
-     *              (Optional){
-     *                 variable: String (Optional)
-     *                 filledNARatio: Double (Optional)
-     *                 effectiveCount: Integer (Optional)
-     *                 firstTimestamp: OffsetDateTime (Optional)
-     *                 lastTimestamp: OffsetDateTime (Optional)
-     *             }
-     *         ]
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     modelId: String (Required)
-     *     createdTime: OffsetDateTime (Required)
-     *     lastUpdatedTime: OffsetDateTime (Required)
-     *     modelInfo (Optional): {
-     *         dataSource: String (Required)
-     *         dataSchema: String(OneTable/MultiTable) (Optional)
-     *         startTime: OffsetDateTime (Required)
-     *         endTime: OffsetDateTime (Required)
-     *         displayName: String (Optional)
-     *         slidingWindow: Integer (Optional)
-     *         alignPolicy (Optional): {
-     *             alignMode: String(Inner/Outer) (Optional)
-     *             fillNAMethod: String(Previous/Subsequent/Linear/Zero/Fixed) (Optional)
-     *             paddingValue: Double (Optional)
-     *         }
-     *         status: String(CREATED/RUNNING/READY/FAILED) (Optional)
-     *         errors (Optional): [
-     *              (Optional){
-     *                 code: String (Required)
-     *                 message: String (Required)
-     *             }
-     *         ]
-     *         diagnosticsInfo (Optional): {
-     *             modelState (Optional): {
-     *                 epochIds (Optional): [
-     *                     int (Optional)
-     *                 ]
-     *                 trainLosses (Optional): [
-     *                     double (Optional)
-     *                 ]
-     *                 validationLosses (Optional): [
-     *                     double (Optional)
-     *                 ]
-     *                 latenciesInSeconds (Optional): [
-     *                     double (Optional)
-     *                 ]
-     *             }
-     *             variableStates (Optional): [
-     *                  (Optional){
-     *                     variable: String (Optional)
-     *                     filledNARatio: Double (Optional)
-     *                     effectiveCount: Integer (Optional)
-     *                     firstTimestamp: OffsetDateTime (Optional)
-     *                     lastTimestamp: OffsetDateTime (Optional)
-     *                 }
-     *             ]
-     *         }
-     *     }
-     * }
-     * }
- * - * @param modelInfo Model information. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return response of getting a model along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> trainMultivariateModelWithResponseAsync( - BinaryData modelInfo, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> - service.trainMultivariateModel( - this.getEndpoint(), - this.getServiceVersion().getVersion(), - accept, - modelInfo, - requestOptions, - context)); - } - - /** - * Train a Multivariate Anomaly Detection Model - * - *

Create and train a multivariate anomaly detection model. The request must include a source parameter to - * indicate an externally accessible Azure blob storage URI.There are two types of data input: An URI pointed to an - * Azure blob storage folder which contains multiple CSV files, and each CSV file contains two columns, timestamp - * and variable. Another type of input is an URI pointed to a CSV file in Azure blob storage, which contains all the - * variables and a timestamp column. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     dataSource: String (Required)
-     *     dataSchema: String(OneTable/MultiTable) (Optional)
-     *     startTime: OffsetDateTime (Required)
-     *     endTime: OffsetDateTime (Required)
-     *     displayName: String (Optional)
-     *     slidingWindow: Integer (Optional)
-     *     alignPolicy (Optional): {
-     *         alignMode: String(Inner/Outer) (Optional)
-     *         fillNAMethod: String(Previous/Subsequent/Linear/Zero/Fixed) (Optional)
-     *         paddingValue: Double (Optional)
-     *     }
-     *     status: String(CREATED/RUNNING/READY/FAILED) (Optional)
-     *     errors (Optional): [
-     *          (Optional){
-     *             code: String (Required)
-     *             message: String (Required)
-     *         }
-     *     ]
-     *     diagnosticsInfo (Optional): {
-     *         modelState (Optional): {
-     *             epochIds (Optional): [
-     *                 int (Optional)
-     *             ]
-     *             trainLosses (Optional): [
-     *                 double (Optional)
-     *             ]
-     *             validationLosses (Optional): [
-     *                 double (Optional)
-     *             ]
-     *             latenciesInSeconds (Optional): [
-     *                 double (Optional)
-     *             ]
-     *         }
-     *         variableStates (Optional): [
-     *              (Optional){
-     *                 variable: String (Optional)
-     *                 filledNARatio: Double (Optional)
-     *                 effectiveCount: Integer (Optional)
-     *                 firstTimestamp: OffsetDateTime (Optional)
-     *                 lastTimestamp: OffsetDateTime (Optional)
-     *             }
-     *         ]
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     modelId: String (Required)
-     *     createdTime: OffsetDateTime (Required)
-     *     lastUpdatedTime: OffsetDateTime (Required)
-     *     modelInfo (Optional): {
-     *         dataSource: String (Required)
-     *         dataSchema: String(OneTable/MultiTable) (Optional)
-     *         startTime: OffsetDateTime (Required)
-     *         endTime: OffsetDateTime (Required)
-     *         displayName: String (Optional)
-     *         slidingWindow: Integer (Optional)
-     *         alignPolicy (Optional): {
-     *             alignMode: String(Inner/Outer) (Optional)
-     *             fillNAMethod: String(Previous/Subsequent/Linear/Zero/Fixed) (Optional)
-     *             paddingValue: Double (Optional)
-     *         }
-     *         status: String(CREATED/RUNNING/READY/FAILED) (Optional)
-     *         errors (Optional): [
-     *              (Optional){
-     *                 code: String (Required)
-     *                 message: String (Required)
-     *             }
-     *         ]
-     *         diagnosticsInfo (Optional): {
-     *             modelState (Optional): {
-     *                 epochIds (Optional): [
-     *                     int (Optional)
-     *                 ]
-     *                 trainLosses (Optional): [
-     *                     double (Optional)
-     *                 ]
-     *                 validationLosses (Optional): [
-     *                     double (Optional)
-     *                 ]
-     *                 latenciesInSeconds (Optional): [
-     *                     double (Optional)
-     *                 ]
-     *             }
-     *             variableStates (Optional): [
-     *                  (Optional){
-     *                     variable: String (Optional)
-     *                     filledNARatio: Double (Optional)
-     *                     effectiveCount: Integer (Optional)
-     *                     firstTimestamp: OffsetDateTime (Optional)
-     *                     lastTimestamp: OffsetDateTime (Optional)
-     *                 }
-     *             ]
-     *         }
-     *     }
-     * }
-     * }
- * - * @param modelInfo Model information. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return response of getting a model along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response trainMultivariateModelWithResponse( - BinaryData modelInfo, RequestOptions requestOptions) { - return trainMultivariateModelWithResponseAsync(modelInfo, requestOptions).block(); - } - - /** - * List Multivariate Models - * - *

List models of a resource. - * - *

Query Parameters - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
skipIntegerNoSkip indicates how many models will be skipped.
topIntegerNoTop indicates how many models will be fetched.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     modelId: String (Required)
-     *     createdTime: OffsetDateTime (Required)
-     *     lastUpdatedTime: OffsetDateTime (Required)
-     *     modelInfo (Optional): {
-     *         dataSource: String (Required)
-     *         dataSchema: String(OneTable/MultiTable) (Optional)
-     *         startTime: OffsetDateTime (Required)
-     *         endTime: OffsetDateTime (Required)
-     *         displayName: String (Optional)
-     *         slidingWindow: Integer (Optional)
-     *         alignPolicy (Optional): {
-     *             alignMode: String(Inner/Outer) (Optional)
-     *             fillNAMethod: String(Previous/Subsequent/Linear/Zero/Fixed) (Optional)
-     *             paddingValue: Double (Optional)
-     *         }
-     *         status: String(CREATED/RUNNING/READY/FAILED) (Optional)
-     *         errors (Optional): [
-     *              (Optional){
-     *                 code: String (Required)
-     *                 message: String (Required)
-     *             }
-     *         ]
-     *         diagnosticsInfo (Optional): {
-     *             modelState (Optional): {
-     *                 epochIds (Optional): [
-     *                     int (Optional)
-     *                 ]
-     *                 trainLosses (Optional): [
-     *                     double (Optional)
-     *                 ]
-     *                 validationLosses (Optional): [
-     *                     double (Optional)
-     *                 ]
-     *                 latenciesInSeconds (Optional): [
-     *                     double (Optional)
-     *                 ]
-     *             }
-     *             variableStates (Optional): [
-     *                  (Optional){
-     *                     variable: String (Optional)
-     *                     filledNARatio: Double (Optional)
-     *                     effectiveCount: Integer (Optional)
-     *                     firstTimestamp: OffsetDateTime (Optional)
-     *                     lastTimestamp: OffsetDateTime (Optional)
-     *                 }
-     *             ]
-     *         }
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return response of listing models along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMultivariateModelsSinglePageAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> - service.listMultivariateModels( - this.getEndpoint(), - this.getServiceVersion().getVersion(), - accept, - requestOptions, - context)) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - getValues(res.getValue(), "models"), - getNextLink(res.getValue(), "nextLink"), - null)); - } - - /** - * List Multivariate Models - * - *

List models of a resource. - * - *

Query Parameters - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
skipIntegerNoSkip indicates how many models will be skipped.
topIntegerNoTop indicates how many models will be fetched.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     modelId: String (Required)
-     *     createdTime: OffsetDateTime (Required)
-     *     lastUpdatedTime: OffsetDateTime (Required)
-     *     modelInfo (Optional): {
-     *         dataSource: String (Required)
-     *         dataSchema: String(OneTable/MultiTable) (Optional)
-     *         startTime: OffsetDateTime (Required)
-     *         endTime: OffsetDateTime (Required)
-     *         displayName: String (Optional)
-     *         slidingWindow: Integer (Optional)
-     *         alignPolicy (Optional): {
-     *             alignMode: String(Inner/Outer) (Optional)
-     *             fillNAMethod: String(Previous/Subsequent/Linear/Zero/Fixed) (Optional)
-     *             paddingValue: Double (Optional)
-     *         }
-     *         status: String(CREATED/RUNNING/READY/FAILED) (Optional)
-     *         errors (Optional): [
-     *              (Optional){
-     *                 code: String (Required)
-     *                 message: String (Required)
-     *             }
-     *         ]
-     *         diagnosticsInfo (Optional): {
-     *             modelState (Optional): {
-     *                 epochIds (Optional): [
-     *                     int (Optional)
-     *                 ]
-     *                 trainLosses (Optional): [
-     *                     double (Optional)
-     *                 ]
-     *                 validationLosses (Optional): [
-     *                     double (Optional)
-     *                 ]
-     *                 latenciesInSeconds (Optional): [
-     *                     double (Optional)
-     *                 ]
-     *             }
-     *             variableStates (Optional): [
-     *                  (Optional){
-     *                     variable: String (Optional)
-     *                     filledNARatio: Double (Optional)
-     *                     effectiveCount: Integer (Optional)
-     *                     firstTimestamp: OffsetDateTime (Optional)
-     *                     lastTimestamp: OffsetDateTime (Optional)
-     *                 }
-     *             ]
-     *         }
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return response of listing models as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listMultivariateModelsAsync(RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null - ? requestOptions.getContext() - : Context.NONE); - return new PagedFlux<>( - () -> listMultivariateModelsSinglePageAsync(requestOptions), - nextLink -> listMultivariateModelsNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * List Multivariate Models - * - *

List models of a resource. - * - *

Query Parameters - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
skipIntegerNoSkip indicates how many models will be skipped.
topIntegerNoTop indicates how many models will be fetched.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     modelId: String (Required)
-     *     createdTime: OffsetDateTime (Required)
-     *     lastUpdatedTime: OffsetDateTime (Required)
-     *     modelInfo (Optional): {
-     *         dataSource: String (Required)
-     *         dataSchema: String(OneTable/MultiTable) (Optional)
-     *         startTime: OffsetDateTime (Required)
-     *         endTime: OffsetDateTime (Required)
-     *         displayName: String (Optional)
-     *         slidingWindow: Integer (Optional)
-     *         alignPolicy (Optional): {
-     *             alignMode: String(Inner/Outer) (Optional)
-     *             fillNAMethod: String(Previous/Subsequent/Linear/Zero/Fixed) (Optional)
-     *             paddingValue: Double (Optional)
-     *         }
-     *         status: String(CREATED/RUNNING/READY/FAILED) (Optional)
-     *         errors (Optional): [
-     *              (Optional){
-     *                 code: String (Required)
-     *                 message: String (Required)
-     *             }
-     *         ]
-     *         diagnosticsInfo (Optional): {
-     *             modelState (Optional): {
-     *                 epochIds (Optional): [
-     *                     int (Optional)
-     *                 ]
-     *                 trainLosses (Optional): [
-     *                     double (Optional)
-     *                 ]
-     *                 validationLosses (Optional): [
-     *                     double (Optional)
-     *                 ]
-     *                 latenciesInSeconds (Optional): [
-     *                     double (Optional)
-     *                 ]
-     *             }
-     *             variableStates (Optional): [
-     *                  (Optional){
-     *                     variable: String (Optional)
-     *                     filledNARatio: Double (Optional)
-     *                     effectiveCount: Integer (Optional)
-     *                     firstTimestamp: OffsetDateTime (Optional)
-     *                     lastTimestamp: OffsetDateTime (Optional)
-     *                 }
-     *             ]
-     *         }
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return response of listing models as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listMultivariateModels(RequestOptions requestOptions) { - return new PagedIterable<>(listMultivariateModelsAsync(requestOptions)); - } - - /** - * Delete Multivariate Model - * - *

Delete an existing multivariate model according to the modelId. - * - * @param modelId Model identifier. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteMultivariateModelWithResponseAsync( - String modelId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> - service.deleteMultivariateModel( - this.getEndpoint(), - this.getServiceVersion().getVersion(), - modelId, - accept, - requestOptions, - context)); - } - - /** - * Delete Multivariate Model - * - *

Delete an existing multivariate model according to the modelId. - * - * @param modelId Model identifier. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteMultivariateModelWithResponse(String modelId, RequestOptions requestOptions) { - return deleteMultivariateModelWithResponseAsync(modelId, requestOptions).block(); - } - - /** - * Get Multivariate Model - * - *

Get detailed information of multivariate model, including the training status and variables used in the model. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     modelId: String (Required)
-     *     createdTime: OffsetDateTime (Required)
-     *     lastUpdatedTime: OffsetDateTime (Required)
-     *     modelInfo (Optional): {
-     *         dataSource: String (Required)
-     *         dataSchema: String(OneTable/MultiTable) (Optional)
-     *         startTime: OffsetDateTime (Required)
-     *         endTime: OffsetDateTime (Required)
-     *         displayName: String (Optional)
-     *         slidingWindow: Integer (Optional)
-     *         alignPolicy (Optional): {
-     *             alignMode: String(Inner/Outer) (Optional)
-     *             fillNAMethod: String(Previous/Subsequent/Linear/Zero/Fixed) (Optional)
-     *             paddingValue: Double (Optional)
-     *         }
-     *         status: String(CREATED/RUNNING/READY/FAILED) (Optional)
-     *         errors (Optional): [
-     *              (Optional){
-     *                 code: String (Required)
-     *                 message: String (Required)
-     *             }
-     *         ]
-     *         diagnosticsInfo (Optional): {
-     *             modelState (Optional): {
-     *                 epochIds (Optional): [
-     *                     int (Optional)
-     *                 ]
-     *                 trainLosses (Optional): [
-     *                     double (Optional)
-     *                 ]
-     *                 validationLosses (Optional): [
-     *                     double (Optional)
-     *                 ]
-     *                 latenciesInSeconds (Optional): [
-     *                     double (Optional)
-     *                 ]
-     *             }
-     *             variableStates (Optional): [
-     *                  (Optional){
-     *                     variable: String (Optional)
-     *                     filledNARatio: Double (Optional)
-     *                     effectiveCount: Integer (Optional)
-     *                     firstTimestamp: OffsetDateTime (Optional)
-     *                     lastTimestamp: OffsetDateTime (Optional)
-     *                 }
-     *             ]
-     *         }
-     *     }
-     * }
-     * }
- * - * @param modelId Model identifier. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return detailed information of multivariate model, including the training status and variables used in the model - * along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getMultivariateModelWithResponseAsync( - String modelId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> - service.getMultivariateModel( - this.getEndpoint(), - this.getServiceVersion().getVersion(), - modelId, - accept, - requestOptions, - context)); - } - - /** - * Get Multivariate Model - * - *

Get detailed information of multivariate model, including the training status and variables used in the model. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     modelId: String (Required)
-     *     createdTime: OffsetDateTime (Required)
-     *     lastUpdatedTime: OffsetDateTime (Required)
-     *     modelInfo (Optional): {
-     *         dataSource: String (Required)
-     *         dataSchema: String(OneTable/MultiTable) (Optional)
-     *         startTime: OffsetDateTime (Required)
-     *         endTime: OffsetDateTime (Required)
-     *         displayName: String (Optional)
-     *         slidingWindow: Integer (Optional)
-     *         alignPolicy (Optional): {
-     *             alignMode: String(Inner/Outer) (Optional)
-     *             fillNAMethod: String(Previous/Subsequent/Linear/Zero/Fixed) (Optional)
-     *             paddingValue: Double (Optional)
-     *         }
-     *         status: String(CREATED/RUNNING/READY/FAILED) (Optional)
-     *         errors (Optional): [
-     *              (Optional){
-     *                 code: String (Required)
-     *                 message: String (Required)
-     *             }
-     *         ]
-     *         diagnosticsInfo (Optional): {
-     *             modelState (Optional): {
-     *                 epochIds (Optional): [
-     *                     int (Optional)
-     *                 ]
-     *                 trainLosses (Optional): [
-     *                     double (Optional)
-     *                 ]
-     *                 validationLosses (Optional): [
-     *                     double (Optional)
-     *                 ]
-     *                 latenciesInSeconds (Optional): [
-     *                     double (Optional)
-     *                 ]
-     *             }
-     *             variableStates (Optional): [
-     *                  (Optional){
-     *                     variable: String (Optional)
-     *                     filledNARatio: Double (Optional)
-     *                     effectiveCount: Integer (Optional)
-     *                     firstTimestamp: OffsetDateTime (Optional)
-     *                     lastTimestamp: OffsetDateTime (Optional)
-     *                 }
-     *             ]
-     *         }
-     *     }
-     * }
-     * }
- * - * @param modelId Model identifier. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return detailed information of multivariate model, including the training status and variables used in the model - * along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getMultivariateModelWithResponse(String modelId, RequestOptions requestOptions) { - return getMultivariateModelWithResponseAsync(modelId, requestOptions).block(); - } - - /** - * Detect Multivariate Anomaly - * - *

Submit multivariate anomaly detection task with the modelId of trained model and inference data, the input - * schema should be the same with the training request. The request will complete asynchronously and return a - * resultId to query the detection result.The request should be a source link to indicate an externally accessible - * Azure storage Uri, either pointed to an Azure blob storage folder, or pointed to a CSV file in Azure blob - * storage. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     dataSource: String (Required)
-     *     topContributorCount: int (Required)
-     *     startTime: OffsetDateTime (Required)
-     *     endTime: OffsetDateTime (Required)
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     resultId: String (Required)
-     *     summary (Required): {
-     *         status: String(CREATED/RUNNING/READY/FAILED) (Required)
-     *         errors (Optional): [
-     *              (Optional){
-     *                 code: String (Required)
-     *                 message: String (Required)
-     *             }
-     *         ]
-     *         variableStates (Optional): [
-     *              (Optional){
-     *                 variable: String (Optional)
-     *                 filledNARatio: Double (Optional)
-     *                 effectiveCount: Integer (Optional)
-     *                 firstTimestamp: OffsetDateTime (Optional)
-     *                 lastTimestamp: OffsetDateTime (Optional)
-     *             }
-     *         ]
-     *         setupInfo (Required): {
-     *             dataSource: String (Required)
-     *             topContributorCount: int (Required)
-     *             startTime: OffsetDateTime (Required)
-     *             endTime: OffsetDateTime (Required)
-     *         }
-     *     }
-     *     results (Required): [
-     *          (Required){
-     *             timestamp: OffsetDateTime (Required)
-     *             value (Optional): {
-     *                 isAnomaly: boolean (Required)
-     *                 severity: double (Required)
-     *                 score: double (Required)
-     *                 interpretation (Optional): [
-     *                      (Optional){
-     *                         variable: String (Optional)
-     *                         contributionScore: Double (Optional)
-     *                         correlationChanges (Optional): {
-     *                             changedVariables (Optional): [
-     *                                 String (Optional)
-     *                             ]
-     *                         }
-     *                     }
-     *                 ]
-     *             }
-     *             errors (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *     ]
-     * }
-     * }
- * - * @param modelId Model identifier. - * @param options Request of multivariate anomaly detection. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return detection results for the given resultId along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> detectMultivariateBatchAnomalyWithResponseAsync( - String modelId, BinaryData options, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> - service.detectMultivariateBatchAnomaly( - this.getEndpoint(), - this.getServiceVersion().getVersion(), - modelId, - accept, - options, - requestOptions, - context)); - } - - /** - * Detect Multivariate Anomaly - * - *

Submit multivariate anomaly detection task with the modelId of trained model and inference data, the input - * schema should be the same with the training request. The request will complete asynchronously and return a - * resultId to query the detection result.The request should be a source link to indicate an externally accessible - * Azure storage Uri, either pointed to an Azure blob storage folder, or pointed to a CSV file in Azure blob - * storage. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     dataSource: String (Required)
-     *     topContributorCount: int (Required)
-     *     startTime: OffsetDateTime (Required)
-     *     endTime: OffsetDateTime (Required)
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     resultId: String (Required)
-     *     summary (Required): {
-     *         status: String(CREATED/RUNNING/READY/FAILED) (Required)
-     *         errors (Optional): [
-     *              (Optional){
-     *                 code: String (Required)
-     *                 message: String (Required)
-     *             }
-     *         ]
-     *         variableStates (Optional): [
-     *              (Optional){
-     *                 variable: String (Optional)
-     *                 filledNARatio: Double (Optional)
-     *                 effectiveCount: Integer (Optional)
-     *                 firstTimestamp: OffsetDateTime (Optional)
-     *                 lastTimestamp: OffsetDateTime (Optional)
-     *             }
-     *         ]
-     *         setupInfo (Required): {
-     *             dataSource: String (Required)
-     *             topContributorCount: int (Required)
-     *             startTime: OffsetDateTime (Required)
-     *             endTime: OffsetDateTime (Required)
-     *         }
-     *     }
-     *     results (Required): [
-     *          (Required){
-     *             timestamp: OffsetDateTime (Required)
-     *             value (Optional): {
-     *                 isAnomaly: boolean (Required)
-     *                 severity: double (Required)
-     *                 score: double (Required)
-     *                 interpretation (Optional): [
-     *                      (Optional){
-     *                         variable: String (Optional)
-     *                         contributionScore: Double (Optional)
-     *                         correlationChanges (Optional): {
-     *                             changedVariables (Optional): [
-     *                                 String (Optional)
-     *                             ]
-     *                         }
-     *                     }
-     *                 ]
-     *             }
-     *             errors (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *     ]
-     * }
-     * }
- * - * @param modelId Model identifier. - * @param options Request of multivariate anomaly detection. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return detection results for the given resultId along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response detectMultivariateBatchAnomalyWithResponse( - String modelId, BinaryData options, RequestOptions requestOptions) { - return detectMultivariateBatchAnomalyWithResponseAsync(modelId, options, requestOptions).block(); - } - - /** - * Detect anomalies in the last point of the request body - * - *

Submit multivariate anomaly detection task with the modelId of trained model and inference data, and the - * inference data should be put into request body in a JSON format. The request will complete synchronously and - * return the detection immediately in the response body. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     variables (Required): [
-     *          (Required){
-     *             variable: String (Required)
-     *             timestamps (Required): [
-     *                 String (Required)
-     *             ]
-     *             values (Required): [
-     *                 double (Required)
-     *             ]
-     *         }
-     *     ]
-     *     topContributorCount: int (Required)
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     variableStates (Optional): [
-     *          (Optional){
-     *             variable: String (Optional)
-     *             filledNARatio: Double (Optional)
-     *             effectiveCount: Integer (Optional)
-     *             firstTimestamp: OffsetDateTime (Optional)
-     *             lastTimestamp: OffsetDateTime (Optional)
-     *         }
-     *     ]
-     *     results (Optional): [
-     *          (Optional){
-     *             timestamp: OffsetDateTime (Required)
-     *             value (Optional): {
-     *                 isAnomaly: boolean (Required)
-     *                 severity: double (Required)
-     *                 score: double (Required)
-     *                 interpretation (Optional): [
-     *                      (Optional){
-     *                         variable: String (Optional)
-     *                         contributionScore: Double (Optional)
-     *                         correlationChanges (Optional): {
-     *                             changedVariables (Optional): [
-     *                                 String (Optional)
-     *                             ]
-     *                         }
-     *                     }
-     *                 ]
-     *             }
-     *             errors (Optional): [
-     *                  (Optional){
-     *                     code: String (Required)
-     *                     message: String (Required)
-     *                 }
-     *             ]
-     *         }
-     *     ]
-     * }
-     * }
- * - * @param modelId Model identifier. - * @param options Request of last detection. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return results of last detection along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> detectMultivariateLastAnomalyWithResponseAsync( - String modelId, BinaryData options, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> - service.detectMultivariateLastAnomaly( - this.getEndpoint(), - this.getServiceVersion().getVersion(), - modelId, - accept, - options, - requestOptions, - context)); - } - - /** - * Detect anomalies in the last point of the request body - * - *

Submit multivariate anomaly detection task with the modelId of trained model and inference data, and the - * inference data should be put into request body in a JSON format. The request will complete synchronously and - * return the detection immediately in the response body. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     variables (Required): [
-     *          (Required){
-     *             variable: String (Required)
-     *             timestamps (Required): [
-     *                 String (Required)
-     *             ]
-     *             values (Required): [
-     *                 double (Required)
-     *             ]
-     *         }
-     *     ]
-     *     topContributorCount: int (Required)
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     variableStates (Optional): [
-     *          (Optional){
-     *             variable: String (Optional)
-     *             filledNARatio: Double (Optional)
-     *             effectiveCount: Integer (Optional)
-     *             firstTimestamp: OffsetDateTime (Optional)
-     *             lastTimestamp: OffsetDateTime (Optional)
-     *         }
-     *     ]
-     *     results (Optional): [
-     *          (Optional){
-     *             timestamp: OffsetDateTime (Required)
-     *             value (Optional): {
-     *                 isAnomaly: boolean (Required)
-     *                 severity: double (Required)
-     *                 score: double (Required)
-     *                 interpretation (Optional): [
-     *                      (Optional){
-     *                         variable: String (Optional)
-     *                         contributionScore: Double (Optional)
-     *                         correlationChanges (Optional): {
-     *                             changedVariables (Optional): [
-     *                                 String (Optional)
-     *                             ]
-     *                         }
-     *                     }
-     *                 ]
-     *             }
-     *             errors (Optional): [
-     *                  (Optional){
-     *                     code: String (Required)
-     *                     message: String (Required)
-     *                 }
-     *             ]
-     *         }
-     *     ]
-     * }
-     * }
- * - * @param modelId Model identifier. - * @param options Request of last detection. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return results of last detection along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response detectMultivariateLastAnomalyWithResponse( - String modelId, BinaryData options, RequestOptions requestOptions) { - return detectMultivariateLastAnomalyWithResponseAsync(modelId, options, requestOptions).block(); - } - - /** - * List Multivariate Models - * - *

Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     modelId: String (Required)
-     *     createdTime: OffsetDateTime (Required)
-     *     lastUpdatedTime: OffsetDateTime (Required)
-     *     modelInfo (Optional): {
-     *         dataSource: String (Required)
-     *         dataSchema: String(OneTable/MultiTable) (Optional)
-     *         startTime: OffsetDateTime (Required)
-     *         endTime: OffsetDateTime (Required)
-     *         displayName: String (Optional)
-     *         slidingWindow: Integer (Optional)
-     *         alignPolicy (Optional): {
-     *             alignMode: String(Inner/Outer) (Optional)
-     *             fillNAMethod: String(Previous/Subsequent/Linear/Zero/Fixed) (Optional)
-     *             paddingValue: Double (Optional)
-     *         }
-     *         status: String(CREATED/RUNNING/READY/FAILED) (Optional)
-     *         errors (Optional): [
-     *              (Optional){
-     *                 code: String (Required)
-     *                 message: String (Required)
-     *             }
-     *         ]
-     *         diagnosticsInfo (Optional): {
-     *             modelState (Optional): {
-     *                 epochIds (Optional): [
-     *                     int (Optional)
-     *                 ]
-     *                 trainLosses (Optional): [
-     *                     double (Optional)
-     *                 ]
-     *                 validationLosses (Optional): [
-     *                     double (Optional)
-     *                 ]
-     *                 latenciesInSeconds (Optional): [
-     *                     double (Optional)
-     *                 ]
-     *             }
-     *             variableStates (Optional): [
-     *                  (Optional){
-     *                     variable: String (Optional)
-     *                     filledNARatio: Double (Optional)
-     *                     effectiveCount: Integer (Optional)
-     *                     firstTimestamp: OffsetDateTime (Optional)
-     *                     lastTimestamp: OffsetDateTime (Optional)
-     *                 }
-     *             ]
-     *         }
-     *     }
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return response of listing models along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMultivariateModelsNextSinglePageAsync( - String nextLink, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> - service.listMultivariateModelsNext( - nextLink, - this.getEndpoint(), - this.getServiceVersion().getVersion(), - accept, - requestOptions, - context)) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - getValues(res.getValue(), "models"), - getNextLink(res.getValue(), "nextLink"), - null)); - } - - private List getValues(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - List values = (List) obj.get(path); - return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); - } catch (RuntimeException e) { - return null; - } - } - - private String getNextLink(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - return (String) obj.get(path); - } catch (RuntimeException e) { - return null; - } + this.univariates = new UnivariatesImpl(this); + this.multivariates = new MultivariatesImpl(this); } } diff --git a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/implementation/MultivariatesImpl.java b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/implementation/MultivariatesImpl.java new file mode 100644 index 000000000000..fed17c323906 --- /dev/null +++ b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/implementation/MultivariatesImpl.java @@ -0,0 +1,1734 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.anomalydetector.implementation; + +import com.azure.ai.anomalydetector.AnomalyDetectorServiceVersion; +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.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +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.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +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.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in Multivariates. + */ +public final class MultivariatesImpl { + /** + * The proxy service used to perform REST calls. + */ + private final MultivariatesService service; + + /** + * The service client containing this operation class. + */ + private final AnomalyDetectorClientImpl client; + + /** + * Initializes an instance of MultivariatesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + MultivariatesImpl(AnomalyDetectorClientImpl client) { + this.service + = RestProxy.create(MultivariatesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * Gets Service version. + * + * @return the serviceVersion value. + */ + public AnomalyDetectorServiceVersion getServiceVersion() { + return client.getServiceVersion(); + } + + /** + * The interface defining all the services for AnomalyDetectorClientMultivariates to be used by the proxy service to + * perform REST calls. + */ + @Host("{Endpoint}/anomalydetector/{ApiVersion}") + @ServiceInterface(name = "AnomalyDetectorClien") + public interface MultivariatesService { + @Get("/multivariate/detect-batch/{resultId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getMultivariateBatchDetectionResult(@HostParam("Endpoint") String endpoint, + @HostParam("ApiVersion") String apiVersion, @PathParam("resultId") String resultId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/multivariate/detect-batch/{resultId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getMultivariateBatchDetectionResultSync(@HostParam("Endpoint") String endpoint, + @HostParam("ApiVersion") String apiVersion, @PathParam("resultId") String resultId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Post("/multivariate/models") + @ExpectedResponses({ 201 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> trainMultivariateModel(@HostParam("Endpoint") String endpoint, + @HostParam("ApiVersion") String apiVersion, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData modelInfo, RequestOptions requestOptions, Context context); + + @Post("/multivariate/models") + @ExpectedResponses({ 201 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response trainMultivariateModelSync(@HostParam("Endpoint") String endpoint, + @HostParam("ApiVersion") String apiVersion, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData modelInfo, RequestOptions requestOptions, Context context); + + @Get("/multivariate/models") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listMultivariateModels(@HostParam("Endpoint") String endpoint, + @HostParam("ApiVersion") String apiVersion, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/multivariate/models") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response listMultivariateModelsSync(@HostParam("Endpoint") String endpoint, + @HostParam("ApiVersion") String apiVersion, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); + + @Delete("/multivariate/models/{modelId}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteMultivariateModel(@HostParam("Endpoint") String endpoint, + @HostParam("ApiVersion") String apiVersion, @PathParam("modelId") String modelId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Delete("/multivariate/models/{modelId}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deleteMultivariateModelSync(@HostParam("Endpoint") String endpoint, + @HostParam("ApiVersion") String apiVersion, @PathParam("modelId") String modelId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/multivariate/models/{modelId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getMultivariateModel(@HostParam("Endpoint") String endpoint, + @HostParam("ApiVersion") String apiVersion, @PathParam("modelId") String modelId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/multivariate/models/{modelId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getMultivariateModelSync(@HostParam("Endpoint") String endpoint, + @HostParam("ApiVersion") String apiVersion, @PathParam("modelId") String modelId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Post("/multivariate/models/{modelId}:detect-batch") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> detectMultivariateBatchAnomaly(@HostParam("Endpoint") String endpoint, + @HostParam("ApiVersion") String apiVersion, @PathParam("modelId") String modelId, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData options, + RequestOptions requestOptions, Context context); + + @Post("/multivariate/models/{modelId}:detect-batch") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response detectMultivariateBatchAnomalySync(@HostParam("Endpoint") String endpoint, + @HostParam("ApiVersion") String apiVersion, @PathParam("modelId") String modelId, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData options, + RequestOptions requestOptions, Context context); + + @Post("/multivariate/models/{modelId}:detect-last") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> detectMultivariateLastAnomaly(@HostParam("Endpoint") String endpoint, + @HostParam("ApiVersion") String apiVersion, @PathParam("modelId") String modelId, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData options, + RequestOptions requestOptions, Context context); + + @Post("/multivariate/models/{modelId}:detect-last") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response detectMultivariateLastAnomalySync(@HostParam("Endpoint") String endpoint, + @HostParam("ApiVersion") String apiVersion, @PathParam("modelId") String modelId, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData options, + RequestOptions requestOptions, Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listMultivariateModelsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("Endpoint") String endpoint, + @HostParam("ApiVersion") String apiVersion, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response listMultivariateModelsNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("Endpoint") String endpoint, + @HostParam("ApiVersion") String apiVersion, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); + } + + /** + * Get Multivariate Anomaly Detection Result + * + * For asynchronous inference, get a multivariate anomaly detection result based on the + * resultId value that the BatchDetectAnomaly API returns. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     resultId: String (Required)
+     *     summary (Required): {
+     *         status: String(CREATED/RUNNING/READY/FAILED) (Required)
+     *         errors (Optional): [
+     *              (Optional){
+     *                 code: String (Required)
+     *                 message: String (Required)
+     *             }
+     *         ]
+     *         variableStates (Optional): [
+     *              (Optional){
+     *                 variable: String (Optional)
+     *                 filledNARatio: Double (Optional)
+     *                 effectiveCount: Integer (Optional)
+     *                 firstTimestamp: OffsetDateTime (Optional)
+     *                 lastTimestamp: OffsetDateTime (Optional)
+     *             }
+     *         ]
+     *         setupInfo (Required): {
+     *             dataSource: String (Required)
+     *             topContributorCount: Integer (Optional)
+     *             startTime: OffsetDateTime (Required)
+     *             endTime: OffsetDateTime (Required)
+     *         }
+     *     }
+     *     results (Required): [
+     *          (Required){
+     *             timestamp: OffsetDateTime (Required)
+     *             value (Optional): {
+     *                 isAnomaly: boolean (Required)
+     *                 severity: double (Required)
+     *                 score: double (Required)
+     *                 interpretation (Optional): [
+     *                      (Optional){
+     *                         variable: String (Optional)
+     *                         contributionScore: Double (Optional)
+     *                         correlationChanges (Optional): {
+     *                             changedVariables (Optional): [
+     *                                 String (Optional)
+     *                             ]
+     *                         }
+     *                     }
+     *                 ]
+     *             }
+     *             errors (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param resultId ID of a batch detection result. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return detection results for the resultId value along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getMultivariateBatchDetectionResultWithResponseAsync(String resultId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getMultivariateBatchDetectionResult(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), resultId, accept, requestOptions, context)); + } + + /** + * Get Multivariate Anomaly Detection Result + * + * For asynchronous inference, get a multivariate anomaly detection result based on the + * resultId value that the BatchDetectAnomaly API returns. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     resultId: String (Required)
+     *     summary (Required): {
+     *         status: String(CREATED/RUNNING/READY/FAILED) (Required)
+     *         errors (Optional): [
+     *              (Optional){
+     *                 code: String (Required)
+     *                 message: String (Required)
+     *             }
+     *         ]
+     *         variableStates (Optional): [
+     *              (Optional){
+     *                 variable: String (Optional)
+     *                 filledNARatio: Double (Optional)
+     *                 effectiveCount: Integer (Optional)
+     *                 firstTimestamp: OffsetDateTime (Optional)
+     *                 lastTimestamp: OffsetDateTime (Optional)
+     *             }
+     *         ]
+     *         setupInfo (Required): {
+     *             dataSource: String (Required)
+     *             topContributorCount: Integer (Optional)
+     *             startTime: OffsetDateTime (Required)
+     *             endTime: OffsetDateTime (Required)
+     *         }
+     *     }
+     *     results (Required): [
+     *          (Required){
+     *             timestamp: OffsetDateTime (Required)
+     *             value (Optional): {
+     *                 isAnomaly: boolean (Required)
+     *                 severity: double (Required)
+     *                 score: double (Required)
+     *                 interpretation (Optional): [
+     *                      (Optional){
+     *                         variable: String (Optional)
+     *                         contributionScore: Double (Optional)
+     *                         correlationChanges (Optional): {
+     *                             changedVariables (Optional): [
+     *                                 String (Optional)
+     *                             ]
+     *                         }
+     *                     }
+     *                 ]
+     *             }
+     *             errors (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param resultId ID of a batch detection result. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return detection results for the resultId value along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getMultivariateBatchDetectionResultWithResponse(String resultId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getMultivariateBatchDetectionResultSync(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), resultId, accept, requestOptions, Context.NONE); + } + + /** + * Train a Multivariate Anomaly Detection Model + * + * Create and train a multivariate anomaly detection model. The request must + * include a source parameter to indicate an Azure Blob + * Storage URI that's accessible to the service. There are two types of data input. The Blob Storage URI can point + * to an Azure Blob + * Storage folder that contains multiple CSV files, where each CSV file has + * two columns, time stamp and variable. Or the Blob Storage URI can point to a single blob that contains a CSV file + * that has all the variables and a + * time stamp column. + * The model object will be created and returned in the response, but the + * training process happens asynchronously. To check the training status, call + * GetMultivariateModel with the modelId value and check the status field in the + * modelInfo object. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     dataSource: String (Required)
+     *     dataSchema: String(OneTable/MultiTable) (Optional)
+     *     startTime: OffsetDateTime (Required)
+     *     endTime: OffsetDateTime (Required)
+     *     displayName: String (Optional)
+     *     slidingWindow: Integer (Optional)
+     *     alignPolicy (Optional): {
+     *         alignMode: String(Inner/Outer) (Optional)
+     *         fillNAMethod: String(Previous/Subsequent/Linear/Zero/Fixed) (Optional)
+     *         paddingValue: Double (Optional)
+     *     }
+     *     status: String(CREATED/RUNNING/READY/FAILED) (Optional)
+     *     errors (Optional): [
+     *          (Optional){
+     *             code: String (Required)
+     *             message: String (Required)
+     *         }
+     *     ]
+     *     diagnosticsInfo (Optional): {
+     *         modelState (Optional): {
+     *             epochIds (Optional): [
+     *                 int (Optional)
+     *             ]
+     *             trainLosses (Optional): [
+     *                 double (Optional)
+     *             ]
+     *             validationLosses (Optional): [
+     *                 double (Optional)
+     *             ]
+     *             latenciesInSeconds (Optional): [
+     *                 double (Optional)
+     *             ]
+     *         }
+     *         variableStates (Optional): [
+     *              (Optional){
+     *                 variable: String (Optional)
+     *                 filledNARatio: Double (Optional)
+     *                 effectiveCount: Integer (Optional)
+     *                 firstTimestamp: OffsetDateTime (Optional)
+     *                 lastTimestamp: OffsetDateTime (Optional)
+     *             }
+     *         ]
+     *     }
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     modelId: String (Required)
+     *     createdTime: OffsetDateTime (Required)
+     *     lastUpdatedTime: OffsetDateTime (Required)
+     *     modelInfo (Optional): {
+     *         dataSource: String (Required)
+     *         dataSchema: String(OneTable/MultiTable) (Optional)
+     *         startTime: OffsetDateTime (Required)
+     *         endTime: OffsetDateTime (Required)
+     *         displayName: String (Optional)
+     *         slidingWindow: Integer (Optional)
+     *         alignPolicy (Optional): {
+     *             alignMode: String(Inner/Outer) (Optional)
+     *             fillNAMethod: String(Previous/Subsequent/Linear/Zero/Fixed) (Optional)
+     *             paddingValue: Double (Optional)
+     *         }
+     *         status: String(CREATED/RUNNING/READY/FAILED) (Optional)
+     *         errors (Optional): [
+     *              (Optional){
+     *                 code: String (Required)
+     *                 message: String (Required)
+     *             }
+     *         ]
+     *         diagnosticsInfo (Optional): {
+     *             modelState (Optional): {
+     *                 epochIds (Optional): [
+     *                     int (Optional)
+     *                 ]
+     *                 trainLosses (Optional): [
+     *                     double (Optional)
+     *                 ]
+     *                 validationLosses (Optional): [
+     *                     double (Optional)
+     *                 ]
+     *                 latenciesInSeconds (Optional): [
+     *                     double (Optional)
+     *                 ]
+     *             }
+     *             variableStates (Optional): [
+     *                  (Optional){
+     *                     variable: String (Optional)
+     *                     filledNARatio: Double (Optional)
+     *                     effectiveCount: Integer (Optional)
+     *                     firstTimestamp: OffsetDateTime (Optional)
+     *                     lastTimestamp: OffsetDateTime (Optional)
+     *                 }
+     *             ]
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param modelInfo Model information. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response of getting a model along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> trainMultivariateModelWithResponseAsync(BinaryData modelInfo, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.trainMultivariateModel(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), accept, modelInfo, requestOptions, context)); + } + + /** + * Train a Multivariate Anomaly Detection Model + * + * Create and train a multivariate anomaly detection model. The request must + * include a source parameter to indicate an Azure Blob + * Storage URI that's accessible to the service. There are two types of data input. The Blob Storage URI can point + * to an Azure Blob + * Storage folder that contains multiple CSV files, where each CSV file has + * two columns, time stamp and variable. Or the Blob Storage URI can point to a single blob that contains a CSV file + * that has all the variables and a + * time stamp column. + * The model object will be created and returned in the response, but the + * training process happens asynchronously. To check the training status, call + * GetMultivariateModel with the modelId value and check the status field in the + * modelInfo object. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     dataSource: String (Required)
+     *     dataSchema: String(OneTable/MultiTable) (Optional)
+     *     startTime: OffsetDateTime (Required)
+     *     endTime: OffsetDateTime (Required)
+     *     displayName: String (Optional)
+     *     slidingWindow: Integer (Optional)
+     *     alignPolicy (Optional): {
+     *         alignMode: String(Inner/Outer) (Optional)
+     *         fillNAMethod: String(Previous/Subsequent/Linear/Zero/Fixed) (Optional)
+     *         paddingValue: Double (Optional)
+     *     }
+     *     status: String(CREATED/RUNNING/READY/FAILED) (Optional)
+     *     errors (Optional): [
+     *          (Optional){
+     *             code: String (Required)
+     *             message: String (Required)
+     *         }
+     *     ]
+     *     diagnosticsInfo (Optional): {
+     *         modelState (Optional): {
+     *             epochIds (Optional): [
+     *                 int (Optional)
+     *             ]
+     *             trainLosses (Optional): [
+     *                 double (Optional)
+     *             ]
+     *             validationLosses (Optional): [
+     *                 double (Optional)
+     *             ]
+     *             latenciesInSeconds (Optional): [
+     *                 double (Optional)
+     *             ]
+     *         }
+     *         variableStates (Optional): [
+     *              (Optional){
+     *                 variable: String (Optional)
+     *                 filledNARatio: Double (Optional)
+     *                 effectiveCount: Integer (Optional)
+     *                 firstTimestamp: OffsetDateTime (Optional)
+     *                 lastTimestamp: OffsetDateTime (Optional)
+     *             }
+     *         ]
+     *     }
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     modelId: String (Required)
+     *     createdTime: OffsetDateTime (Required)
+     *     lastUpdatedTime: OffsetDateTime (Required)
+     *     modelInfo (Optional): {
+     *         dataSource: String (Required)
+     *         dataSchema: String(OneTable/MultiTable) (Optional)
+     *         startTime: OffsetDateTime (Required)
+     *         endTime: OffsetDateTime (Required)
+     *         displayName: String (Optional)
+     *         slidingWindow: Integer (Optional)
+     *         alignPolicy (Optional): {
+     *             alignMode: String(Inner/Outer) (Optional)
+     *             fillNAMethod: String(Previous/Subsequent/Linear/Zero/Fixed) (Optional)
+     *             paddingValue: Double (Optional)
+     *         }
+     *         status: String(CREATED/RUNNING/READY/FAILED) (Optional)
+     *         errors (Optional): [
+     *              (Optional){
+     *                 code: String (Required)
+     *                 message: String (Required)
+     *             }
+     *         ]
+     *         diagnosticsInfo (Optional): {
+     *             modelState (Optional): {
+     *                 epochIds (Optional): [
+     *                     int (Optional)
+     *                 ]
+     *                 trainLosses (Optional): [
+     *                     double (Optional)
+     *                 ]
+     *                 validationLosses (Optional): [
+     *                     double (Optional)
+     *                 ]
+     *                 latenciesInSeconds (Optional): [
+     *                     double (Optional)
+     *                 ]
+     *             }
+     *             variableStates (Optional): [
+     *                  (Optional){
+     *                     variable: String (Optional)
+     *                     filledNARatio: Double (Optional)
+     *                     effectiveCount: Integer (Optional)
+     *                     firstTimestamp: OffsetDateTime (Optional)
+     *                     lastTimestamp: OffsetDateTime (Optional)
+     *                 }
+     *             ]
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param modelInfo Model information. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response of getting a model along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response trainMultivariateModelWithResponse(BinaryData modelInfo, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.trainMultivariateModelSync(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), accept, modelInfo, requestOptions, Context.NONE); + } + + /** + * List Multivariate Models + * + * List models of a resource. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
skipIntegerNoThe number of result items to skip.
topIntegerNoThe number of result items to return.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     modelId: String (Required)
+     *     createdTime: OffsetDateTime (Required)
+     *     lastUpdatedTime: OffsetDateTime (Required)
+     *     modelInfo (Optional): {
+     *         dataSource: String (Required)
+     *         dataSchema: String(OneTable/MultiTable) (Optional)
+     *         startTime: OffsetDateTime (Required)
+     *         endTime: OffsetDateTime (Required)
+     *         displayName: String (Optional)
+     *         slidingWindow: Integer (Optional)
+     *         alignPolicy (Optional): {
+     *             alignMode: String(Inner/Outer) (Optional)
+     *             fillNAMethod: String(Previous/Subsequent/Linear/Zero/Fixed) (Optional)
+     *             paddingValue: Double (Optional)
+     *         }
+     *         status: String(CREATED/RUNNING/READY/FAILED) (Optional)
+     *         errors (Optional): [
+     *              (Optional){
+     *                 code: String (Required)
+     *                 message: String (Required)
+     *             }
+     *         ]
+     *         diagnosticsInfo (Optional): {
+     *             modelState (Optional): {
+     *                 epochIds (Optional): [
+     *                     int (Optional)
+     *                 ]
+     *                 trainLosses (Optional): [
+     *                     double (Optional)
+     *                 ]
+     *                 validationLosses (Optional): [
+     *                     double (Optional)
+     *                 ]
+     *                 latenciesInSeconds (Optional): [
+     *                     double (Optional)
+     *                 ]
+     *             }
+     *             variableStates (Optional): [
+     *                  (Optional){
+     *                     variable: String (Optional)
+     *                     filledNARatio: Double (Optional)
+     *                     effectiveCount: Integer (Optional)
+     *                     firstTimestamp: OffsetDateTime (Optional)
+     *                     lastTimestamp: OffsetDateTime (Optional)
+     *                 }
+     *             ]
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response of listing models along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listMultivariateModelsSinglePageAsync(RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listMultivariateModels(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "models"), getNextLink(res.getValue(), "nextLink"), null)); + } + + /** + * List Multivariate Models + * + * List models of a resource. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
skipIntegerNoThe number of result items to skip.
topIntegerNoThe number of result items to return.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     modelId: String (Required)
+     *     createdTime: OffsetDateTime (Required)
+     *     lastUpdatedTime: OffsetDateTime (Required)
+     *     modelInfo (Optional): {
+     *         dataSource: String (Required)
+     *         dataSchema: String(OneTable/MultiTable) (Optional)
+     *         startTime: OffsetDateTime (Required)
+     *         endTime: OffsetDateTime (Required)
+     *         displayName: String (Optional)
+     *         slidingWindow: Integer (Optional)
+     *         alignPolicy (Optional): {
+     *             alignMode: String(Inner/Outer) (Optional)
+     *             fillNAMethod: String(Previous/Subsequent/Linear/Zero/Fixed) (Optional)
+     *             paddingValue: Double (Optional)
+     *         }
+     *         status: String(CREATED/RUNNING/READY/FAILED) (Optional)
+     *         errors (Optional): [
+     *              (Optional){
+     *                 code: String (Required)
+     *                 message: String (Required)
+     *             }
+     *         ]
+     *         diagnosticsInfo (Optional): {
+     *             modelState (Optional): {
+     *                 epochIds (Optional): [
+     *                     int (Optional)
+     *                 ]
+     *                 trainLosses (Optional): [
+     *                     double (Optional)
+     *                 ]
+     *                 validationLosses (Optional): [
+     *                     double (Optional)
+     *                 ]
+     *                 latenciesInSeconds (Optional): [
+     *                     double (Optional)
+     *                 ]
+     *             }
+     *             variableStates (Optional): [
+     *                  (Optional){
+     *                     variable: String (Optional)
+     *                     filledNARatio: Double (Optional)
+     *                     effectiveCount: Integer (Optional)
+     *                     firstTimestamp: OffsetDateTime (Optional)
+     *                     lastTimestamp: OffsetDateTime (Optional)
+     *                 }
+     *             ]
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response of listing models as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listMultivariateModelsAsync(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedFlux<>(() -> listMultivariateModelsSinglePageAsync(requestOptions), + nextLink -> listMultivariateModelsNextSinglePageAsync(nextLink, requestOptionsForNextPage)); + } + + /** + * List Multivariate Models + * + * List models of a resource. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
skipIntegerNoThe number of result items to skip.
topIntegerNoThe number of result items to return.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     modelId: String (Required)
+     *     createdTime: OffsetDateTime (Required)
+     *     lastUpdatedTime: OffsetDateTime (Required)
+     *     modelInfo (Optional): {
+     *         dataSource: String (Required)
+     *         dataSchema: String(OneTable/MultiTable) (Optional)
+     *         startTime: OffsetDateTime (Required)
+     *         endTime: OffsetDateTime (Required)
+     *         displayName: String (Optional)
+     *         slidingWindow: Integer (Optional)
+     *         alignPolicy (Optional): {
+     *             alignMode: String(Inner/Outer) (Optional)
+     *             fillNAMethod: String(Previous/Subsequent/Linear/Zero/Fixed) (Optional)
+     *             paddingValue: Double (Optional)
+     *         }
+     *         status: String(CREATED/RUNNING/READY/FAILED) (Optional)
+     *         errors (Optional): [
+     *              (Optional){
+     *                 code: String (Required)
+     *                 message: String (Required)
+     *             }
+     *         ]
+     *         diagnosticsInfo (Optional): {
+     *             modelState (Optional): {
+     *                 epochIds (Optional): [
+     *                     int (Optional)
+     *                 ]
+     *                 trainLosses (Optional): [
+     *                     double (Optional)
+     *                 ]
+     *                 validationLosses (Optional): [
+     *                     double (Optional)
+     *                 ]
+     *                 latenciesInSeconds (Optional): [
+     *                     double (Optional)
+     *                 ]
+     *             }
+     *             variableStates (Optional): [
+     *                  (Optional){
+     *                     variable: String (Optional)
+     *                     filledNARatio: Double (Optional)
+     *                     effectiveCount: Integer (Optional)
+     *                     firstTimestamp: OffsetDateTime (Optional)
+     *                     lastTimestamp: OffsetDateTime (Optional)
+     *                 }
+     *             ]
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response of listing models along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listMultivariateModelsSinglePage(RequestOptions requestOptions) { + final String accept = "application/json"; + Response res = service.listMultivariateModelsSync(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "models"), getNextLink(res.getValue(), "nextLink"), null); + } + + /** + * List Multivariate Models + * + * List models of a resource. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
skipIntegerNoThe number of result items to skip.
topIntegerNoThe number of result items to return.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     modelId: String (Required)
+     *     createdTime: OffsetDateTime (Required)
+     *     lastUpdatedTime: OffsetDateTime (Required)
+     *     modelInfo (Optional): {
+     *         dataSource: String (Required)
+     *         dataSchema: String(OneTable/MultiTable) (Optional)
+     *         startTime: OffsetDateTime (Required)
+     *         endTime: OffsetDateTime (Required)
+     *         displayName: String (Optional)
+     *         slidingWindow: Integer (Optional)
+     *         alignPolicy (Optional): {
+     *             alignMode: String(Inner/Outer) (Optional)
+     *             fillNAMethod: String(Previous/Subsequent/Linear/Zero/Fixed) (Optional)
+     *             paddingValue: Double (Optional)
+     *         }
+     *         status: String(CREATED/RUNNING/READY/FAILED) (Optional)
+     *         errors (Optional): [
+     *              (Optional){
+     *                 code: String (Required)
+     *                 message: String (Required)
+     *             }
+     *         ]
+     *         diagnosticsInfo (Optional): {
+     *             modelState (Optional): {
+     *                 epochIds (Optional): [
+     *                     int (Optional)
+     *                 ]
+     *                 trainLosses (Optional): [
+     *                     double (Optional)
+     *                 ]
+     *                 validationLosses (Optional): [
+     *                     double (Optional)
+     *                 ]
+     *                 latenciesInSeconds (Optional): [
+     *                     double (Optional)
+     *                 ]
+     *             }
+     *             variableStates (Optional): [
+     *                  (Optional){
+     *                     variable: String (Optional)
+     *                     filledNARatio: Double (Optional)
+     *                     effectiveCount: Integer (Optional)
+     *                     firstTimestamp: OffsetDateTime (Optional)
+     *                     lastTimestamp: OffsetDateTime (Optional)
+     *                 }
+     *             ]
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response of listing models as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listMultivariateModels(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedIterable<>(() -> listMultivariateModelsSinglePage(requestOptions), + nextLink -> listMultivariateModelsNextSinglePage(nextLink, requestOptionsForNextPage)); + } + + /** + * Delete Multivariate Model + * + * Delete an existing multivariate model according to the modelId value. + * + * @param modelId Model identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteMultivariateModelWithResponseAsync(String modelId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.deleteMultivariateModel(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), modelId, accept, requestOptions, context)); + } + + /** + * Delete Multivariate Model + * + * Delete an existing multivariate model according to the modelId value. + * + * @param modelId Model identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteMultivariateModelWithResponse(String modelId, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.deleteMultivariateModelSync(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), modelId, accept, requestOptions, Context.NONE); + } + + /** + * Get Multivariate Model + * + * Get detailed information about the multivariate model, including the training status + * and variables used in the model. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     modelId: String (Required)
+     *     createdTime: OffsetDateTime (Required)
+     *     lastUpdatedTime: OffsetDateTime (Required)
+     *     modelInfo (Optional): {
+     *         dataSource: String (Required)
+     *         dataSchema: String(OneTable/MultiTable) (Optional)
+     *         startTime: OffsetDateTime (Required)
+     *         endTime: OffsetDateTime (Required)
+     *         displayName: String (Optional)
+     *         slidingWindow: Integer (Optional)
+     *         alignPolicy (Optional): {
+     *             alignMode: String(Inner/Outer) (Optional)
+     *             fillNAMethod: String(Previous/Subsequent/Linear/Zero/Fixed) (Optional)
+     *             paddingValue: Double (Optional)
+     *         }
+     *         status: String(CREATED/RUNNING/READY/FAILED) (Optional)
+     *         errors (Optional): [
+     *              (Optional){
+     *                 code: String (Required)
+     *                 message: String (Required)
+     *             }
+     *         ]
+     *         diagnosticsInfo (Optional): {
+     *             modelState (Optional): {
+     *                 epochIds (Optional): [
+     *                     int (Optional)
+     *                 ]
+     *                 trainLosses (Optional): [
+     *                     double (Optional)
+     *                 ]
+     *                 validationLosses (Optional): [
+     *                     double (Optional)
+     *                 ]
+     *                 latenciesInSeconds (Optional): [
+     *                     double (Optional)
+     *                 ]
+     *             }
+     *             variableStates (Optional): [
+     *                  (Optional){
+     *                     variable: String (Optional)
+     *                     filledNARatio: Double (Optional)
+     *                     effectiveCount: Integer (Optional)
+     *                     firstTimestamp: OffsetDateTime (Optional)
+     *                     lastTimestamp: OffsetDateTime (Optional)
+     *                 }
+     *             ]
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param modelId Model identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return detailed information about the multivariate model, including the training status + * and variables used in the model along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getMultivariateModelWithResponseAsync(String modelId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getMultivariateModel(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), modelId, accept, requestOptions, context)); + } + + /** + * Get Multivariate Model + * + * Get detailed information about the multivariate model, including the training status + * and variables used in the model. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     modelId: String (Required)
+     *     createdTime: OffsetDateTime (Required)
+     *     lastUpdatedTime: OffsetDateTime (Required)
+     *     modelInfo (Optional): {
+     *         dataSource: String (Required)
+     *         dataSchema: String(OneTable/MultiTable) (Optional)
+     *         startTime: OffsetDateTime (Required)
+     *         endTime: OffsetDateTime (Required)
+     *         displayName: String (Optional)
+     *         slidingWindow: Integer (Optional)
+     *         alignPolicy (Optional): {
+     *             alignMode: String(Inner/Outer) (Optional)
+     *             fillNAMethod: String(Previous/Subsequent/Linear/Zero/Fixed) (Optional)
+     *             paddingValue: Double (Optional)
+     *         }
+     *         status: String(CREATED/RUNNING/READY/FAILED) (Optional)
+     *         errors (Optional): [
+     *              (Optional){
+     *                 code: String (Required)
+     *                 message: String (Required)
+     *             }
+     *         ]
+     *         diagnosticsInfo (Optional): {
+     *             modelState (Optional): {
+     *                 epochIds (Optional): [
+     *                     int (Optional)
+     *                 ]
+     *                 trainLosses (Optional): [
+     *                     double (Optional)
+     *                 ]
+     *                 validationLosses (Optional): [
+     *                     double (Optional)
+     *                 ]
+     *                 latenciesInSeconds (Optional): [
+     *                     double (Optional)
+     *                 ]
+     *             }
+     *             variableStates (Optional): [
+     *                  (Optional){
+     *                     variable: String (Optional)
+     *                     filledNARatio: Double (Optional)
+     *                     effectiveCount: Integer (Optional)
+     *                     firstTimestamp: OffsetDateTime (Optional)
+     *                     lastTimestamp: OffsetDateTime (Optional)
+     *                 }
+     *             ]
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param modelId Model identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return detailed information about the multivariate model, including the training status + * and variables used in the model along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getMultivariateModelWithResponse(String modelId, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getMultivariateModelSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + modelId, accept, requestOptions, Context.NONE); + } + + /** + * Detect Multivariate Anomaly + * + * Submit a multivariate anomaly detection task with the modelId value of a trained model + * and inference data. The input schema should be the same with the training + * request. The request will finish asynchronously and return a resultId value to + * query the detection result. The request should be a source link to indicate an + * externally accessible Azure Storage URI that either points to an Azure Blob + * Storage folder or points to a CSV file in Azure Blob Storage. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     dataSource: String (Required)
+     *     topContributorCount: Integer (Optional)
+     *     startTime: OffsetDateTime (Required)
+     *     endTime: OffsetDateTime (Required)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     resultId: String (Required)
+     *     summary (Required): {
+     *         status: String(CREATED/RUNNING/READY/FAILED) (Required)
+     *         errors (Optional): [
+     *              (Optional){
+     *                 code: String (Required)
+     *                 message: String (Required)
+     *             }
+     *         ]
+     *         variableStates (Optional): [
+     *              (Optional){
+     *                 variable: String (Optional)
+     *                 filledNARatio: Double (Optional)
+     *                 effectiveCount: Integer (Optional)
+     *                 firstTimestamp: OffsetDateTime (Optional)
+     *                 lastTimestamp: OffsetDateTime (Optional)
+     *             }
+     *         ]
+     *         setupInfo (Required): {
+     *             dataSource: String (Required)
+     *             topContributorCount: Integer (Optional)
+     *             startTime: OffsetDateTime (Required)
+     *             endTime: OffsetDateTime (Required)
+     *         }
+     *     }
+     *     results (Required): [
+     *          (Required){
+     *             timestamp: OffsetDateTime (Required)
+     *             value (Optional): {
+     *                 isAnomaly: boolean (Required)
+     *                 severity: double (Required)
+     *                 score: double (Required)
+     *                 interpretation (Optional): [
+     *                      (Optional){
+     *                         variable: String (Optional)
+     *                         contributionScore: Double (Optional)
+     *                         correlationChanges (Optional): {
+     *                             changedVariables (Optional): [
+     *                                 String (Optional)
+     *                             ]
+     *                         }
+     *                     }
+     *                 ]
+     *             }
+     *             errors (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param modelId Model identifier. + * @param options Request of multivariate anomaly detection. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return detection results for the resultId value along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> detectMultivariateBatchAnomalyWithResponseAsync(String modelId, + BinaryData options, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.detectMultivariateBatchAnomaly(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), modelId, accept, options, requestOptions, context)); + } + + /** + * Detect Multivariate Anomaly + * + * Submit a multivariate anomaly detection task with the modelId value of a trained model + * and inference data. The input schema should be the same with the training + * request. The request will finish asynchronously and return a resultId value to + * query the detection result. The request should be a source link to indicate an + * externally accessible Azure Storage URI that either points to an Azure Blob + * Storage folder or points to a CSV file in Azure Blob Storage. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     dataSource: String (Required)
+     *     topContributorCount: Integer (Optional)
+     *     startTime: OffsetDateTime (Required)
+     *     endTime: OffsetDateTime (Required)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     resultId: String (Required)
+     *     summary (Required): {
+     *         status: String(CREATED/RUNNING/READY/FAILED) (Required)
+     *         errors (Optional): [
+     *              (Optional){
+     *                 code: String (Required)
+     *                 message: String (Required)
+     *             }
+     *         ]
+     *         variableStates (Optional): [
+     *              (Optional){
+     *                 variable: String (Optional)
+     *                 filledNARatio: Double (Optional)
+     *                 effectiveCount: Integer (Optional)
+     *                 firstTimestamp: OffsetDateTime (Optional)
+     *                 lastTimestamp: OffsetDateTime (Optional)
+     *             }
+     *         ]
+     *         setupInfo (Required): {
+     *             dataSource: String (Required)
+     *             topContributorCount: Integer (Optional)
+     *             startTime: OffsetDateTime (Required)
+     *             endTime: OffsetDateTime (Required)
+     *         }
+     *     }
+     *     results (Required): [
+     *          (Required){
+     *             timestamp: OffsetDateTime (Required)
+     *             value (Optional): {
+     *                 isAnomaly: boolean (Required)
+     *                 severity: double (Required)
+     *                 score: double (Required)
+     *                 interpretation (Optional): [
+     *                      (Optional){
+     *                         variable: String (Optional)
+     *                         contributionScore: Double (Optional)
+     *                         correlationChanges (Optional): {
+     *                             changedVariables (Optional): [
+     *                                 String (Optional)
+     *                             ]
+     *                         }
+     *                     }
+     *                 ]
+     *             }
+     *             errors (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param modelId Model identifier. + * @param options Request of multivariate anomaly detection. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return detection results for the resultId value along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response detectMultivariateBatchAnomalyWithResponse(String modelId, BinaryData options, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.detectMultivariateBatchAnomalySync(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), modelId, accept, options, requestOptions, Context.NONE); + } + + /** + * Detect anomalies in the last point of the request body + * + * Submit a multivariate anomaly detection task with the modelId value of a trained model + * and inference data. The inference data should be put into the request body in + * JSON format. The request will finish synchronously and return the detection + * immediately in the response body. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     variables (Required): [
+     *          (Required){
+     *             variable: String (Required)
+     *             timestamps (Required): [
+     *                 String (Required)
+     *             ]
+     *             values (Required): [
+     *                 double (Required)
+     *             ]
+     *         }
+     *     ]
+     *     topContributorCount: Integer (Optional)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     variableStates (Optional): [
+     *          (Optional){
+     *             variable: String (Optional)
+     *             filledNARatio: Double (Optional)
+     *             effectiveCount: Integer (Optional)
+     *             firstTimestamp: OffsetDateTime (Optional)
+     *             lastTimestamp: OffsetDateTime (Optional)
+     *         }
+     *     ]
+     *     results (Optional): [
+     *          (Optional){
+     *             timestamp: OffsetDateTime (Required)
+     *             value (Optional): {
+     *                 isAnomaly: boolean (Required)
+     *                 severity: double (Required)
+     *                 score: double (Required)
+     *                 interpretation (Optional): [
+     *                      (Optional){
+     *                         variable: String (Optional)
+     *                         contributionScore: Double (Optional)
+     *                         correlationChanges (Optional): {
+     *                             changedVariables (Optional): [
+     *                                 String (Optional)
+     *                             ]
+     *                         }
+     *                     }
+     *                 ]
+     *             }
+     *             errors (Optional): [
+     *                  (Optional){
+     *                     code: String (Required)
+     *                     message: String (Required)
+     *                 }
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param modelId Model identifier. + * @param options Request of the last detection. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return results of the last detection along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> detectMultivariateLastAnomalyWithResponseAsync(String modelId, BinaryData options, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.detectMultivariateLastAnomaly(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), modelId, accept, options, requestOptions, context)); + } + + /** + * Detect anomalies in the last point of the request body + * + * Submit a multivariate anomaly detection task with the modelId value of a trained model + * and inference data. The inference data should be put into the request body in + * JSON format. The request will finish synchronously and return the detection + * immediately in the response body. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     variables (Required): [
+     *          (Required){
+     *             variable: String (Required)
+     *             timestamps (Required): [
+     *                 String (Required)
+     *             ]
+     *             values (Required): [
+     *                 double (Required)
+     *             ]
+     *         }
+     *     ]
+     *     topContributorCount: Integer (Optional)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     variableStates (Optional): [
+     *          (Optional){
+     *             variable: String (Optional)
+     *             filledNARatio: Double (Optional)
+     *             effectiveCount: Integer (Optional)
+     *             firstTimestamp: OffsetDateTime (Optional)
+     *             lastTimestamp: OffsetDateTime (Optional)
+     *         }
+     *     ]
+     *     results (Optional): [
+     *          (Optional){
+     *             timestamp: OffsetDateTime (Required)
+     *             value (Optional): {
+     *                 isAnomaly: boolean (Required)
+     *                 severity: double (Required)
+     *                 score: double (Required)
+     *                 interpretation (Optional): [
+     *                      (Optional){
+     *                         variable: String (Optional)
+     *                         contributionScore: Double (Optional)
+     *                         correlationChanges (Optional): {
+     *                             changedVariables (Optional): [
+     *                                 String (Optional)
+     *                             ]
+     *                         }
+     *                     }
+     *                 ]
+     *             }
+     *             errors (Optional): [
+     *                  (Optional){
+     *                     code: String (Required)
+     *                     message: String (Required)
+     *                 }
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param modelId Model identifier. + * @param options Request of the last detection. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return results of the last detection along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response detectMultivariateLastAnomalyWithResponse(String modelId, BinaryData options, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.detectMultivariateLastAnomalySync(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), modelId, accept, options, requestOptions, Context.NONE); + } + + /** + * List Multivariate Models + * + * Get the next page of items. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     modelId: String (Required)
+     *     createdTime: OffsetDateTime (Required)
+     *     lastUpdatedTime: OffsetDateTime (Required)
+     *     modelInfo (Optional): {
+     *         dataSource: String (Required)
+     *         dataSchema: String(OneTable/MultiTable) (Optional)
+     *         startTime: OffsetDateTime (Required)
+     *         endTime: OffsetDateTime (Required)
+     *         displayName: String (Optional)
+     *         slidingWindow: Integer (Optional)
+     *         alignPolicy (Optional): {
+     *             alignMode: String(Inner/Outer) (Optional)
+     *             fillNAMethod: String(Previous/Subsequent/Linear/Zero/Fixed) (Optional)
+     *             paddingValue: Double (Optional)
+     *         }
+     *         status: String(CREATED/RUNNING/READY/FAILED) (Optional)
+     *         errors (Optional): [
+     *              (Optional){
+     *                 code: String (Required)
+     *                 message: String (Required)
+     *             }
+     *         ]
+     *         diagnosticsInfo (Optional): {
+     *             modelState (Optional): {
+     *                 epochIds (Optional): [
+     *                     int (Optional)
+     *                 ]
+     *                 trainLosses (Optional): [
+     *                     double (Optional)
+     *                 ]
+     *                 validationLosses (Optional): [
+     *                     double (Optional)
+     *                 ]
+     *                 latenciesInSeconds (Optional): [
+     *                     double (Optional)
+     *                 ]
+     *             }
+     *             variableStates (Optional): [
+     *                  (Optional){
+     *                     variable: String (Optional)
+     *                     filledNARatio: Double (Optional)
+     *                     effectiveCount: Integer (Optional)
+     *                     firstTimestamp: OffsetDateTime (Optional)
+     *                     lastTimestamp: OffsetDateTime (Optional)
+     *                 }
+     *             ]
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param nextLink The URL to get the next list of items. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response of listing models along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listMultivariateModelsNextSinglePageAsync(String nextLink, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listMultivariateModelsNext(nextLink, this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "models"), getNextLink(res.getValue(), "nextLink"), null)); + } + + /** + * List Multivariate Models + * + * Get the next page of items. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     modelId: String (Required)
+     *     createdTime: OffsetDateTime (Required)
+     *     lastUpdatedTime: OffsetDateTime (Required)
+     *     modelInfo (Optional): {
+     *         dataSource: String (Required)
+     *         dataSchema: String(OneTable/MultiTable) (Optional)
+     *         startTime: OffsetDateTime (Required)
+     *         endTime: OffsetDateTime (Required)
+     *         displayName: String (Optional)
+     *         slidingWindow: Integer (Optional)
+     *         alignPolicy (Optional): {
+     *             alignMode: String(Inner/Outer) (Optional)
+     *             fillNAMethod: String(Previous/Subsequent/Linear/Zero/Fixed) (Optional)
+     *             paddingValue: Double (Optional)
+     *         }
+     *         status: String(CREATED/RUNNING/READY/FAILED) (Optional)
+     *         errors (Optional): [
+     *              (Optional){
+     *                 code: String (Required)
+     *                 message: String (Required)
+     *             }
+     *         ]
+     *         diagnosticsInfo (Optional): {
+     *             modelState (Optional): {
+     *                 epochIds (Optional): [
+     *                     int (Optional)
+     *                 ]
+     *                 trainLosses (Optional): [
+     *                     double (Optional)
+     *                 ]
+     *                 validationLosses (Optional): [
+     *                     double (Optional)
+     *                 ]
+     *                 latenciesInSeconds (Optional): [
+     *                     double (Optional)
+     *                 ]
+     *             }
+     *             variableStates (Optional): [
+     *                  (Optional){
+     *                     variable: String (Optional)
+     *                     filledNARatio: Double (Optional)
+     *                     effectiveCount: Integer (Optional)
+     *                     firstTimestamp: OffsetDateTime (Optional)
+     *                     lastTimestamp: OffsetDateTime (Optional)
+     *                 }
+     *             ]
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param nextLink The URL to get the next list of items. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response of listing models along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listMultivariateModelsNextSinglePage(String nextLink, + RequestOptions requestOptions) { + final String accept = "application/json"; + Response res = service.listMultivariateModelsNextSync(nextLink, this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "models"), getNextLink(res.getValue(), "nextLink"), null); + } + + private List getValues(BinaryData binaryData, String path) { + try { + Map obj = binaryData.toObject(Map.class); + List values = (List) obj.get(path); + return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); + } catch (RuntimeException e) { + return null; + } + } + + private String getNextLink(BinaryData binaryData, String path) { + try { + Map obj = binaryData.toObject(Map.class); + return (String) obj.get(path); + } catch (RuntimeException e) { + return null; + } + } +} diff --git a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/implementation/UnivariatesImpl.java b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/implementation/UnivariatesImpl.java new file mode 100644 index 000000000000..e2f888251788 --- /dev/null +++ b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/implementation/UnivariatesImpl.java @@ -0,0 +1,495 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.anomalydetector.implementation; + +import com.azure.ai.anomalydetector.AnomalyDetectorServiceVersion; +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Post; +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.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in Univariates. + */ +public final class UnivariatesImpl { + /** + * The proxy service used to perform REST calls. + */ + private final UnivariatesService service; + + /** + * The service client containing this operation class. + */ + private final AnomalyDetectorClientImpl client; + + /** + * Initializes an instance of UnivariatesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + UnivariatesImpl(AnomalyDetectorClientImpl client) { + this.service + = RestProxy.create(UnivariatesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * Gets Service version. + * + * @return the serviceVersion value. + */ + public AnomalyDetectorServiceVersion getServiceVersion() { + return client.getServiceVersion(); + } + + /** + * The interface defining all the services for AnomalyDetectorClientUnivariates to be used by the proxy service to + * perform REST calls. + */ + @Host("{Endpoint}/anomalydetector/{ApiVersion}") + @ServiceInterface(name = "AnomalyDetectorClien") + public interface UnivariatesService { + @Post("/timeseries/entire/detect") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> detectUnivariateEntireSeries(@HostParam("Endpoint") String endpoint, + @HostParam("ApiVersion") String apiVersion, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData options, RequestOptions requestOptions, Context context); + + @Post("/timeseries/entire/detect") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response detectUnivariateEntireSeriesSync(@HostParam("Endpoint") String endpoint, + @HostParam("ApiVersion") String apiVersion, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData options, RequestOptions requestOptions, Context context); + + @Post("/timeseries/last/detect") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> detectUnivariateLastPoint(@HostParam("Endpoint") String endpoint, + @HostParam("ApiVersion") String apiVersion, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData options, RequestOptions requestOptions, Context context); + + @Post("/timeseries/last/detect") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response detectUnivariateLastPointSync(@HostParam("Endpoint") String endpoint, + @HostParam("ApiVersion") String apiVersion, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData options, RequestOptions requestOptions, Context context); + + @Post("/timeseries/changepoint/detect") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> detectUnivariateChangePoint(@HostParam("Endpoint") String endpoint, + @HostParam("ApiVersion") String apiVersion, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData options, RequestOptions requestOptions, Context context); + + @Post("/timeseries/changepoint/detect") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response detectUnivariateChangePointSync(@HostParam("Endpoint") String endpoint, + @HostParam("ApiVersion") String apiVersion, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData options, RequestOptions requestOptions, Context context); + } + + /** + * Detect anomalies for the entire series in batch. + * + * This operation generates a model with an entire series. Each point is detected + * with the same model. With this method, points before and after a certain point + * are used to determine whether it's an anomaly. The entire detection can give the + * user an overall status of the time series. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     series (Required): [
+     *          (Required){
+     *             timestamp: OffsetDateTime (Optional)
+     *             value: double (Required)
+     *         }
+     *     ]
+     *     granularity: String(yearly/monthly/weekly/daily/hourly/minutely/secondly/microsecond/none) (Optional)
+     *     customInterval: Integer (Optional)
+     *     period: Integer (Optional)
+     *     maxAnomalyRatio: Double (Optional)
+     *     sensitivity: Integer (Optional)
+     *     imputeMode: String(auto/previous/linear/fixed/zero/notFill) (Optional)
+     *     imputeFixedValue: Double (Optional)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     period: int (Required)
+     *     expectedValues (Required): [
+     *         double (Required)
+     *     ]
+     *     upperMargins (Required): [
+     *         double (Required)
+     *     ]
+     *     lowerMargins (Required): [
+     *         double (Required)
+     *     ]
+     *     isAnomaly (Required): [
+     *         boolean (Required)
+     *     ]
+     *     isNegativeAnomaly (Required): [
+     *         boolean (Required)
+     *     ]
+     *     isPositiveAnomaly (Required): [
+     *         boolean (Required)
+     *     ]
+     *     severity (Optional): [
+     *         double (Optional)
+     *     ]
+     * }
+     * }
+ * + * @param options Method of univariate anomaly detection. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response of the entire anomaly detection along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> detectUnivariateEntireSeriesWithResponseAsync(BinaryData options, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.detectUnivariateEntireSeries(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), accept, options, requestOptions, context)); + } + + /** + * Detect anomalies for the entire series in batch. + * + * This operation generates a model with an entire series. Each point is detected + * with the same model. With this method, points before and after a certain point + * are used to determine whether it's an anomaly. The entire detection can give the + * user an overall status of the time series. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     series (Required): [
+     *          (Required){
+     *             timestamp: OffsetDateTime (Optional)
+     *             value: double (Required)
+     *         }
+     *     ]
+     *     granularity: String(yearly/monthly/weekly/daily/hourly/minutely/secondly/microsecond/none) (Optional)
+     *     customInterval: Integer (Optional)
+     *     period: Integer (Optional)
+     *     maxAnomalyRatio: Double (Optional)
+     *     sensitivity: Integer (Optional)
+     *     imputeMode: String(auto/previous/linear/fixed/zero/notFill) (Optional)
+     *     imputeFixedValue: Double (Optional)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     period: int (Required)
+     *     expectedValues (Required): [
+     *         double (Required)
+     *     ]
+     *     upperMargins (Required): [
+     *         double (Required)
+     *     ]
+     *     lowerMargins (Required): [
+     *         double (Required)
+     *     ]
+     *     isAnomaly (Required): [
+     *         boolean (Required)
+     *     ]
+     *     isNegativeAnomaly (Required): [
+     *         boolean (Required)
+     *     ]
+     *     isPositiveAnomaly (Required): [
+     *         boolean (Required)
+     *     ]
+     *     severity (Optional): [
+     *         double (Optional)
+     *     ]
+     * }
+     * }
+ * + * @param options Method of univariate anomaly detection. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response of the entire anomaly detection along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response detectUnivariateEntireSeriesWithResponse(BinaryData options, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.detectUnivariateEntireSeriesSync(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), accept, options, requestOptions, Context.NONE); + } + + /** + * Detect anomaly status of the latest point in time series. + * + * This operation generates a model by using the points that you sent in to the API + * and based on all data to determine whether the last point is anomalous. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     series (Required): [
+     *          (Required){
+     *             timestamp: OffsetDateTime (Optional)
+     *             value: double (Required)
+     *         }
+     *     ]
+     *     granularity: String(yearly/monthly/weekly/daily/hourly/minutely/secondly/microsecond/none) (Optional)
+     *     customInterval: Integer (Optional)
+     *     period: Integer (Optional)
+     *     maxAnomalyRatio: Double (Optional)
+     *     sensitivity: Integer (Optional)
+     *     imputeMode: String(auto/previous/linear/fixed/zero/notFill) (Optional)
+     *     imputeFixedValue: Double (Optional)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     period: int (Required)
+     *     suggestedWindow: int (Required)
+     *     expectedValue: double (Required)
+     *     upperMargin: double (Required)
+     *     lowerMargin: double (Required)
+     *     isAnomaly: boolean (Required)
+     *     isNegativeAnomaly: boolean (Required)
+     *     isPositiveAnomaly: boolean (Required)
+     *     severity: Double (Optional)
+     * }
+     * }
+ * + * @param options Method of univariate anomaly detection. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response of the last anomaly detection along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> detectUnivariateLastPointWithResponseAsync(BinaryData options, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.detectUnivariateLastPoint(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), accept, options, requestOptions, context)); + } + + /** + * Detect anomaly status of the latest point in time series. + * + * This operation generates a model by using the points that you sent in to the API + * and based on all data to determine whether the last point is anomalous. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     series (Required): [
+     *          (Required){
+     *             timestamp: OffsetDateTime (Optional)
+     *             value: double (Required)
+     *         }
+     *     ]
+     *     granularity: String(yearly/monthly/weekly/daily/hourly/minutely/secondly/microsecond/none) (Optional)
+     *     customInterval: Integer (Optional)
+     *     period: Integer (Optional)
+     *     maxAnomalyRatio: Double (Optional)
+     *     sensitivity: Integer (Optional)
+     *     imputeMode: String(auto/previous/linear/fixed/zero/notFill) (Optional)
+     *     imputeFixedValue: Double (Optional)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     period: int (Required)
+     *     suggestedWindow: int (Required)
+     *     expectedValue: double (Required)
+     *     upperMargin: double (Required)
+     *     lowerMargin: double (Required)
+     *     isAnomaly: boolean (Required)
+     *     isNegativeAnomaly: boolean (Required)
+     *     isPositiveAnomaly: boolean (Required)
+     *     severity: Double (Optional)
+     * }
+     * }
+ * + * @param options Method of univariate anomaly detection. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response of the last anomaly detection along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response detectUnivariateLastPointWithResponse(BinaryData options, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.detectUnivariateLastPointSync(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), accept, options, requestOptions, Context.NONE); + } + + /** + * Detect change point for the entire series + * + * Evaluate the change point score of every series point. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     series (Required): [
+     *          (Required){
+     *             timestamp: OffsetDateTime (Optional)
+     *             value: double (Required)
+     *         }
+     *     ]
+     *     granularity: String(yearly/monthly/weekly/daily/hourly/minutely/secondly/microsecond/none) (Required)
+     *     customInterval: Integer (Optional)
+     *     period: Integer (Optional)
+     *     stableTrendWindow: Integer (Optional)
+     *     threshold: Double (Optional)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     period: Integer (Optional)
+     *     isChangePoint (Optional): [
+     *         boolean (Optional)
+     *     ]
+     *     confidenceScores (Optional): [
+     *         double (Optional)
+     *     ]
+     * }
+     * }
+ * + * @param options Method of univariate anomaly detection. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response of change point detection along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> detectUnivariateChangePointWithResponseAsync(BinaryData options, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.detectUnivariateChangePoint(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), accept, options, requestOptions, context)); + } + + /** + * Detect change point for the entire series + * + * Evaluate the change point score of every series point. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     series (Required): [
+     *          (Required){
+     *             timestamp: OffsetDateTime (Optional)
+     *             value: double (Required)
+     *         }
+     *     ]
+     *     granularity: String(yearly/monthly/weekly/daily/hourly/minutely/secondly/microsecond/none) (Required)
+     *     customInterval: Integer (Optional)
+     *     period: Integer (Optional)
+     *     stableTrendWindow: Integer (Optional)
+     *     threshold: Double (Optional)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     period: Integer (Optional)
+     *     isChangePoint (Optional): [
+     *         boolean (Optional)
+     *     ]
+     *     confidenceScores (Optional): [
+     *         double (Optional)
+     *     ]
+     * }
+     * }
+ * + * @param options Method of univariate anomaly detection. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response of change point detection along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response detectUnivariateChangePointWithResponse(BinaryData options, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.detectUnivariateChangePointSync(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), accept, options, requestOptions, Context.NONE); + } +} diff --git a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/implementation/package-info.java b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/implementation/package-info.java index 7460f62ca500..45aab30e4026 100644 --- a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/implementation/package-info.java +++ b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/implementation/package-info.java @@ -1,7 +1,6 @@ // 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 AnomalyDetector. The Anomaly Detector API detects anomalies automatically * in time series data. It supports two kinds of mode, one is for stateless using, another is for stateful using. In diff --git a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/AlignMode.java b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/AlignMode.java index 0f3275035816..4a4f99db1f55 100644 --- a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/AlignMode.java +++ b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/AlignMode.java @@ -1,51 +1,57 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.anomalydetector.models; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; -/** Defines values for AlignMode. */ -public enum AlignMode { - /** Enum value Inner. */ - INNER("Inner"), +/** + * Defines values for AlignMode. + */ +public final class AlignMode extends ExpandableStringEnum { - /** Enum value Outer. */ - OUTER("Outer"); + /** + * Static value Inner for AlignMode. + */ + @Generated + public static final AlignMode INNER = fromString("Inner"); - /** The actual serialized value for a AlignMode instance. */ - private final String value; + /** + * Static value Outer for AlignMode. + */ + @Generated + public static final AlignMode OUTER = fromString("Outer"); - AlignMode(String value) { - this.value = value; + /** + * Creates a new instance of AlignMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public AlignMode() { } /** - * Parses a serialized value to a AlignMode instance. + * Creates or finds a AlignMode from its string representation. * - * @param value the serialized value to parse. - * @return the parsed AlignMode object, or null if unable to parse. + * @param name a name to look for. + * @return the corresponding AlignMode. */ - @JsonCreator - public static AlignMode fromString(String value) { - if (value == null) { - return null; - } - AlignMode[] items = AlignMode.values(); - for (AlignMode item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; + @Generated + public static AlignMode fromString(String name) { + return fromString(name, AlignMode.class); } - /** {@inheritDoc} */ - @JsonValue - @Override - public String toString() { - return this.value; + /** + * Gets known AlignMode values. + * + * @return known AlignMode values. + */ + @Generated + public static Collection values() { + return values(AlignMode.class); } } diff --git a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/AlignPolicy.java b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/AlignPolicy.java index a6cbbab5fa48..f777af3e86d8 100644 --- a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/AlignPolicy.java +++ b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/AlignPolicy.java @@ -1,99 +1,155 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.anomalydetector.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** An optional field, indicating the manner to align multiple variables. */ +/** + * Manner of aligning multiple variables. + */ @Fluent -public final class AlignPolicy { +public final class AlignPolicy implements JsonSerializable { + /* - * An optional field, indicating how to align different variables to the same - * time-range. Either Inner or Outer. + * Field that indicates how to align different variables to the same + * time range. */ - @JsonProperty(value = "alignMode") + @Generated private AlignMode alignMode; /* - * An optional field, indicating how missing values will be filled. One of - * Previous, Subsequent, Linear, Zero, Fixed. + * Field that indicates how missing values will be filled. */ - @JsonProperty(value = "fillNAMethod") + @Generated private FillNAMethod fillNAMethod; /* - * An optional field. Required when fillNAMethod is Fixed. + * Field that's required when fillNAMethod is Fixed. */ - @JsonProperty(value = "paddingValue") + @Generated private Double paddingValue; - /** Creates an instance of AlignPolicy class. */ - public AlignPolicy() {} + /** + * Creates an instance of AlignPolicy class. + */ + @Generated + public AlignPolicy() { + } /** - * Get the alignMode property: An optional field, indicating how to align different variables to the same - * time-range. Either Inner or Outer. + * Get the alignMode property: Field that indicates how to align different variables to the same + * time range. * * @return the alignMode value. */ + @Generated public AlignMode getAlignMode() { return this.alignMode; } /** - * Set the alignMode property: An optional field, indicating how to align different variables to the same - * time-range. Either Inner or Outer. + * Set the alignMode property: Field that indicates how to align different variables to the same + * time range. * * @param alignMode the alignMode value to set. * @return the AlignPolicy object itself. */ + @Generated public AlignPolicy setAlignMode(AlignMode alignMode) { this.alignMode = alignMode; return this; } /** - * Get the fillNAMethod property: An optional field, indicating how missing values will be filled. One of Previous, - * Subsequent, Linear, Zero, Fixed. + * Get the fillNAMethod property: Field that indicates how missing values will be filled. * * @return the fillNAMethod value. */ + @Generated public FillNAMethod getFillNAMethod() { return this.fillNAMethod; } /** - * Set the fillNAMethod property: An optional field, indicating how missing values will be filled. One of Previous, - * Subsequent, Linear, Zero, Fixed. + * Set the fillNAMethod property: Field that indicates how missing values will be filled. * * @param fillNAMethod the fillNAMethod value to set. * @return the AlignPolicy object itself. */ + @Generated public AlignPolicy setFillNAMethod(FillNAMethod fillNAMethod) { this.fillNAMethod = fillNAMethod; return this; } /** - * Get the paddingValue property: An optional field. Required when fillNAMethod is Fixed. + * Get the paddingValue property: Field that's required when fillNAMethod is Fixed. * * @return the paddingValue value. */ + @Generated public Double getPaddingValue() { return this.paddingValue; } /** - * Set the paddingValue property: An optional field. Required when fillNAMethod is Fixed. + * Set the paddingValue property: Field that's required when fillNAMethod is Fixed. * * @param paddingValue the paddingValue value to set. * @return the AlignPolicy object itself. */ + @Generated public AlignPolicy setPaddingValue(Double paddingValue) { this.paddingValue = paddingValue; return this; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("alignMode", this.alignMode == null ? null : this.alignMode.toString()); + jsonWriter.writeStringField("fillNAMethod", this.fillNAMethod == null ? null : this.fillNAMethod.toString()); + jsonWriter.writeNumberField("paddingValue", this.paddingValue); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AlignPolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AlignPolicy if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AlignPolicy. + */ + @Generated + public static AlignPolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AlignPolicy deserializedAlignPolicy = new AlignPolicy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("alignMode".equals(fieldName)) { + deserializedAlignPolicy.alignMode = AlignMode.fromString(reader.getString()); + } else if ("fillNAMethod".equals(fieldName)) { + deserializedAlignPolicy.fillNAMethod = FillNAMethod.fromString(reader.getString()); + } else if ("paddingValue".equals(fieldName)) { + deserializedAlignPolicy.paddingValue = reader.getNullable(JsonReader::getDouble); + } else { + reader.skipChildren(); + } + } + return deserializedAlignPolicy; + }); + } } diff --git a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/AnomalyDetectionModel.java b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/AnomalyDetectionModel.java index c488f04619ca..67c33f09261f 100644 --- a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/AnomalyDetectionModel.java +++ b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/AnomalyDetectionModel.java @@ -1,40 +1,48 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.anomalydetector.models; +import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; +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; -/** Response of getting a model. */ +/** + * Response of getting a model. + */ @Immutable -public final class AnomalyDetectionModel { +public final class AnomalyDetectionModel implements JsonSerializable { + /* * Model identifier. */ - @JsonProperty(value = "modelId", required = true, access = JsonProperty.Access.WRITE_ONLY) + @Generated private String modelId; /* * Date and time (UTC) when the model was created. */ - @JsonProperty(value = "createdTime", required = true) - private OffsetDateTime createdTime; + @Generated + private final OffsetDateTime createdTime; /* * Date and time (UTC) when the model was last updated. */ - @JsonProperty(value = "lastUpdatedTime", required = true) - private OffsetDateTime lastUpdatedTime; + @Generated + private final OffsetDateTime lastUpdatedTime; /* - * Training result of a model including its status, errors and diagnostics + * Training result of a model, including its status, errors, and diagnostics * information. */ - @JsonProperty(value = "modelInfo") + @Generated private ModelInfo modelInfo; /** @@ -43,10 +51,8 @@ public final class AnomalyDetectionModel { * @param createdTime the createdTime value to set. * @param lastUpdatedTime the lastUpdatedTime value to set. */ - @JsonCreator - private AnomalyDetectionModel( - @JsonProperty(value = "createdTime", required = true) OffsetDateTime createdTime, - @JsonProperty(value = "lastUpdatedTime", required = true) OffsetDateTime lastUpdatedTime) { + @Generated + private AnomalyDetectionModel(OffsetDateTime createdTime, OffsetDateTime lastUpdatedTime) { this.createdTime = createdTime; this.lastUpdatedTime = lastUpdatedTime; } @@ -56,6 +62,7 @@ private AnomalyDetectionModel( * * @return the modelId value. */ + @Generated public String getModelId() { return this.modelId; } @@ -65,6 +72,7 @@ public String getModelId() { * * @return the createdTime value. */ + @Generated public OffsetDateTime getCreatedTime() { return this.createdTime; } @@ -74,16 +82,75 @@ public OffsetDateTime getCreatedTime() { * * @return the lastUpdatedTime value. */ + @Generated public OffsetDateTime getLastUpdatedTime() { return this.lastUpdatedTime; } /** - * Get the modelInfo property: Training result of a model including its status, errors and diagnostics information. + * Get the modelInfo property: Training result of a model, including its status, errors, and diagnostics + * information. * * @return the modelInfo value. */ + @Generated public ModelInfo getModelInfo() { return this.modelInfo; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("createdTime", + this.createdTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdTime)); + jsonWriter.writeStringField("lastUpdatedTime", + this.lastUpdatedTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastUpdatedTime)); + jsonWriter.writeJsonField("modelInfo", this.modelInfo); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AnomalyDetectionModel from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnomalyDetectionModel 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 AnomalyDetectionModel. + */ + @Generated + public static AnomalyDetectionModel fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String modelId = null; + OffsetDateTime createdTime = null; + OffsetDateTime lastUpdatedTime = null; + ModelInfo modelInfo = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("modelId".equals(fieldName)) { + modelId = reader.getString(); + } else if ("createdTime".equals(fieldName)) { + createdTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastUpdatedTime".equals(fieldName)) { + lastUpdatedTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("modelInfo".equals(fieldName)) { + modelInfo = ModelInfo.fromJson(reader); + } else { + reader.skipChildren(); + } + } + AnomalyDetectionModel deserializedAnomalyDetectionModel + = new AnomalyDetectionModel(createdTime, lastUpdatedTime); + deserializedAnomalyDetectionModel.modelId = modelId; + deserializedAnomalyDetectionModel.modelInfo = modelInfo; + return deserializedAnomalyDetectionModel; + }); + } } diff --git a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/AnomalyInterpretation.java b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/AnomalyInterpretation.java index e2a9fce56f69..32db52763225 100644 --- a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/AnomalyInterpretation.java +++ b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/AnomalyInterpretation.java @@ -1,52 +1,66 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.anomalydetector.models; +import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Interpretation of the anomalous timestamp. */ +/** + * Interpretation of the anomalous time stamp. + */ @Immutable -public final class AnomalyInterpretation { +public final class AnomalyInterpretation implements JsonSerializable { + /* * Variable. */ - @JsonProperty(value = "variable") + @Generated private String variable; /* - * This score shows the percentage contributing to the anomalous timestamp. A + * This score shows the percentage that contributes to the anomalous time stamp. It's a * number between 0 and 1. */ - @JsonProperty(value = "contributionScore") + @Generated private Double contributionScore; /* - * Correlation changes among the anomalous variables + * Correlation changes among the anomalous variables. */ - @JsonProperty(value = "correlationChanges") + @Generated private CorrelationChanges correlationChanges; - /** Creates an instance of AnomalyInterpretation class. */ - private AnomalyInterpretation() {} + /** + * Creates an instance of AnomalyInterpretation class. + */ + @Generated + private AnomalyInterpretation() { + } /** * Get the variable property: Variable. * * @return the variable value. */ + @Generated public String getVariable() { return this.variable; } /** - * Get the contributionScore property: This score shows the percentage contributing to the anomalous timestamp. A + * Get the contributionScore property: This score shows the percentage that contributes to the anomalous time stamp. + * It's a * number between 0 and 1. * * @return the contributionScore value. */ + @Generated public Double getContributionScore() { return this.contributionScore; } @@ -56,7 +70,50 @@ public Double getContributionScore() { * * @return the correlationChanges value. */ + @Generated public CorrelationChanges getCorrelationChanges() { return this.correlationChanges; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("variable", this.variable); + jsonWriter.writeNumberField("contributionScore", this.contributionScore); + jsonWriter.writeJsonField("correlationChanges", this.correlationChanges); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AnomalyInterpretation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnomalyInterpretation if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AnomalyInterpretation. + */ + @Generated + public static AnomalyInterpretation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AnomalyInterpretation deserializedAnomalyInterpretation = new AnomalyInterpretation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("variable".equals(fieldName)) { + deserializedAnomalyInterpretation.variable = reader.getString(); + } else if ("contributionScore".equals(fieldName)) { + deserializedAnomalyInterpretation.contributionScore = reader.getNullable(JsonReader::getDouble); + } else if ("correlationChanges".equals(fieldName)) { + deserializedAnomalyInterpretation.correlationChanges = CorrelationChanges.fromJson(reader); + } else { + reader.skipChildren(); + } + } + return deserializedAnomalyInterpretation; + }); + } } diff --git a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/AnomalyState.java b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/AnomalyState.java index 78caad875798..6ef042f3b758 100644 --- a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/AnomalyState.java +++ b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/AnomalyState.java @@ -1,34 +1,42 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.anomalydetector.models; +import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; +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; -/** Anomaly status and information. */ +/** + * Anomaly status and information. + */ @Immutable -public final class AnomalyState { +public final class AnomalyState implements JsonSerializable { + /* - * The timestamp for this anomaly. + * Time stamp for this anomaly. */ - @JsonProperty(value = "timestamp", required = true) - private OffsetDateTime timestamp; + @Generated + private final OffsetDateTime timestamp; /* - * The detailed value of this anomalous timestamp. + * Detailed value of this anomalous time stamp. */ - @JsonProperty(value = "value") + @Generated private AnomalyValue value; /* - * Error message for the current timestamp. + * Error message for the current time stamp. */ - @JsonProperty(value = "errors") + @Generated private List errors; /** @@ -36,35 +44,88 @@ public final class AnomalyState { * * @param timestamp the timestamp value to set. */ - @JsonCreator - private AnomalyState(@JsonProperty(value = "timestamp", required = true) OffsetDateTime timestamp) { + @Generated + private AnomalyState(OffsetDateTime timestamp) { this.timestamp = timestamp; } /** - * Get the timestamp property: The timestamp for this anomaly. + * Get the timestamp property: Time stamp for this anomaly. * * @return the timestamp value. */ + @Generated public OffsetDateTime getTimestamp() { return this.timestamp; } /** - * Get the value property: The detailed value of this anomalous timestamp. + * Get the value property: Detailed value of this anomalous time stamp. * * @return the value value. */ + @Generated public AnomalyValue getValue() { return this.value; } /** - * Get the errors property: Error message for the current timestamp. + * Get the errors property: Error message for the current time stamp. * * @return the errors value. */ + @Generated public List getErrors() { return this.errors; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("timestamp", + this.timestamp == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.timestamp)); + jsonWriter.writeJsonField("value", this.value); + jsonWriter.writeArrayField("errors", this.errors, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AnomalyState from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnomalyState 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 AnomalyState. + */ + @Generated + public static AnomalyState fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OffsetDateTime timestamp = null; + AnomalyValue value = null; + List errors = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("timestamp".equals(fieldName)) { + timestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("value".equals(fieldName)) { + value = AnomalyValue.fromJson(reader); + } else if ("errors".equals(fieldName)) { + errors = reader.readArray(reader1 -> ErrorResponse.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + AnomalyState deserializedAnomalyState = new AnomalyState(timestamp); + deserializedAnomalyState.value = value; + deserializedAnomalyState.errors = errors; + return deserializedAnomalyState; + }); + } } diff --git a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/AnomalyValue.java b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/AnomalyValue.java index 61a03c2f7636..34ef3484db08 100644 --- a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/AnomalyValue.java +++ b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/AnomalyValue.java @@ -1,41 +1,46 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.anomalydetector.models; +import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.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; -/** Detailed information of the anomalous timestamp. */ +/** + * Detailed information of the anomalous time stamp. + */ @Immutable -public final class AnomalyValue { +public final class AnomalyValue implements JsonSerializable { + /* - * True if an anomaly is detected at the current timestamp. + * True if an anomaly is detected at the current time stamp. */ - @JsonProperty(value = "isAnomaly", required = true) - private boolean isAnomaly; + @Generated + private final boolean isAnomaly; /* * Indicates the significance of the anomaly. The higher the severity, the more * significant the anomaly is. */ - @JsonProperty(value = "severity", required = true) - private double severity; + @Generated + private final double severity; /* - * Raw anomaly score of severity, will help indicate the degree of abnormality as - * well. + * Raw anomaly score of severity, to help indicate the degree of abnormality. */ - @JsonProperty(value = "score", required = true) - private double score; + @Generated + private final double score; /* - * Interpretation of this anomalous timestamp. + * Interpretation of this anomalous time stamp. */ - @JsonProperty(value = "interpretation") + @Generated private List interpretation; /** @@ -45,21 +50,19 @@ public final class AnomalyValue { * @param severity the severity value to set. * @param score the score value to set. */ - @JsonCreator - private AnomalyValue( - @JsonProperty(value = "isAnomaly", required = true) boolean isAnomaly, - @JsonProperty(value = "severity", required = true) double severity, - @JsonProperty(value = "score", required = true) double score) { + @Generated + private AnomalyValue(boolean isAnomaly, double severity, double score) { this.isAnomaly = isAnomaly; this.severity = severity; this.score = score; } /** - * Get the isAnomaly property: True if an anomaly is detected at the current timestamp. + * Get the isAnomaly property: True if an anomaly is detected at the current time stamp. * * @return the isAnomaly value. */ + @Generated public boolean isAnomaly() { return this.isAnomaly; } @@ -70,25 +73,80 @@ public boolean isAnomaly() { * * @return the severity value. */ + @Generated public double getSeverity() { return this.severity; } /** - * Get the score property: Raw anomaly score of severity, will help indicate the degree of abnormality as well. + * Get the score property: Raw anomaly score of severity, to help indicate the degree of abnormality. * * @return the score value. */ + @Generated public double getScore() { return this.score; } /** - * Get the interpretation property: Interpretation of this anomalous timestamp. + * Get the interpretation property: Interpretation of this anomalous time stamp. * * @return the interpretation value. */ + @Generated public List getInterpretation() { return this.interpretation; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("isAnomaly", this.isAnomaly); + jsonWriter.writeDoubleField("severity", this.severity); + jsonWriter.writeDoubleField("score", this.score); + jsonWriter.writeArrayField("interpretation", this.interpretation, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AnomalyValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnomalyValue 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 AnomalyValue. + */ + @Generated + public static AnomalyValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + boolean isAnomaly = false; + double severity = 0.0; + double score = 0.0; + List interpretation = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("isAnomaly".equals(fieldName)) { + isAnomaly = reader.getBoolean(); + } else if ("severity".equals(fieldName)) { + severity = reader.getDouble(); + } else if ("score".equals(fieldName)) { + score = reader.getDouble(); + } else if ("interpretation".equals(fieldName)) { + interpretation = reader.readArray(reader1 -> AnomalyInterpretation.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + AnomalyValue deserializedAnomalyValue = new AnomalyValue(isAnomaly, severity, score); + deserializedAnomalyValue.interpretation = interpretation; + return deserializedAnomalyValue; + }); + } } diff --git a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/CorrelationChanges.java b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/CorrelationChanges.java index 941641457de2..2a95ca1c1956 100644 --- a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/CorrelationChanges.java +++ b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/CorrelationChanges.java @@ -1,31 +1,81 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.anomalydetector.models; +import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.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; -/** Correlation changes among the anomalous variables. */ +/** + * Correlation changes among the anomalous variables. + */ @Immutable -public final class CorrelationChanges { +public final class CorrelationChanges implements JsonSerializable { + /* - * The correlated variables that have correlation changes under an anomaly. + * Correlated variables that have correlation changes under an anomaly. */ - @JsonProperty(value = "changedVariables") + @Generated private List changedVariables; - /** Creates an instance of CorrelationChanges class. */ - private CorrelationChanges() {} + /** + * Creates an instance of CorrelationChanges class. + */ + @Generated + private CorrelationChanges() { + } /** - * Get the changedVariables property: The correlated variables that have correlation changes under an anomaly. + * Get the changedVariables property: Correlated variables that have correlation changes under an anomaly. * * @return the changedVariables value. */ + @Generated public List getChangedVariables() { return this.changedVariables; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("changedVariables", this.changedVariables, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CorrelationChanges from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CorrelationChanges if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the CorrelationChanges. + */ + @Generated + public static CorrelationChanges fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CorrelationChanges deserializedCorrelationChanges = new CorrelationChanges(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("changedVariables".equals(fieldName)) { + List changedVariables = reader.readArray(reader1 -> reader1.getString()); + deserializedCorrelationChanges.changedVariables = changedVariables; + } else { + reader.skipChildren(); + } + } + return deserializedCorrelationChanges; + }); + } } diff --git a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/DataSchema.java b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/DataSchema.java index b996f1595862..4365b1b40570 100644 --- a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/DataSchema.java +++ b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/DataSchema.java @@ -1,26 +1,30 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.anomalydetector.models; +import com.azure.core.annotation.Generated; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Data schema of input data source: OneTable or MultiTable. The default DataSchema is OneTable. */ +/** + * Data schema of the input data source. The default is OneTable. + */ public final class DataSchema extends ExpandableStringEnum { + /** - * OneTable means that your input data are all in one CSV file, which contains one 'timestamp' column and several - * variable columns. The default DataSchema is OneTable. + * OneTable means that your input data is in one CSV file, which contains one time stamp column and several variable + * columns. The default DataSchema value is OneTable. */ + @Generated public static final DataSchema ONE_TABLE = fromString("OneTable"); /** - * MultiTable means that your input data are separated in multiple CSV files, in each file containing one - * 'timestamp' column and one 'variable' column, and the CSV file name should indicate the name of the variable. The - * default DataSchema is OneTable. + * MultiTable means that your input data is separated in multiple CSV files. Each file contains one time stamp + * column and one variable column, and the CSV file name should indicate the name of the variable. The default + * DataSchema value is OneTable. */ + @Generated public static final DataSchema MULTI_TABLE = fromString("MultiTable"); /** @@ -28,8 +32,10 @@ public final class DataSchema extends ExpandableStringEnum { * * @deprecated Use the {@link #fromString(String)} factory method. */ + @Generated @Deprecated - public DataSchema() {} + public DataSchema() { + } /** * Creates or finds a DataSchema from its string representation. @@ -37,7 +43,7 @@ public DataSchema() {} * @param name a name to look for. * @return the corresponding DataSchema. */ - @JsonCreator + @Generated public static DataSchema fromString(String name) { return fromString(name, DataSchema.class); } @@ -47,6 +53,7 @@ public static DataSchema fromString(String name) { * * @return known DataSchema values. */ + @Generated public static Collection values() { return values(DataSchema.class); } diff --git a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/DiagnosticsInfo.java b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/DiagnosticsInfo.java index 7746d0fbcaa4..68db9b8bdb76 100644 --- a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/DiagnosticsInfo.java +++ b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/DiagnosticsInfo.java @@ -1,68 +1,100 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.anomalydetector.models; -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.annotation.Generated; +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; import java.util.List; -/** Diagnostics information to help inspect the states of model or variable. */ -@Fluent -public final class DiagnosticsInfo { +/** + * Diagnostics information to help inspect the states of a model or variable. + */ +@Immutable +public final class DiagnosticsInfo implements JsonSerializable { + /* * Model status. */ - @JsonProperty(value = "modelState") + @Generated private ModelState modelState; /* - * Variable Status. + * Variable status. */ - @JsonProperty(value = "variableStates") + @Generated private List variableStates; - /** Creates an instance of DiagnosticsInfo class. */ - public DiagnosticsInfo() {} + /** + * Creates an instance of DiagnosticsInfo class. + */ + @Generated + private DiagnosticsInfo() { + } /** * Get the modelState property: Model status. * * @return the modelState value. */ + @Generated public ModelState getModelState() { return this.modelState; } /** - * Set the modelState property: Model status. + * Get the variableStates property: Variable status. * - * @param modelState the modelState value to set. - * @return the DiagnosticsInfo object itself. + * @return the variableStates value. */ - public DiagnosticsInfo setModelState(ModelState modelState) { - this.modelState = modelState; - return this; + @Generated + public List getVariableStates() { + return this.variableStates; } /** - * Get the variableStates property: Variable Status. - * - * @return the variableStates value. + * {@inheritDoc} */ - public List getVariableStates() { - return this.variableStates; + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("modelState", this.modelState); + jsonWriter.writeArrayField("variableStates", this.variableStates, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); } /** - * Set the variableStates property: Variable Status. + * Reads an instance of DiagnosticsInfo from the JsonReader. * - * @param variableStates the variableStates value to set. - * @return the DiagnosticsInfo object itself. + * @param jsonReader The JsonReader being read. + * @return An instance of DiagnosticsInfo if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DiagnosticsInfo. */ - public DiagnosticsInfo setVariableStates(List variableStates) { - this.variableStates = variableStates; - return this; + @Generated + public static DiagnosticsInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DiagnosticsInfo deserializedDiagnosticsInfo = new DiagnosticsInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("modelState".equals(fieldName)) { + deserializedDiagnosticsInfo.modelState = ModelState.fromJson(reader); + } else if ("variableStates".equals(fieldName)) { + List variableStates = reader.readArray(reader1 -> VariableState.fromJson(reader1)); + deserializedDiagnosticsInfo.variableStates = variableStates; + } else { + reader.skipChildren(); + } + } + return deserializedDiagnosticsInfo; + }); } } diff --git a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/ErrorResponse.java b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/ErrorResponse.java index f3b26161746d..5182e7e30d92 100644 --- a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/ErrorResponse.java +++ b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/ErrorResponse.java @@ -1,27 +1,33 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.anomalydetector.models; +import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** ErrorResponse contains code and message that shows the error information. */ +/** + * Error information that the API returned. + */ @Immutable -public final class ErrorResponse { +public final class ErrorResponse implements JsonSerializable { + /* - * The error code. + * Error code. */ - @JsonProperty(value = "code", required = true) - private String code; + @Generated + private final String code; /* - * The message explaining the error reported by the service. + * Message that explains the error that the service reported. */ - @JsonProperty(value = "message", required = true) - private String message; + @Generated + private final String message; /** * Creates an instance of ErrorResponse class. @@ -29,29 +35,70 @@ public final class ErrorResponse { * @param code the code value to set. * @param message the message value to set. */ - @JsonCreator - public ErrorResponse( - @JsonProperty(value = "code", required = true) String code, - @JsonProperty(value = "message", required = true) String message) { + @Generated + private ErrorResponse(String code, String message) { this.code = code; this.message = message; } /** - * Get the code property: The error code. + * Get the code property: Error code. * * @return the code value. */ + @Generated public String getCode() { return this.code; } /** - * Get the message property: The message explaining the error reported by the service. + * Get the message property: Message that explains the error that the service reported. * * @return the message value. */ + @Generated public String getMessage() { return this.message; } + + /** + * {@inheritDoc} + */ + @Generated + @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 ErrorResponse from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ErrorResponse 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 ErrorResponse. + */ + @Generated + public static ErrorResponse fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String code = null; + String message = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("code".equals(fieldName)) { + code = reader.getString(); + } else if ("message".equals(fieldName)) { + message = reader.getString(); + } else { + reader.skipChildren(); + } + } + return new ErrorResponse(code, message); + }); + } } diff --git a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/FillNAMethod.java b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/FillNAMethod.java index 136f6221d31d..19c1df212b85 100644 --- a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/FillNAMethod.java +++ b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/FillNAMethod.java @@ -1,30 +1,45 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.anomalydetector.models; +import com.azure.core.annotation.Generated; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** - * An optional field, indicating how missing values will be filled. One of Previous, Subsequent, Linear, Zero, Fixed. + * Field that indicates how missing values will be filled. */ public final class FillNAMethod extends ExpandableStringEnum { - /** Static value Previous for FillNAMethod. */ + + /** + * Static value Previous for FillNAMethod. + */ + @Generated public static final FillNAMethod PREVIOUS = fromString("Previous"); - /** Static value Subsequent for FillNAMethod. */ + /** + * Static value Subsequent for FillNAMethod. + */ + @Generated public static final FillNAMethod SUBSEQUENT = fromString("Subsequent"); - /** Static value Linear for FillNAMethod. */ + /** + * Static value Linear for FillNAMethod. + */ + @Generated public static final FillNAMethod LINEAR = fromString("Linear"); - /** Static value Zero for FillNAMethod. */ + /** + * Static value Zero for FillNAMethod. + */ + @Generated public static final FillNAMethod ZERO = fromString("Zero"); - /** Static value Fixed for FillNAMethod. */ + /** + * Static value Fixed for FillNAMethod. + */ + @Generated public static final FillNAMethod FIXED = fromString("Fixed"); /** @@ -32,8 +47,10 @@ public final class FillNAMethod extends ExpandableStringEnum { * * @deprecated Use the {@link #fromString(String)} factory method. */ + @Generated @Deprecated - public FillNAMethod() {} + public FillNAMethod() { + } /** * Creates or finds a FillNAMethod from its string representation. @@ -41,7 +58,7 @@ public FillNAMethod() {} * @param name a name to look for. * @return the corresponding FillNAMethod. */ - @JsonCreator + @Generated public static FillNAMethod fromString(String name) { return fromString(name, FillNAMethod.class); } @@ -51,6 +68,7 @@ public static FillNAMethod fromString(String name) { * * @return known FillNAMethod values. */ + @Generated public static Collection values() { return values(FillNAMethod.class); } diff --git a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/ImputeMode.java b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/ImputeMode.java index f1b4891086cb..ff0fe6cc8054 100644 --- a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/ImputeMode.java +++ b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/ImputeMode.java @@ -1,31 +1,51 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.anomalydetector.models; +import com.azure.core.annotation.Generated; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for ImputeMode. */ +/** + * Defines values for ImputeMode. + */ public final class ImputeMode extends ExpandableStringEnum { - /** Static value auto for ImputeMode. */ + + /** + * Static value auto for ImputeMode. + */ + @Generated public static final ImputeMode AUTO = fromString("auto"); - /** Static value previous for ImputeMode. */ + /** + * Static value previous for ImputeMode. + */ + @Generated public static final ImputeMode PREVIOUS = fromString("previous"); - /** Static value linear for ImputeMode. */ + /** + * Static value linear for ImputeMode. + */ + @Generated public static final ImputeMode LINEAR = fromString("linear"); - /** Static value fixed for ImputeMode. */ + /** + * Static value fixed for ImputeMode. + */ + @Generated public static final ImputeMode FIXED = fromString("fixed"); - /** Static value zero for ImputeMode. */ + /** + * Static value zero for ImputeMode. + */ + @Generated public static final ImputeMode ZERO = fromString("zero"); - /** Static value notFill for ImputeMode. */ + /** + * Static value notFill for ImputeMode. + */ + @Generated public static final ImputeMode NOT_FILL = fromString("notFill"); /** @@ -33,8 +53,10 @@ public final class ImputeMode extends ExpandableStringEnum { * * @deprecated Use the {@link #fromString(String)} factory method. */ + @Generated @Deprecated - public ImputeMode() {} + public ImputeMode() { + } /** * Creates or finds a ImputeMode from its string representation. @@ -42,7 +64,7 @@ public ImputeMode() {} * @param name a name to look for. * @return the corresponding ImputeMode. */ - @JsonCreator + @Generated public static ImputeMode fromString(String name) { return fromString(name, ImputeMode.class); } @@ -52,6 +74,7 @@ public static ImputeMode fromString(String name) { * * @return known ImputeMode values. */ + @Generated public static Collection values() { return values(ImputeMode.class); } diff --git a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/ModelInfo.java b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/ModelInfo.java index 0155a4c77ad0..158d18c70f29 100644 --- a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/ModelInfo.java +++ b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/ModelInfo.java @@ -1,83 +1,92 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.anomalydetector.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.annotation.Generated; +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; -/** Training result of a model including its status, errors and diagnostics information. */ +/** + * Training result of a model, including its status, errors, and diagnostics + * information. + */ @Fluent -public final class ModelInfo { +public final class ModelInfo implements JsonSerializable { + /* - * Source link to the input data to indicate an accessible Azure storage Uri, - * either pointed to an Azure blob storage folder, or pointed to a CSV file in - * Azure blob storage based on you data schema selection. + * Source link to the input data to indicate an accessible Azure Storage URI. + * It either points to an Azure Blob Storage folder or points to a CSV file in + * Azure Blob Storage, based on your data schema selection. */ - @JsonProperty(value = "dataSource", required = true) - private String dataSource; + @Generated + private final String dataSource; /* - * Data schema of input data source: OneTable or MultiTable. The default - * DataSchema is OneTable. + * Data schema of the input data source. The default + * is OneTable. */ - @JsonProperty(value = "dataSchema") + @Generated private DataSchema dataSchema; /* - * A required field, indicating the start time of training data, which should be - * date-time of ISO 8601 format. + * Start date/time of training data, which should be + * in ISO 8601 format. */ - @JsonProperty(value = "startTime", required = true) - private OffsetDateTime startTime; + @Generated + private final OffsetDateTime startTime; /* - * A required field, indicating the end time of training data, which should be - * date-time of ISO 8601 format. + * End date/time of training data, which should be + * in ISO 8601 format. */ - @JsonProperty(value = "endTime", required = true) - private OffsetDateTime endTime; + @Generated + private final OffsetDateTime endTime; /* - * An optional field. The display name of the model whose maximum length is 24 + * Display name of the model. Maximum length is 24 * characters. */ - @JsonProperty(value = "displayName") + @Generated private String displayName; /* - * An optional field, indicating how many previous timestamps will be used to - * detect whether the timestamp is anomaly or not. + * Number of previous time stamps that will be used to + * detect whether the time stamp is an anomaly or not. */ - @JsonProperty(value = "slidingWindow") + @Generated private Integer slidingWindow; /* - * An optional field, indicating the manner to align multiple variables. + * Manner of aligning multiple variables. */ - @JsonProperty(value = "alignPolicy") + @Generated private AlignPolicy alignPolicy; /* - * Model status. One of CREATED, RUNNING, READY, and FAILED. + * Model status. */ - @JsonProperty(value = "status") + @Generated private ModelStatus status; /* - * Error messages when failed to create a model. + * Error messages after failure to create a model. */ - @JsonProperty(value = "errors", access = JsonProperty.Access.WRITE_ONLY) + @Generated private List errors; /* - * Diagnostics information to help inspect the states of model or variable. + * Diagnostics information to help inspect the states of a model or variable. */ - @JsonProperty(value = "diagnosticsInfo") + @Generated private DiagnosticsInfo diagnosticsInfo; /** @@ -87,179 +96,250 @@ public final class ModelInfo { * @param startTime the startTime value to set. * @param endTime the endTime value to set. */ - @JsonCreator - public ModelInfo( - @JsonProperty(value = "dataSource", required = true) String dataSource, - @JsonProperty(value = "startTime", required = true) OffsetDateTime startTime, - @JsonProperty(value = "endTime", required = true) OffsetDateTime endTime) { + @Generated + public ModelInfo(String dataSource, OffsetDateTime startTime, OffsetDateTime endTime) { this.dataSource = dataSource; this.startTime = startTime; this.endTime = endTime; } /** - * Get the dataSource property: Source link to the input data to indicate an accessible Azure storage Uri, either - * pointed to an Azure blob storage folder, or pointed to a CSV file in Azure blob storage based on you data schema - * selection. + * Get the dataSource property: Source link to the input data to indicate an accessible Azure Storage URI. + * It either points to an Azure Blob Storage folder or points to a CSV file in + * Azure Blob Storage, based on your data schema selection. * * @return the dataSource value. */ + @Generated public String getDataSource() { return this.dataSource; } /** - * Get the dataSchema property: Data schema of input data source: OneTable or MultiTable. The default DataSchema is - * OneTable. + * Get the dataSchema property: Data schema of the input data source. The default + * is OneTable. * * @return the dataSchema value. */ + @Generated public DataSchema getDataSchema() { return this.dataSchema; } /** - * Set the dataSchema property: Data schema of input data source: OneTable or MultiTable. The default DataSchema is - * OneTable. + * Set the dataSchema property: Data schema of the input data source. The default + * is OneTable. * * @param dataSchema the dataSchema value to set. * @return the ModelInfo object itself. */ + @Generated public ModelInfo setDataSchema(DataSchema dataSchema) { this.dataSchema = dataSchema; return this; } /** - * Get the startTime property: A required field, indicating the start time of training data, which should be - * date-time of ISO 8601 format. + * Get the startTime property: Start date/time of training data, which should be + * in ISO 8601 format. * * @return the startTime value. */ + @Generated public OffsetDateTime getStartTime() { return this.startTime; } /** - * Get the endTime property: A required field, indicating the end time of training data, which should be date-time - * of ISO 8601 format. + * Get the endTime property: End date/time of training data, which should be + * in ISO 8601 format. * * @return the endTime value. */ + @Generated public OffsetDateTime getEndTime() { return this.endTime; } /** - * Get the displayName property: An optional field. The display name of the model whose maximum length is 24 + * Get the displayName property: Display name of the model. Maximum length is 24 * characters. * * @return the displayName value. */ + @Generated public String getDisplayName() { return this.displayName; } /** - * Set the displayName property: An optional field. The display name of the model whose maximum length is 24 + * Set the displayName property: Display name of the model. Maximum length is 24 * characters. * * @param displayName the displayName value to set. * @return the ModelInfo object itself. */ + @Generated public ModelInfo setDisplayName(String displayName) { this.displayName = displayName; return this; } /** - * Get the slidingWindow property: An optional field, indicating how many previous timestamps will be used to detect - * whether the timestamp is anomaly or not. + * Get the slidingWindow property: Number of previous time stamps that will be used to + * detect whether the time stamp is an anomaly or not. * * @return the slidingWindow value. */ + @Generated public Integer getSlidingWindow() { return this.slidingWindow; } /** - * Set the slidingWindow property: An optional field, indicating how many previous timestamps will be used to detect - * whether the timestamp is anomaly or not. + * Set the slidingWindow property: Number of previous time stamps that will be used to + * detect whether the time stamp is an anomaly or not. * * @param slidingWindow the slidingWindow value to set. * @return the ModelInfo object itself. */ + @Generated public ModelInfo setSlidingWindow(Integer slidingWindow) { this.slidingWindow = slidingWindow; return this; } /** - * Get the alignPolicy property: An optional field, indicating the manner to align multiple variables. + * Get the alignPolicy property: Manner of aligning multiple variables. * * @return the alignPolicy value. */ + @Generated public AlignPolicy getAlignPolicy() { return this.alignPolicy; } /** - * Set the alignPolicy property: An optional field, indicating the manner to align multiple variables. + * Set the alignPolicy property: Manner of aligning multiple variables. * * @param alignPolicy the alignPolicy value to set. * @return the ModelInfo object itself. */ + @Generated public ModelInfo setAlignPolicy(AlignPolicy alignPolicy) { this.alignPolicy = alignPolicy; return this; } /** - * Get the status property: Model status. One of CREATED, RUNNING, READY, and FAILED. + * Get the status property: Model status. * * @return the status value. */ + @Generated public ModelStatus getStatus() { return this.status; } /** - * Set the status property: Model status. One of CREATED, RUNNING, READY, and FAILED. - * - * @param status the status value to set. - * @return the ModelInfo object itself. - */ - public ModelInfo setStatus(ModelStatus status) { - this.status = status; - return this; - } - - /** - * Get the errors property: Error messages when failed to create a model. + * Get the errors property: Error messages after failure to create a model. * * @return the errors value. */ + @Generated public List getErrors() { return this.errors; } /** - * Get the diagnosticsInfo property: Diagnostics information to help inspect the states of model or variable. + * Get the diagnosticsInfo property: Diagnostics information to help inspect the states of a model or variable. * * @return the diagnosticsInfo value. */ + @Generated public DiagnosticsInfo getDiagnosticsInfo() { return this.diagnosticsInfo; } /** - * Set the diagnosticsInfo property: Diagnostics information to help inspect the states of model or variable. + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("dataSource", this.dataSource); + 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.writeStringField("dataSchema", this.dataSchema == null ? null : this.dataSchema.toString()); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeNumberField("slidingWindow", this.slidingWindow); + jsonWriter.writeJsonField("alignPolicy", this.alignPolicy); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ModelInfo from the JsonReader. * - * @param diagnosticsInfo the diagnosticsInfo value to set. - * @return the ModelInfo object itself. + * @param jsonReader The JsonReader being read. + * @return An instance of ModelInfo 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 ModelInfo. */ - public ModelInfo setDiagnosticsInfo(DiagnosticsInfo diagnosticsInfo) { - this.diagnosticsInfo = diagnosticsInfo; - return this; + @Generated + public static ModelInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String dataSource = null; + OffsetDateTime startTime = null; + OffsetDateTime endTime = null; + DataSchema dataSchema = null; + String displayName = null; + Integer slidingWindow = null; + AlignPolicy alignPolicy = null; + ModelStatus status = null; + List errors = null; + DiagnosticsInfo diagnosticsInfo = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("dataSource".equals(fieldName)) { + dataSource = reader.getString(); + } else if ("startTime".equals(fieldName)) { + startTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("endTime".equals(fieldName)) { + endTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("dataSchema".equals(fieldName)) { + dataSchema = DataSchema.fromString(reader.getString()); + } else if ("displayName".equals(fieldName)) { + displayName = reader.getString(); + } else if ("slidingWindow".equals(fieldName)) { + slidingWindow = reader.getNullable(JsonReader::getInt); + } else if ("alignPolicy".equals(fieldName)) { + alignPolicy = AlignPolicy.fromJson(reader); + } else if ("status".equals(fieldName)) { + status = ModelStatus.fromString(reader.getString()); + } else if ("errors".equals(fieldName)) { + errors = reader.readArray(reader1 -> ErrorResponse.fromJson(reader1)); + } else if ("diagnosticsInfo".equals(fieldName)) { + diagnosticsInfo = DiagnosticsInfo.fromJson(reader); + } else { + reader.skipChildren(); + } + } + ModelInfo deserializedModelInfo = new ModelInfo(dataSource, startTime, endTime); + deserializedModelInfo.dataSchema = dataSchema; + deserializedModelInfo.displayName = displayName; + deserializedModelInfo.slidingWindow = slidingWindow; + deserializedModelInfo.alignPolicy = alignPolicy; + deserializedModelInfo.status = status; + deserializedModelInfo.errors = errors; + deserializedModelInfo.diagnosticsInfo = diagnosticsInfo; + return deserializedModelInfo; + }); } } diff --git a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/ModelState.java b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/ModelState.java index fcf914eb63b8..fcd48eb71007 100644 --- a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/ModelState.java +++ b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/ModelState.java @@ -1,127 +1,148 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.anomalydetector.models; -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.annotation.Generated; +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; import java.util.List; -/** Model status. */ -@Fluent -public final class ModelState { +/** + * Model status. + */ +@Immutable +public final class ModelState implements JsonSerializable { + /* - * This indicates the number of passes of the entire training dataset the + * Number of passes of the entire training dataset that the * algorithm has completed. */ - @JsonProperty(value = "epochIds") + @Generated private List epochIds; /* * List of metrics used to assess how the model fits the training data for each * epoch. */ - @JsonProperty(value = "trainLosses") + @Generated private List trainLosses; /* * List of metrics used to assess how the model fits the validation set for each * epoch. */ - @JsonProperty(value = "validationLosses") + @Generated private List validationLosses; /* * Latency for each epoch. */ - @JsonProperty(value = "latenciesInSeconds") + @Generated private List latenciesInSeconds; - /** Creates an instance of ModelState class. */ - public ModelState() {} - /** - * Get the epochIds property: This indicates the number of passes of the entire training dataset the algorithm has - * completed. - * - * @return the epochIds value. + * Creates an instance of ModelState class. */ - public List getEpochIds() { - return this.epochIds; + @Generated + private ModelState() { } /** - * Set the epochIds property: This indicates the number of passes of the entire training dataset the algorithm has - * completed. + * Get the epochIds property: Number of passes of the entire training dataset that the + * algorithm has completed. * - * @param epochIds the epochIds value to set. - * @return the ModelState object itself. + * @return the epochIds value. */ - public ModelState setEpochIds(List epochIds) { - this.epochIds = epochIds; - return this; + @Generated + public List getEpochIds() { + return this.epochIds; } /** - * Get the trainLosses property: List of metrics used to assess how the model fits the training data for each epoch. + * Get the trainLosses property: List of metrics used to assess how the model fits the training data for each + * epoch. * * @return the trainLosses value. */ + @Generated public List getTrainLosses() { return this.trainLosses; } - /** - * Set the trainLosses property: List of metrics used to assess how the model fits the training data for each epoch. - * - * @param trainLosses the trainLosses value to set. - * @return the ModelState object itself. - */ - public ModelState setTrainLosses(List trainLosses) { - this.trainLosses = trainLosses; - return this; - } - /** * Get the validationLosses property: List of metrics used to assess how the model fits the validation set for each * epoch. * * @return the validationLosses value. */ + @Generated public List getValidationLosses() { return this.validationLosses; } - /** - * Set the validationLosses property: List of metrics used to assess how the model fits the validation set for each - * epoch. - * - * @param validationLosses the validationLosses value to set. - * @return the ModelState object itself. - */ - public ModelState setValidationLosses(List validationLosses) { - this.validationLosses = validationLosses; - return this; - } - /** * Get the latenciesInSeconds property: Latency for each epoch. * * @return the latenciesInSeconds value. */ + @Generated public List getLatenciesInSeconds() { return this.latenciesInSeconds; } /** - * Set the latenciesInSeconds property: Latency for each epoch. + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("epochIds", this.epochIds, (writer, element) -> writer.writeInt(element)); + jsonWriter.writeArrayField("trainLosses", this.trainLosses, (writer, element) -> writer.writeDouble(element)); + jsonWriter.writeArrayField("validationLosses", this.validationLosses, + (writer, element) -> writer.writeDouble(element)); + jsonWriter.writeArrayField("latenciesInSeconds", this.latenciesInSeconds, + (writer, element) -> writer.writeDouble(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ModelState from the JsonReader. * - * @param latenciesInSeconds the latenciesInSeconds value to set. - * @return the ModelState object itself. + * @param jsonReader The JsonReader being read. + * @return An instance of ModelState if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the ModelState. */ - public ModelState setLatenciesInSeconds(List latenciesInSeconds) { - this.latenciesInSeconds = latenciesInSeconds; - return this; + @Generated + public static ModelState fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ModelState deserializedModelState = new ModelState(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("epochIds".equals(fieldName)) { + List epochIds = reader.readArray(reader1 -> reader1.getInt()); + deserializedModelState.epochIds = epochIds; + } else if ("trainLosses".equals(fieldName)) { + List trainLosses = reader.readArray(reader1 -> reader1.getDouble()); + deserializedModelState.trainLosses = trainLosses; + } else if ("validationLosses".equals(fieldName)) { + List validationLosses = reader.readArray(reader1 -> reader1.getDouble()); + deserializedModelState.validationLosses = validationLosses; + } else if ("latenciesInSeconds".equals(fieldName)) { + List latenciesInSeconds = reader.readArray(reader1 -> reader1.getDouble()); + deserializedModelState.latenciesInSeconds = latenciesInSeconds; + } else { + reader.skipChildren(); + } + } + return deserializedModelState; + }); } } diff --git a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/ModelStatus.java b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/ModelStatus.java index 2ff7519fd5d9..3e7446e393d6 100644 --- a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/ModelStatus.java +++ b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/ModelStatus.java @@ -1,57 +1,69 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.anomalydetector.models; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; -/** Defines values for ModelStatus. */ -public enum ModelStatus { - /** Enum value CREATED. */ - CREATED("CREATED"), +/** + * Defines values for ModelStatus. + */ +public final class ModelStatus extends ExpandableStringEnum { - /** Enum value RUNNING. */ - RUNNING("RUNNING"), + /** + * The model has been created. Training has been scheduled but not yet started. + */ + @Generated + public static final ModelStatus CREATED = fromString("CREATED"); - /** Enum value READY. */ - READY("READY"), + /** + * The model is being trained. + */ + @Generated + public static final ModelStatus RUNNING = fromString("RUNNING"); - /** Enum value FAILED. */ - FAILED("FAILED"); + /** + * The model has been trained and is ready to be used for anomaly detection. + */ + @Generated + public static final ModelStatus READY = fromString("READY"); - /** The actual serialized value for a ModelStatus instance. */ - private final String value; + /** + * The model training failed. + */ + @Generated + public static final ModelStatus FAILED = fromString("FAILED"); - ModelStatus(String value) { - this.value = value; + /** + * Creates a new instance of ModelStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public ModelStatus() { } /** - * Parses a serialized value to a ModelStatus instance. + * Creates or finds a ModelStatus from its string representation. * - * @param value the serialized value to parse. - * @return the parsed ModelStatus object, or null if unable to parse. + * @param name a name to look for. + * @return the corresponding ModelStatus. */ - @JsonCreator - public static ModelStatus fromString(String value) { - if (value == null) { - return null; - } - ModelStatus[] items = ModelStatus.values(); - for (ModelStatus item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; + @Generated + public static ModelStatus fromString(String name) { + return fromString(name, ModelStatus.class); } - /** {@inheritDoc} */ - @JsonValue - @Override - public String toString() { - return this.value; + /** + * Gets known ModelStatus values. + * + * @return known ModelStatus values. + */ + @Generated + public static Collection values() { + return values(ModelStatus.class); } } diff --git a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/MultivariateBatchDetectionOptions.java b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/MultivariateBatchDetectionOptions.java index 040382c0f001..009a6cbce507 100644 --- a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/MultivariateBatchDetectionOptions.java +++ b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/MultivariateBatchDetectionOptions.java @@ -1,109 +1,185 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.anomalydetector.models; -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +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; /** - * Detection request for batch inference. This is an asynchronous inference which will need another API to get detection - * results. + * Detection request for batch inference. This is an asynchronous inference that + * will need another API to get detection results. */ -@Immutable -public final class MultivariateBatchDetectionOptions { +@Fluent +public final class MultivariateBatchDetectionOptions implements JsonSerializable { + /* - * Source link to the input data to indicate an accessible Azure storage Uri, - * either pointed to an Azure blob storage folder, or pointed to a CSV file in - * Azure blob storage based on you data schema selection. The data schema should - * be exactly the same with those used in the training phase. + * Source link to the input data to indicate an accessible Azure Storage URI. + * It either points to an Azure Blob Storage folder or points to a CSV file in + * Azure Blob Storage, based on your data schema selection. The data schema should + * be exactly the same as those used in the training phase. The input data must + * contain at least slidingWindow entries preceding the start time of the data + * to be detected. */ - @JsonProperty(value = "dataSource", required = true) - private String dataSource; + @Generated + private final String dataSource; /* - * An optional field, which is used to specify the number of top contributed - * variables for one anomalous timestamp in the response. The default number is - * 10. + * Number of top contributed variables for one anomalous time stamp in the response. */ - @JsonProperty(value = "topContributorCount", required = true) - private int topContributorCount; + @Generated + private Integer topContributorCount; /* - * A required field, indicating the start time of data for detection, which should - * be date-time of ISO 8601 format. + * Start date/time of data for detection, which should + * be in ISO 8601 format. */ - @JsonProperty(value = "startTime", required = true) - private OffsetDateTime startTime; + @Generated + private final OffsetDateTime startTime; /* - * A required field, indicating the end time of data for detection, which should - * be date-time of ISO 8601 format. + * End date/time of data for detection, which should + * be in ISO 8601 format. */ - @JsonProperty(value = "endTime", required = true) - private OffsetDateTime endTime; + @Generated + private final OffsetDateTime endTime; /** * Creates an instance of MultivariateBatchDetectionOptions class. * * @param dataSource the dataSource value to set. - * @param topContributorCount the topContributorCount value to set. * @param startTime the startTime value to set. * @param endTime the endTime value to set. */ - @JsonCreator - public MultivariateBatchDetectionOptions( - @JsonProperty(value = "dataSource", required = true) String dataSource, - @JsonProperty(value = "topContributorCount", required = true) int topContributorCount, - @JsonProperty(value = "startTime", required = true) OffsetDateTime startTime, - @JsonProperty(value = "endTime", required = true) OffsetDateTime endTime) { + @Generated + public MultivariateBatchDetectionOptions(String dataSource, OffsetDateTime startTime, OffsetDateTime endTime) { this.dataSource = dataSource; - this.topContributorCount = topContributorCount; this.startTime = startTime; this.endTime = endTime; } /** - * Get the dataSource property: Source link to the input data to indicate an accessible Azure storage Uri, either - * pointed to an Azure blob storage folder, or pointed to a CSV file in Azure blob storage based on you data schema - * selection. The data schema should be exactly the same with those used in the training phase. + * Get the dataSource property: Source link to the input data to indicate an accessible Azure Storage URI. + * It either points to an Azure Blob Storage folder or points to a CSV file in + * Azure Blob Storage, based on your data schema selection. The data schema should + * be exactly the same as those used in the training phase. The input data must + * contain at least slidingWindow entries preceding the start time of the data + * to be detected. * * @return the dataSource value. */ + @Generated public String getDataSource() { return this.dataSource; } /** - * Get the topContributorCount property: An optional field, which is used to specify the number of top contributed - * variables for one anomalous timestamp in the response. The default number is 10. + * Get the topContributorCount property: Number of top contributed variables for one anomalous time stamp in the + * response. * * @return the topContributorCount value. */ - public int getTopContributorCount() { + @Generated + public Integer getTopContributorCount() { return this.topContributorCount; } /** - * Get the startTime property: A required field, indicating the start time of data for detection, which should be - * date-time of ISO 8601 format. + * Set the topContributorCount property: Number of top contributed variables for one anomalous time stamp in the + * response. + * + * @param topContributorCount the topContributorCount value to set. + * @return the MultivariateBatchDetectionOptions object itself. + */ + @Generated + public MultivariateBatchDetectionOptions setTopContributorCount(Integer topContributorCount) { + this.topContributorCount = topContributorCount; + return this; + } + + /** + * Get the startTime property: Start date/time of data for detection, which should + * be in ISO 8601 format. * * @return the startTime value. */ + @Generated public OffsetDateTime getStartTime() { return this.startTime; } /** - * Get the endTime property: A required field, indicating the end time of data for detection, which should be - * date-time of ISO 8601 format. + * Get the endTime property: End date/time of data for detection, which should + * be in ISO 8601 format. * * @return the endTime value. */ + @Generated public OffsetDateTime getEndTime() { return this.endTime; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("dataSource", this.dataSource); + 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.writeNumberField("topContributorCount", this.topContributorCount); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MultivariateBatchDetectionOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MultivariateBatchDetectionOptions 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 MultivariateBatchDetectionOptions. + */ + @Generated + public static MultivariateBatchDetectionOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String dataSource = null; + OffsetDateTime startTime = null; + OffsetDateTime endTime = null; + Integer topContributorCount = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("dataSource".equals(fieldName)) { + dataSource = reader.getString(); + } else if ("startTime".equals(fieldName)) { + startTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("endTime".equals(fieldName)) { + endTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("topContributorCount".equals(fieldName)) { + topContributorCount = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + MultivariateBatchDetectionOptions deserializedMultivariateBatchDetectionOptions + = new MultivariateBatchDetectionOptions(dataSource, startTime, endTime); + deserializedMultivariateBatchDetectionOptions.topContributorCount = topContributorCount; + return deserializedMultivariateBatchDetectionOptions; + }); + } } diff --git a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/MultivariateBatchDetectionResultSummary.java b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/MultivariateBatchDetectionResultSummary.java index 10b62cc16da5..e9bbcf71dddf 100644 --- a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/MultivariateBatchDetectionResultSummary.java +++ b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/MultivariateBatchDetectionResultSummary.java @@ -1,41 +1,48 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.anomalydetector.models; +import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.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; -/** Multivariate anomaly detection status. */ +/** + * Multivariate anomaly detection status. + */ @Immutable -public final class MultivariateBatchDetectionResultSummary { +public final class MultivariateBatchDetectionResultSummary + implements JsonSerializable { + /* - * Status of detection results. One of CREATED, RUNNING, READY, and FAILED. + * Status of detection results. */ - @JsonProperty(value = "status", required = true) - private MultivariateBatchDetectionStatus status; + @Generated + private final MultivariateBatchDetectionStatus status; /* - * Error message when detection is failed. + * Error message when detection fails. */ - @JsonProperty(value = "errors") + @Generated private List errors; /* - * Variable Status. + * Variable status. */ - @JsonProperty(value = "variableStates") + @Generated private List variableStates; /* - * Detection request for batch inference. This is an asynchronous inference which + * Detection request for batch inference. This is an asynchronous inference that * will need another API to get detection results. */ - @JsonProperty(value = "setupInfo", required = true) - private MultivariateBatchDetectionOptions setupInfo; + @Generated + private final MultivariateBatchDetectionOptions setupInfo; /** * Creates an instance of MultivariateBatchDetectionResultSummary class. @@ -43,48 +50,105 @@ public final class MultivariateBatchDetectionResultSummary { * @param status the status value to set. * @param setupInfo the setupInfo value to set. */ - @JsonCreator - private MultivariateBatchDetectionResultSummary( - @JsonProperty(value = "status", required = true) MultivariateBatchDetectionStatus status, - @JsonProperty(value = "setupInfo", required = true) MultivariateBatchDetectionOptions setupInfo) { + @Generated + private MultivariateBatchDetectionResultSummary(MultivariateBatchDetectionStatus status, + MultivariateBatchDetectionOptions setupInfo) { this.status = status; this.setupInfo = setupInfo; } /** - * Get the status property: Status of detection results. One of CREATED, RUNNING, READY, and FAILED. + * Get the status property: Status of detection results. * * @return the status value. */ + @Generated public MultivariateBatchDetectionStatus getStatus() { return this.status; } /** - * Get the errors property: Error message when detection is failed. + * Get the errors property: Error message when detection fails. * * @return the errors value. */ + @Generated public List getErrors() { return this.errors; } /** - * Get the variableStates property: Variable Status. + * Get the variableStates property: Variable status. * * @return the variableStates value. */ + @Generated public List getVariableStates() { return this.variableStates; } /** - * Get the setupInfo property: Detection request for batch inference. This is an asynchronous inference which will - * need another API to get detection results. + * Get the setupInfo property: Detection request for batch inference. This is an asynchronous inference that + * will need another API to get detection results. * * @return the setupInfo value. */ + @Generated public MultivariateBatchDetectionOptions getSetupInfo() { return this.setupInfo; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeJsonField("setupInfo", this.setupInfo); + jsonWriter.writeArrayField("errors", this.errors, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("variableStates", this.variableStates, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MultivariateBatchDetectionResultSummary from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MultivariateBatchDetectionResultSummary 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 MultivariateBatchDetectionResultSummary. + */ + @Generated + public static MultivariateBatchDetectionResultSummary fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MultivariateBatchDetectionStatus status = null; + MultivariateBatchDetectionOptions setupInfo = null; + List errors = null; + List variableStates = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("status".equals(fieldName)) { + status = MultivariateBatchDetectionStatus.fromString(reader.getString()); + } else if ("setupInfo".equals(fieldName)) { + setupInfo = MultivariateBatchDetectionOptions.fromJson(reader); + } else if ("errors".equals(fieldName)) { + errors = reader.readArray(reader1 -> ErrorResponse.fromJson(reader1)); + } else if ("variableStates".equals(fieldName)) { + variableStates = reader.readArray(reader1 -> VariableState.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + MultivariateBatchDetectionResultSummary deserializedMultivariateBatchDetectionResultSummary + = new MultivariateBatchDetectionResultSummary(status, setupInfo); + deserializedMultivariateBatchDetectionResultSummary.errors = errors; + deserializedMultivariateBatchDetectionResultSummary.variableStates = variableStates; + return deserializedMultivariateBatchDetectionResultSummary; + }); + } } diff --git a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/MultivariateBatchDetectionStatus.java b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/MultivariateBatchDetectionStatus.java index c3f17996f22c..bffa19933777 100644 --- a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/MultivariateBatchDetectionStatus.java +++ b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/MultivariateBatchDetectionStatus.java @@ -1,57 +1,69 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.anomalydetector.models; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; -/** Defines values for MultivariateBatchDetectionStatus. */ -public enum MultivariateBatchDetectionStatus { - /** Enum value CREATED. */ - CREATED("CREATED"), +/** + * Defines values for MultivariateBatchDetectionStatus. + */ +public final class MultivariateBatchDetectionStatus extends ExpandableStringEnum { - /** Enum value RUNNING. */ - RUNNING("RUNNING"), + /** + * Static value CREATED for MultivariateBatchDetectionStatus. + */ + @Generated + public static final MultivariateBatchDetectionStatus CREATED = fromString("CREATED"); - /** Enum value READY. */ - READY("READY"), + /** + * Static value RUNNING for MultivariateBatchDetectionStatus. + */ + @Generated + public static final MultivariateBatchDetectionStatus RUNNING = fromString("RUNNING"); - /** Enum value FAILED. */ - FAILED("FAILED"); + /** + * Static value READY for MultivariateBatchDetectionStatus. + */ + @Generated + public static final MultivariateBatchDetectionStatus READY = fromString("READY"); - /** The actual serialized value for a MultivariateBatchDetectionStatus instance. */ - private final String value; + /** + * Static value FAILED for MultivariateBatchDetectionStatus. + */ + @Generated + public static final MultivariateBatchDetectionStatus FAILED = fromString("FAILED"); - MultivariateBatchDetectionStatus(String value) { - this.value = value; + /** + * Creates a new instance of MultivariateBatchDetectionStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public MultivariateBatchDetectionStatus() { } /** - * Parses a serialized value to a MultivariateBatchDetectionStatus instance. + * Creates or finds a MultivariateBatchDetectionStatus from its string representation. * - * @param value the serialized value to parse. - * @return the parsed MultivariateBatchDetectionStatus object, or null if unable to parse. + * @param name a name to look for. + * @return the corresponding MultivariateBatchDetectionStatus. */ - @JsonCreator - public static MultivariateBatchDetectionStatus fromString(String value) { - if (value == null) { - return null; - } - MultivariateBatchDetectionStatus[] items = MultivariateBatchDetectionStatus.values(); - for (MultivariateBatchDetectionStatus item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; + @Generated + public static MultivariateBatchDetectionStatus fromString(String name) { + return fromString(name, MultivariateBatchDetectionStatus.class); } - /** {@inheritDoc} */ - @JsonValue - @Override - public String toString() { - return this.value; + /** + * Gets known MultivariateBatchDetectionStatus values. + * + * @return known MultivariateBatchDetectionStatus values. + */ + @Generated + public static Collection values() { + return values(MultivariateBatchDetectionStatus.class); } } diff --git a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/MultivariateDetectionResult.java b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/MultivariateDetectionResult.java index aa2938743296..5292d8eb9ff3 100644 --- a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/MultivariateDetectionResult.java +++ b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/MultivariateDetectionResult.java @@ -1,34 +1,40 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.anomalydetector.models; +import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.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; -/** Detection results for the given resultId. */ +/** + * Detection results for the resultId value. + */ @Immutable -public final class MultivariateDetectionResult { +public final class MultivariateDetectionResult implements JsonSerializable { + /* - * Result identifier, which is used to fetch the results of an inference call. + * Result identifier that's used to fetch the results of an inference call. */ - @JsonProperty(value = "resultId", required = true, access = JsonProperty.Access.WRITE_ONLY) + @Generated private String resultId; /* * Multivariate anomaly detection status. */ - @JsonProperty(value = "summary", required = true) - private MultivariateBatchDetectionResultSummary summary; + @Generated + private final MultivariateBatchDetectionResultSummary summary; /* - * Detection result for each timestamp. + * Detection result for each time stamp. */ - @JsonProperty(value = "results", required = true) - private List results; + @Generated + private final List results; /** * Creates an instance of MultivariateDetectionResult class. @@ -36,19 +42,18 @@ public final class MultivariateDetectionResult { * @param summary the summary value to set. * @param results the results value to set. */ - @JsonCreator - private MultivariateDetectionResult( - @JsonProperty(value = "summary", required = true) MultivariateBatchDetectionResultSummary summary, - @JsonProperty(value = "results", required = true) List results) { + @Generated + private MultivariateDetectionResult(MultivariateBatchDetectionResultSummary summary, List results) { this.summary = summary; this.results = results; } /** - * Get the resultId property: Result identifier, which is used to fetch the results of an inference call. + * Get the resultId property: Result identifier that's used to fetch the results of an inference call. * * @return the resultId value. */ + @Generated public String getResultId() { return this.resultId; } @@ -58,16 +63,65 @@ public String getResultId() { * * @return the summary value. */ + @Generated public MultivariateBatchDetectionResultSummary getSummary() { return this.summary; } /** - * Get the results property: Detection result for each timestamp. + * Get the results property: Detection result for each time stamp. * * @return the results value. */ + @Generated public List getResults() { return this.results; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("summary", this.summary); + jsonWriter.writeArrayField("results", this.results, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MultivariateDetectionResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MultivariateDetectionResult 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 MultivariateDetectionResult. + */ + @Generated + public static MultivariateDetectionResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String resultId = null; + MultivariateBatchDetectionResultSummary summary = null; + List results = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("resultId".equals(fieldName)) { + resultId = reader.getString(); + } else if ("summary".equals(fieldName)) { + summary = MultivariateBatchDetectionResultSummary.fromJson(reader); + } else if ("results".equals(fieldName)) { + results = reader.readArray(reader1 -> AnomalyState.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + MultivariateDetectionResult deserializedMultivariateDetectionResult + = new MultivariateDetectionResult(summary, results); + deserializedMultivariateDetectionResult.resultId = resultId; + return deserializedMultivariateDetectionResult; + }); + } } diff --git a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/MultivariateLastDetectionOptions.java b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/MultivariateLastDetectionOptions.java index faf9d874b8fb..89071e0651b3 100644 --- a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/MultivariateLastDetectionOptions.java +++ b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/MultivariateLastDetectionOptions.java @@ -1,63 +1,126 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.anomalydetector.models; -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.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; -/** Request of last detection. */ -@Immutable -public final class MultivariateLastDetectionOptions { +/** + * Request of the last detection. + */ +@Fluent +public final class MultivariateLastDetectionOptions implements JsonSerializable { + /* - * This contains the inference data, including the name, timestamps(ISO 8601) and + * Contains the inference data, including the name, time stamps (ISO 8601), and * values of variables. */ - @JsonProperty(value = "variables", required = true) - private List variables; + @Generated + private final List variables; /* - * An optional field, which is used to specify the number of top contributed - * variables for one anomalous timestamp in the response. The default number is + * Number of top contributed + * variables for one anomalous time stamp in the response. The default is * 10. */ - @JsonProperty(value = "topContributorCount", required = true) - private int topContributorCount; + @Generated + private Integer topContributorCount; /** * Creates an instance of MultivariateLastDetectionOptions class. * * @param variables the variables value to set. - * @param topContributorCount the topContributorCount value to set. */ - @JsonCreator - public MultivariateLastDetectionOptions( - @JsonProperty(value = "variables", required = true) List variables, - @JsonProperty(value = "topContributorCount", required = true) int topContributorCount) { + @Generated + public MultivariateLastDetectionOptions(List variables) { this.variables = variables; - this.topContributorCount = topContributorCount; } /** - * Get the variables property: This contains the inference data, including the name, timestamps(ISO 8601) and values - * of variables. + * Get the variables property: Contains the inference data, including the name, time stamps (ISO 8601), and + * values of variables. * * @return the variables value. */ + @Generated public List getVariables() { return this.variables; } /** - * Get the topContributorCount property: An optional field, which is used to specify the number of top contributed - * variables for one anomalous timestamp in the response. The default number is 10. + * Get the topContributorCount property: Number of top contributed + * variables for one anomalous time stamp in the response. The default is + * 10. * * @return the topContributorCount value. */ - public int getTopContributorCount() { + @Generated + public Integer getTopContributorCount() { return this.topContributorCount; } + + /** + * Set the topContributorCount property: Number of top contributed + * variables for one anomalous time stamp in the response. The default is + * 10. + * + * @param topContributorCount the topContributorCount value to set. + * @return the MultivariateLastDetectionOptions object itself. + */ + @Generated + public MultivariateLastDetectionOptions setTopContributorCount(Integer topContributorCount) { + this.topContributorCount = topContributorCount; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("variables", this.variables, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeNumberField("topContributorCount", this.topContributorCount); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MultivariateLastDetectionOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MultivariateLastDetectionOptions 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 MultivariateLastDetectionOptions. + */ + @Generated + public static MultivariateLastDetectionOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + List variables = null; + Integer topContributorCount = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("variables".equals(fieldName)) { + variables = reader.readArray(reader1 -> VariableValues.fromJson(reader1)); + } else if ("topContributorCount".equals(fieldName)) { + topContributorCount = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + MultivariateLastDetectionOptions deserializedMultivariateLastDetectionOptions + = new MultivariateLastDetectionOptions(variables); + deserializedMultivariateLastDetectionOptions.topContributorCount = topContributorCount; + return deserializedMultivariateLastDetectionOptions; + }); + } } diff --git a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/MultivariateLastDetectionResult.java b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/MultivariateLastDetectionResult.java index 356567313ae6..edbfdb80ae3d 100644 --- a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/MultivariateLastDetectionResult.java +++ b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/MultivariateLastDetectionResult.java @@ -1,36 +1,48 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.anomalydetector.models; +import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.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; -/** Results of last detection. */ +/** + * Results of the last detection. + */ @Immutable -public final class MultivariateLastDetectionResult { +public final class MultivariateLastDetectionResult implements JsonSerializable { + /* - * Variable Status. + * Variable status. */ - @JsonProperty(value = "variableStates") + @Generated private List variableStates; /* * Anomaly status and information. */ - @JsonProperty(value = "results") + @Generated private List results; - /** Creates an instance of MultivariateLastDetectionResult class. */ - private MultivariateLastDetectionResult() {} + /** + * Creates an instance of MultivariateLastDetectionResult class. + */ + @Generated + private MultivariateLastDetectionResult() { + } /** - * Get the variableStates property: Variable Status. + * Get the variableStates property: Variable status. * * @return the variableStates value. */ + @Generated public List getVariableStates() { return this.variableStates; } @@ -40,7 +52,51 @@ public List getVariableStates() { * * @return the results value. */ + @Generated public List getResults() { return this.results; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("variableStates", this.variableStates, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("results", this.results, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MultivariateLastDetectionResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MultivariateLastDetectionResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MultivariateLastDetectionResult. + */ + @Generated + public static MultivariateLastDetectionResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MultivariateLastDetectionResult deserializedMultivariateLastDetectionResult + = new MultivariateLastDetectionResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("variableStates".equals(fieldName)) { + List variableStates = reader.readArray(reader1 -> VariableState.fromJson(reader1)); + deserializedMultivariateLastDetectionResult.variableStates = variableStates; + } else if ("results".equals(fieldName)) { + List results = reader.readArray(reader1 -> AnomalyState.fromJson(reader1)); + deserializedMultivariateLastDetectionResult.results = results; + } else { + reader.skipChildren(); + } + } + return deserializedMultivariateLastDetectionResult; + }); + } } diff --git a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/TimeGranularity.java b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/TimeGranularity.java index fea416ba0eca..d63bbd0eea0a 100644 --- a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/TimeGranularity.java +++ b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/TimeGranularity.java @@ -1,72 +1,99 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.anomalydetector.models; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; -/** Defines values for TimeGranularity. */ -public enum TimeGranularity { - /** Enum value yearly. */ - YEARLY("yearly"), +/** + * Defines values for TimeGranularity. + */ +public final class TimeGranularity extends ExpandableStringEnum { - /** Enum value monthly. */ - MONTHLY("monthly"), + /** + * Static value yearly for TimeGranularity. + */ + @Generated + public static final TimeGranularity YEARLY = fromString("yearly"); - /** Enum value weekly. */ - WEEKLY("weekly"), + /** + * Static value monthly for TimeGranularity. + */ + @Generated + public static final TimeGranularity MONTHLY = fromString("monthly"); - /** Enum value daily. */ - DAILY("daily"), + /** + * Static value weekly for TimeGranularity. + */ + @Generated + public static final TimeGranularity WEEKLY = fromString("weekly"); - /** Enum value hourly. */ - HOURLY("hourly"), + /** + * Static value daily for TimeGranularity. + */ + @Generated + public static final TimeGranularity DAILY = fromString("daily"); - /** Enum value minutely. */ - PER_MINUTE("minutely"), + /** + * Static value hourly for TimeGranularity. + */ + @Generated + public static final TimeGranularity HOURLY = fromString("hourly"); - /** Enum value secondly. */ - PER_SECOND("secondly"), + /** + * Static value minutely for TimeGranularity. + */ + @Generated + public static final TimeGranularity PER_MINUTE = fromString("minutely"); - /** Enum value microsecond. */ - MICROSECOND("microsecond"), + /** + * Static value secondly for TimeGranularity. + */ + @Generated + public static final TimeGranularity PER_SECOND = fromString("secondly"); - /** Enum value none. */ - NONE("none"); + /** + * Static value microsecond for TimeGranularity. + */ + @Generated + public static final TimeGranularity MICROSECOND = fromString("microsecond"); - /** The actual serialized value for a TimeGranularity instance. */ - private final String value; + /** + * Static value none for TimeGranularity. + */ + @Generated + public static final TimeGranularity NONE = fromString("none"); - TimeGranularity(String value) { - this.value = value; + /** + * Creates a new instance of TimeGranularity value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public TimeGranularity() { } /** - * Parses a serialized value to a TimeGranularity instance. + * Creates or finds a TimeGranularity from its string representation. * - * @param value the serialized value to parse. - * @return the parsed TimeGranularity object, or null if unable to parse. + * @param name a name to look for. + * @return the corresponding TimeGranularity. */ - @JsonCreator - public static TimeGranularity fromString(String value) { - if (value == null) { - return null; - } - TimeGranularity[] items = TimeGranularity.values(); - for (TimeGranularity item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; + @Generated + public static TimeGranularity fromString(String name) { + return fromString(name, TimeGranularity.class); } - /** {@inheritDoc} */ - @JsonValue - @Override - public String toString() { - return this.value; + /** + * Gets known TimeGranularity values. + * + * @return known TimeGranularity values. + */ + @Generated + public static Collection values() { + return values(TimeGranularity.class); } } diff --git a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/TimeSeriesPoint.java b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/TimeSeriesPoint.java index e4cf70e77a62..5c0e920b704e 100644 --- a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/TimeSeriesPoint.java +++ b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/TimeSeriesPoint.java @@ -1,65 +1,121 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.anomalydetector.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.annotation.Generated; +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; -/** The definition of input timeseries points. */ +/** + * Definition of input time series points. + */ @Fluent -public final class TimeSeriesPoint { +public final class TimeSeriesPoint implements JsonSerializable { + /* - * Optional argument, timestamp of a data point (ISO8601 format). + * Argument that indicates the time stamp of a data point (ISO8601 format). */ - @JsonProperty(value = "timestamp") + @Generated private OffsetDateTime timestamp; /* - * The measurement of that point, should be float. + * Measurement of that point. */ - @JsonProperty(value = "value", required = true) - private double value; + @Generated + private final double value; /** * Creates an instance of TimeSeriesPoint class. * * @param value the value value to set. */ - @JsonCreator - public TimeSeriesPoint(@JsonProperty(value = "value", required = true) double value) { + @Generated + public TimeSeriesPoint(double value) { this.value = value; } /** - * Get the timestamp property: Optional argument, timestamp of a data point (ISO8601 format). + * Get the timestamp property: Argument that indicates the time stamp of a data point (ISO8601 format). * * @return the timestamp value. */ + @Generated public OffsetDateTime getTimestamp() { return this.timestamp; } /** - * Set the timestamp property: Optional argument, timestamp of a data point (ISO8601 format). + * Set the timestamp property: Argument that indicates the time stamp of a data point (ISO8601 format). * * @param timestamp the timestamp value to set. * @return the TimeSeriesPoint object itself. */ + @Generated public TimeSeriesPoint setTimestamp(OffsetDateTime timestamp) { this.timestamp = timestamp; return this; } /** - * Get the value property: The measurement of that point, should be float. + * Get the value property: Measurement of that point. * * @return the value value. */ + @Generated public double getValue() { return this.value; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeDoubleField("value", this.value); + jsonWriter.writeStringField("timestamp", + this.timestamp == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.timestamp)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TimeSeriesPoint from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TimeSeriesPoint 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 TimeSeriesPoint. + */ + @Generated + public static TimeSeriesPoint fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + double value = 0.0; + OffsetDateTime timestamp = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("value".equals(fieldName)) { + value = reader.getDouble(); + } else if ("timestamp".equals(fieldName)) { + timestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + TimeSeriesPoint deserializedTimeSeriesPoint = new TimeSeriesPoint(value); + deserializedTimeSeriesPoint.timestamp = timestamp; + return deserializedTimeSeriesPoint; + }); + } } diff --git a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/UnivariateChangePointDetectionOptions.java b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/UnivariateChangePointDetectionOptions.java index 1d3103748d65..2cd936626059 100644 --- a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/UnivariateChangePointDetectionOptions.java +++ b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/UnivariateChangePointDetectionOptions.java @@ -1,59 +1,65 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.anomalydetector.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.annotation.Generated; +import com.azure.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; -/** The request of change point detection. */ +/** + * Request of change point detection. + */ @Fluent -public final class UnivariateChangePointDetectionOptions { +public final class UnivariateChangePointDetectionOptions + implements JsonSerializable { + /* - * Time series data points. Points should be sorted by timestamp in ascending + * Time series data points. Points should be sorted by time stamp in ascending * order to match the change point detection result. */ - @JsonProperty(value = "series", required = true) - private List series; + @Generated + private final List series; /* - * Can only be one of yearly, monthly, weekly, daily, hourly, minutely or - * secondly. Granularity is used for verify whether input series is valid. + * Granularity is used to verify whether the input series is valid. */ - @JsonProperty(value = "granularity", required = true) - private TimeGranularity granularity; + @Generated + private final TimeGranularity granularity; /* - * Custom Interval is used to set non-standard time interval, for example, if the - * series is 5 minutes, request can be set as {"granularity":"minutely", + * A custom interval is used to set a nonstandard time interval. For example, if the + * series is 5 minutes, the request can be set as {"granularity":"minutely", * "customInterval":5}. */ - @JsonProperty(value = "customInterval") + @Generated private Integer customInterval; /* - * Optional argument, periodic value of a time series. If the value is null or - * does not present, the API will determine the period automatically. + * Argument that indicates the periodic value of a time series. If the value is null or + * not present, the API will determine the period automatically. */ - @JsonProperty(value = "period") + @Generated private Integer period; /* - * Optional argument, advanced model parameter, a default stableTrendWindow will + * Argument that indicates an advanced model parameter. A default stableTrendWindow value will * be used in detection. */ - @JsonProperty(value = "stableTrendWindow") + @Generated private Integer stableTrendWindow; /* - * Optional argument, advanced model parameter, between 0.0-1.0, the lower the - * value is, the larger the trend error will be which means less change point will + * Argument that indicates an advanced model parameter between 0.0 and 1.0. The lower the + * value is, the larger the trend error is, which means less change point will * be accepted. */ - @JsonProperty(value = "threshold") + @Generated private Double threshold; /** @@ -62,119 +68,199 @@ public final class UnivariateChangePointDetectionOptions { * @param series the series value to set. * @param granularity the granularity value to set. */ - @JsonCreator - public UnivariateChangePointDetectionOptions( - @JsonProperty(value = "series", required = true) List series, - @JsonProperty(value = "granularity", required = true) TimeGranularity granularity) { + @Generated + public UnivariateChangePointDetectionOptions(List series, TimeGranularity granularity) { this.series = series; this.granularity = granularity; } /** - * Get the series property: Time series data points. Points should be sorted by timestamp in ascending order to - * match the change point detection result. + * Get the series property: Time series data points. Points should be sorted by time stamp in ascending + * order to match the change point detection result. * * @return the series value. */ + @Generated public List getSeries() { return this.series; } /** - * Get the granularity property: Can only be one of yearly, monthly, weekly, daily, hourly, minutely or secondly. - * Granularity is used for verify whether input series is valid. + * Get the granularity property: Granularity is used to verify whether the input series is valid. * * @return the granularity value. */ + @Generated public TimeGranularity getGranularity() { return this.granularity; } /** - * Get the customInterval property: Custom Interval is used to set non-standard time interval, for example, if the - * series is 5 minutes, request can be set as {"granularity":"minutely", "customInterval":5}. + * Get the customInterval property: A custom interval is used to set a nonstandard time interval. For example, if + * the + * series is 5 minutes, the request can be set as {"granularity":"minutely", + * "customInterval":5}. * * @return the customInterval value. */ + @Generated public Integer getCustomInterval() { return this.customInterval; } /** - * Set the customInterval property: Custom Interval is used to set non-standard time interval, for example, if the - * series is 5 minutes, request can be set as {"granularity":"minutely", "customInterval":5}. + * Set the customInterval property: A custom interval is used to set a nonstandard time interval. For example, if + * the + * series is 5 minutes, the request can be set as {"granularity":"minutely", + * "customInterval":5}. * * @param customInterval the customInterval value to set. * @return the UnivariateChangePointDetectionOptions object itself. */ + @Generated public UnivariateChangePointDetectionOptions setCustomInterval(Integer customInterval) { this.customInterval = customInterval; return this; } /** - * Get the period property: Optional argument, periodic value of a time series. If the value is null or does not - * present, the API will determine the period automatically. + * Get the period property: Argument that indicates the periodic value of a time series. If the value is null or + * not present, the API will determine the period automatically. * * @return the period value. */ + @Generated public Integer getPeriod() { return this.period; } /** - * Set the period property: Optional argument, periodic value of a time series. If the value is null or does not - * present, the API will determine the period automatically. + * Set the period property: Argument that indicates the periodic value of a time series. If the value is null or + * not present, the API will determine the period automatically. * * @param period the period value to set. * @return the UnivariateChangePointDetectionOptions object itself. */ + @Generated public UnivariateChangePointDetectionOptions setPeriod(Integer period) { this.period = period; return this; } /** - * Get the stableTrendWindow property: Optional argument, advanced model parameter, a default stableTrendWindow will + * Get the stableTrendWindow property: Argument that indicates an advanced model parameter. A default + * stableTrendWindow value will * be used in detection. * * @return the stableTrendWindow value. */ + @Generated public Integer getStableTrendWindow() { return this.stableTrendWindow; } /** - * Set the stableTrendWindow property: Optional argument, advanced model parameter, a default stableTrendWindow will + * Set the stableTrendWindow property: Argument that indicates an advanced model parameter. A default + * stableTrendWindow value will * be used in detection. * * @param stableTrendWindow the stableTrendWindow value to set. * @return the UnivariateChangePointDetectionOptions object itself. */ + @Generated public UnivariateChangePointDetectionOptions setStableTrendWindow(Integer stableTrendWindow) { this.stableTrendWindow = stableTrendWindow; return this; } /** - * Get the threshold property: Optional argument, advanced model parameter, between 0.0-1.0, the lower the value is, - * the larger the trend error will be which means less change point will be accepted. + * Get the threshold property: Argument that indicates an advanced model parameter between 0.0 and 1.0. The lower + * the + * value is, the larger the trend error is, which means less change point will + * be accepted. * * @return the threshold value. */ + @Generated public Double getThreshold() { return this.threshold; } /** - * Set the threshold property: Optional argument, advanced model parameter, between 0.0-1.0, the lower the value is, - * the larger the trend error will be which means less change point will be accepted. + * Set the threshold property: Argument that indicates an advanced model parameter between 0.0 and 1.0. The lower + * the + * value is, the larger the trend error is, which means less change point will + * be accepted. * * @param threshold the threshold value to set. * @return the UnivariateChangePointDetectionOptions object itself. */ + @Generated public UnivariateChangePointDetectionOptions setThreshold(Double threshold) { this.threshold = threshold; return this; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("series", this.series, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("granularity", this.granularity == null ? null : this.granularity.toString()); + jsonWriter.writeNumberField("customInterval", this.customInterval); + jsonWriter.writeNumberField("period", this.period); + jsonWriter.writeNumberField("stableTrendWindow", this.stableTrendWindow); + jsonWriter.writeNumberField("threshold", this.threshold); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UnivariateChangePointDetectionOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UnivariateChangePointDetectionOptions 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 UnivariateChangePointDetectionOptions. + */ + @Generated + public static UnivariateChangePointDetectionOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + List series = null; + TimeGranularity granularity = null; + Integer customInterval = null; + Integer period = null; + Integer stableTrendWindow = null; + Double threshold = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("series".equals(fieldName)) { + series = reader.readArray(reader1 -> TimeSeriesPoint.fromJson(reader1)); + } else if ("granularity".equals(fieldName)) { + granularity = TimeGranularity.fromString(reader.getString()); + } else if ("customInterval".equals(fieldName)) { + customInterval = reader.getNullable(JsonReader::getInt); + } else if ("period".equals(fieldName)) { + period = reader.getNullable(JsonReader::getInt); + } else if ("stableTrendWindow".equals(fieldName)) { + stableTrendWindow = reader.getNullable(JsonReader::getInt); + } else if ("threshold".equals(fieldName)) { + threshold = reader.getNullable(JsonReader::getDouble); + } else { + reader.skipChildren(); + } + } + UnivariateChangePointDetectionOptions deserializedUnivariateChangePointDetectionOptions + = new UnivariateChangePointDetectionOptions(series, granularity); + deserializedUnivariateChangePointDetectionOptions.customInterval = customInterval; + deserializedUnivariateChangePointDetectionOptions.period = period; + deserializedUnivariateChangePointDetectionOptions.stableTrendWindow = stableTrendWindow; + deserializedUnivariateChangePointDetectionOptions.threshold = threshold; + return deserializedUnivariateChangePointDetectionOptions; + }); + } } diff --git a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/UnivariateChangePointDetectionResult.java b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/UnivariateChangePointDetectionResult.java index 0d8774223073..187d523e4e8a 100644 --- a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/UnivariateChangePointDetectionResult.java +++ b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/UnivariateChangePointDetectionResult.java @@ -1,66 +1,128 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.anomalydetector.models; +import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.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; -/** The response of change point detection. */ +/** + * Response of change point detection. + */ @Immutable -public final class UnivariateChangePointDetectionResult { +public final class UnivariateChangePointDetectionResult + implements JsonSerializable { + /* - * Frequency extracted from the series, zero means no recurrent pattern has been + * Frequency extracted from the series. Zero means no recurrent pattern has been * found. */ - @JsonProperty(value = "period", access = JsonProperty.Access.WRITE_ONLY) + @Generated private Integer period; /* - * isChangePoint contains change point properties for each input point. True means - * an anomaly either negative or positive has been detected. The index of the + * Change point properties for each input point. True means + * an anomaly (either negative or positive) has been detected. The index of the * array is consistent with the input series. */ - @JsonProperty(value = "isChangePoint") + @Generated private List isChangePoint; /* - * the change point confidence of each point + * Change point confidence of each point. */ - @JsonProperty(value = "confidenceScores") + @Generated private List confidenceScores; - /** Creates an instance of UnivariateChangePointDetectionResult class. */ - private UnivariateChangePointDetectionResult() {} + /** + * Creates an instance of UnivariateChangePointDetectionResult class. + */ + @Generated + private UnivariateChangePointDetectionResult() { + } /** - * Get the period property: Frequency extracted from the series, zero means no recurrent pattern has been found. + * Get the period property: Frequency extracted from the series. Zero means no recurrent pattern has been + * found. * * @return the period value. */ + @Generated public Integer getPeriod() { return this.period; } /** - * Get the isChangePoint property: isChangePoint contains change point properties for each input point. True means - * an anomaly either negative or positive has been detected. The index of the array is consistent with the input - * series. + * Get the isChangePoint property: Change point properties for each input point. True means + * an anomaly (either negative or positive) has been detected. The index of the + * array is consistent with the input series. * * @return the isChangePoint value. */ + @Generated public List getIsChangePoint() { return this.isChangePoint; } /** - * Get the confidenceScores property: the change point confidence of each point. + * Get the confidenceScores property: Change point confidence of each point. * * @return the confidenceScores value. */ + @Generated public List getConfidenceScores() { return this.confidenceScores; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("isChangePoint", this.isChangePoint, + (writer, element) -> writer.writeBoolean(element)); + jsonWriter.writeArrayField("confidenceScores", this.confidenceScores, + (writer, element) -> writer.writeDouble(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UnivariateChangePointDetectionResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UnivariateChangePointDetectionResult if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the UnivariateChangePointDetectionResult. + */ + @Generated + public static UnivariateChangePointDetectionResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UnivariateChangePointDetectionResult deserializedUnivariateChangePointDetectionResult + = new UnivariateChangePointDetectionResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("period".equals(fieldName)) { + deserializedUnivariateChangePointDetectionResult.period = reader.getNullable(JsonReader::getInt); + } else if ("isChangePoint".equals(fieldName)) { + List isChangePoint = reader.readArray(reader1 -> reader1.getBoolean()); + deserializedUnivariateChangePointDetectionResult.isChangePoint = isChangePoint; + } else if ("confidenceScores".equals(fieldName)) { + List confidenceScores = reader.readArray(reader1 -> reader1.getDouble()); + deserializedUnivariateChangePointDetectionResult.confidenceScores = confidenceScores; + } else { + reader.skipChildren(); + } + } + return deserializedUnivariateChangePointDetectionResult; + }); + } } diff --git a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/UnivariateDetectionOptions.java b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/UnivariateDetectionOptions.java index a84d8b12ae70..29690acb881c 100644 --- a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/UnivariateDetectionOptions.java +++ b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/UnivariateDetectionOptions.java @@ -1,76 +1,81 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.anomalydetector.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.annotation.Generated; +import com.azure.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; -/** The request of entire or last anomaly detection. */ +/** + * Request of the entire or last anomaly detection. + */ @Fluent -public final class UnivariateDetectionOptions { +public final class UnivariateDetectionOptions implements JsonSerializable { + /* - * Time series data points. Points should be sorted by timestamp in ascending + * Time series data points. Points should be sorted by time stamp in ascending * order to match the anomaly detection result. If the data is not sorted - * correctly or there is duplicated timestamp, the API will not work. In such - * case, an error message will be returned. + * correctly or there's a duplicated time stamp, the API won't work. In such + * a case, an error message is returned. */ - @JsonProperty(value = "series", required = true) - private List series; + @Generated + private final List series; /* - * Optional argument, can be one of yearly, monthly, weekly, daily, hourly, - * minutely, secondly, microsecond or none. If granularity is not present, it will - * be none by default. If granularity is none, the timestamp property in time + * Argument that indicates time granularity. If granularity is not present, the value + * is none by default. If granularity is none, the time stamp property in the time * series point can be absent. */ - @JsonProperty(value = "granularity") + @Generated private TimeGranularity granularity; /* - * Custom Interval is used to set non-standard time interval, for example, if the - * series is 5 minutes, request can be set as {"granularity":"minutely", + * A custom interval is used to set a nonstandard time interval. For example, if the + * series is 5 minutes, the request can be set as {"granularity":"minutely", * "customInterval":5}. */ - @JsonProperty(value = "customInterval") + @Generated private Integer customInterval; /* - * Optional argument, periodic value of a time series. If the value is null or - * does not present, the API will determine the period automatically. + * Argument that indicates the periodic value of a time series. If the value is null or + * is not present, the API determines the period automatically. */ - @JsonProperty(value = "period") + @Generated private Integer period; /* - * Optional argument, advanced model parameter, max anomaly ratio in a time series. + * Argument that indicates an advanced model parameter. It's the maximum anomaly ratio in a time series. */ - @JsonProperty(value = "maxAnomalyRatio") + @Generated private Double maxAnomalyRatio; /* - * Optional argument, advanced model parameter, between 0-99, the lower the value - * is, the larger the margin value will be which means less anomalies will be + * Argument that indicates an advanced model parameter between 0 and 99. The lower the value + * is, the larger the margin value is, which means fewer anomalies will be * accepted. */ - @JsonProperty(value = "sensitivity") + @Generated private Integer sensitivity; /* - * Used to specify how to deal with missing values in the input series, it's used + * Specifies how to deal with missing values in the input series. It's used * when granularity is not "none". */ - @JsonProperty(value = "imputeMode") + @Generated private ImputeMode imputeMode; /* - * Used to specify the value to fill, it's used when granularity is not "none" + * Specifies the value to fill. It's used when granularity is not "none" * and imputeMode is "fixed". */ - @JsonProperty(value = "imputeFixedValue") + @Generated private Double imputeFixedValue; /** @@ -78,175 +83,272 @@ public final class UnivariateDetectionOptions { * * @param series the series value to set. */ - @JsonCreator - public UnivariateDetectionOptions(@JsonProperty(value = "series", required = true) List series) { + @Generated + public UnivariateDetectionOptions(List series) { this.series = series; } /** - * Get the series property: Time series data points. Points should be sorted by timestamp in ascending order to - * match the anomaly detection result. If the data is not sorted correctly or there is duplicated timestamp, the API - * will not work. In such case, an error message will be returned. + * Get the series property: Time series data points. Points should be sorted by time stamp in ascending + * order to match the anomaly detection result. If the data is not sorted + * correctly or there's a duplicated time stamp, the API won't work. In such + * a case, an error message is returned. * * @return the series value. */ + @Generated public List getSeries() { return this.series; } /** - * Get the granularity property: Optional argument, can be one of yearly, monthly, weekly, daily, hourly, minutely, - * secondly, microsecond or none. If granularity is not present, it will be none by default. If granularity is none, - * the timestamp property in time series point can be absent. + * Get the granularity property: Argument that indicates time granularity. If granularity is not present, the value + * is none by default. If granularity is none, the time stamp property in the time + * series point can be absent. * * @return the granularity value. */ + @Generated public TimeGranularity getGranularity() { return this.granularity; } /** - * Set the granularity property: Optional argument, can be one of yearly, monthly, weekly, daily, hourly, minutely, - * secondly, microsecond or none. If granularity is not present, it will be none by default. If granularity is none, - * the timestamp property in time series point can be absent. + * Set the granularity property: Argument that indicates time granularity. If granularity is not present, the value + * is none by default. If granularity is none, the time stamp property in the time + * series point can be absent. * * @param granularity the granularity value to set. * @return the UnivariateDetectionOptions object itself. */ + @Generated public UnivariateDetectionOptions setGranularity(TimeGranularity granularity) { this.granularity = granularity; return this; } /** - * Get the customInterval property: Custom Interval is used to set non-standard time interval, for example, if the - * series is 5 minutes, request can be set as {"granularity":"minutely", "customInterval":5}. + * Get the customInterval property: A custom interval is used to set a nonstandard time interval. For example, if + * the + * series is 5 minutes, the request can be set as {"granularity":"minutely", + * "customInterval":5}. * * @return the customInterval value. */ + @Generated public Integer getCustomInterval() { return this.customInterval; } /** - * Set the customInterval property: Custom Interval is used to set non-standard time interval, for example, if the - * series is 5 minutes, request can be set as {"granularity":"minutely", "customInterval":5}. + * Set the customInterval property: A custom interval is used to set a nonstandard time interval. For example, if + * the + * series is 5 minutes, the request can be set as {"granularity":"minutely", + * "customInterval":5}. * * @param customInterval the customInterval value to set. * @return the UnivariateDetectionOptions object itself. */ + @Generated public UnivariateDetectionOptions setCustomInterval(Integer customInterval) { this.customInterval = customInterval; return this; } /** - * Get the period property: Optional argument, periodic value of a time series. If the value is null or does not - * present, the API will determine the period automatically. + * Get the period property: Argument that indicates the periodic value of a time series. If the value is null or + * is not present, the API determines the period automatically. * * @return the period value. */ + @Generated public Integer getPeriod() { return this.period; } /** - * Set the period property: Optional argument, periodic value of a time series. If the value is null or does not - * present, the API will determine the period automatically. + * Set the period property: Argument that indicates the periodic value of a time series. If the value is null or + * is not present, the API determines the period automatically. * * @param period the period value to set. * @return the UnivariateDetectionOptions object itself. */ + @Generated public UnivariateDetectionOptions setPeriod(Integer period) { this.period = period; return this; } /** - * Get the maxAnomalyRatio property: Optional argument, advanced model parameter, max anomaly ratio in a time - * series. + * Get the maxAnomalyRatio property: Argument that indicates an advanced model parameter. It's the maximum anomaly + * ratio in a time series. * * @return the maxAnomalyRatio value. */ + @Generated public Double getMaxAnomalyRatio() { return this.maxAnomalyRatio; } /** - * Set the maxAnomalyRatio property: Optional argument, advanced model parameter, max anomaly ratio in a time - * series. + * Set the maxAnomalyRatio property: Argument that indicates an advanced model parameter. It's the maximum anomaly + * ratio in a time series. * * @param maxAnomalyRatio the maxAnomalyRatio value to set. * @return the UnivariateDetectionOptions object itself. */ + @Generated public UnivariateDetectionOptions setMaxAnomalyRatio(Double maxAnomalyRatio) { this.maxAnomalyRatio = maxAnomalyRatio; return this; } /** - * Get the sensitivity property: Optional argument, advanced model parameter, between 0-99, the lower the value is, - * the larger the margin value will be which means less anomalies will be accepted. + * Get the sensitivity property: Argument that indicates an advanced model parameter between 0 and 99. The lower the + * value + * is, the larger the margin value is, which means fewer anomalies will be + * accepted. * * @return the sensitivity value. */ + @Generated public Integer getSensitivity() { return this.sensitivity; } /** - * Set the sensitivity property: Optional argument, advanced model parameter, between 0-99, the lower the value is, - * the larger the margin value will be which means less anomalies will be accepted. + * Set the sensitivity property: Argument that indicates an advanced model parameter between 0 and 99. The lower the + * value + * is, the larger the margin value is, which means fewer anomalies will be + * accepted. * * @param sensitivity the sensitivity value to set. * @return the UnivariateDetectionOptions object itself. */ + @Generated public UnivariateDetectionOptions setSensitivity(Integer sensitivity) { this.sensitivity = sensitivity; return this; } /** - * Get the imputeMode property: Used to specify how to deal with missing values in the input series, it's used when - * granularity is not "none". + * Get the imputeMode property: Specifies how to deal with missing values in the input series. It's used + * when granularity is not "none". * * @return the imputeMode value. */ + @Generated public ImputeMode getImputeMode() { return this.imputeMode; } /** - * Set the imputeMode property: Used to specify how to deal with missing values in the input series, it's used when - * granularity is not "none". + * Set the imputeMode property: Specifies how to deal with missing values in the input series. It's used + * when granularity is not "none". * * @param imputeMode the imputeMode value to set. * @return the UnivariateDetectionOptions object itself. */ + @Generated public UnivariateDetectionOptions setImputeMode(ImputeMode imputeMode) { this.imputeMode = imputeMode; return this; } /** - * Get the imputeFixedValue property: Used to specify the value to fill, it's used when granularity is not "none" + * Get the imputeFixedValue property: Specifies the value to fill. It's used when granularity is not "none" * and imputeMode is "fixed". * * @return the imputeFixedValue value. */ + @Generated public Double getImputeFixedValue() { return this.imputeFixedValue; } /** - * Set the imputeFixedValue property: Used to specify the value to fill, it's used when granularity is not "none" + * Set the imputeFixedValue property: Specifies the value to fill. It's used when granularity is not "none" * and imputeMode is "fixed". * * @param imputeFixedValue the imputeFixedValue value to set. * @return the UnivariateDetectionOptions object itself. */ + @Generated public UnivariateDetectionOptions setImputeFixedValue(Double imputeFixedValue) { this.imputeFixedValue = imputeFixedValue; return this; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("series", this.series, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("granularity", this.granularity == null ? null : this.granularity.toString()); + jsonWriter.writeNumberField("customInterval", this.customInterval); + jsonWriter.writeNumberField("period", this.period); + jsonWriter.writeNumberField("maxAnomalyRatio", this.maxAnomalyRatio); + jsonWriter.writeNumberField("sensitivity", this.sensitivity); + jsonWriter.writeStringField("imputeMode", this.imputeMode == null ? null : this.imputeMode.toString()); + jsonWriter.writeNumberField("imputeFixedValue", this.imputeFixedValue); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UnivariateDetectionOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UnivariateDetectionOptions 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 UnivariateDetectionOptions. + */ + @Generated + public static UnivariateDetectionOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + List series = null; + TimeGranularity granularity = null; + Integer customInterval = null; + Integer period = null; + Double maxAnomalyRatio = null; + Integer sensitivity = null; + ImputeMode imputeMode = null; + Double imputeFixedValue = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("series".equals(fieldName)) { + series = reader.readArray(reader1 -> TimeSeriesPoint.fromJson(reader1)); + } else if ("granularity".equals(fieldName)) { + granularity = TimeGranularity.fromString(reader.getString()); + } else if ("customInterval".equals(fieldName)) { + customInterval = reader.getNullable(JsonReader::getInt); + } else if ("period".equals(fieldName)) { + period = reader.getNullable(JsonReader::getInt); + } else if ("maxAnomalyRatio".equals(fieldName)) { + maxAnomalyRatio = reader.getNullable(JsonReader::getDouble); + } else if ("sensitivity".equals(fieldName)) { + sensitivity = reader.getNullable(JsonReader::getInt); + } else if ("imputeMode".equals(fieldName)) { + imputeMode = ImputeMode.fromString(reader.getString()); + } else if ("imputeFixedValue".equals(fieldName)) { + imputeFixedValue = reader.getNullable(JsonReader::getDouble); + } else { + reader.skipChildren(); + } + } + UnivariateDetectionOptions deserializedUnivariateDetectionOptions = new UnivariateDetectionOptions(series); + deserializedUnivariateDetectionOptions.granularity = granularity; + deserializedUnivariateDetectionOptions.customInterval = customInterval; + deserializedUnivariateDetectionOptions.period = period; + deserializedUnivariateDetectionOptions.maxAnomalyRatio = maxAnomalyRatio; + deserializedUnivariateDetectionOptions.sensitivity = sensitivity; + deserializedUnivariateDetectionOptions.imputeMode = imputeMode; + deserializedUnivariateDetectionOptions.imputeFixedValue = imputeFixedValue; + return deserializedUnivariateDetectionOptions; + }); + } } diff --git a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/UnivariateEntireDetectionResult.java b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/UnivariateEntireDetectionResult.java index f97b0d7016b9..c6039e3d44bd 100644 --- a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/UnivariateEntireDetectionResult.java +++ b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/UnivariateEntireDetectionResult.java @@ -1,41 +1,38 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.ai.anomalydetector.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.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; /** The response of entire anomaly detection. */ @Immutable -public final class UnivariateEntireDetectionResult { +public final class UnivariateEntireDetectionResult implements JsonSerializable { /* - * Frequency extracted from the series, zero means no recurrent pattern has been - * found. + * Frequency extracted from the series, zero means no recurrent pattern has been found. */ - @JsonProperty(value = "period", required = true) - private int period; + private final int period; /* - * ExpectedValues contain expected value for each input point. The index of the - * array is consistent with the input series. + * ExpectedValues contain expected value for each input point. The index of the array is consistent with the input + * series. */ - @JsonProperty(value = "expectedValues", required = true) - private List expectedValues; + private final List expectedValues; /* - * UpperMargins contain upper margin of each input point. UpperMargin is used to - * calculate upperBoundary, which equals to expectedValue + (100 - - * marginScale)*upperMargin. Anomalies in response can be filtered by - * upperBoundary and lowerBoundary. By adjusting marginScale value, less - * significant anomalies can be filtered in client side. The index of the array is - * consistent with the input series. + * UpperMargins contain upper margin of each input point. UpperMargin is used to calculate upperBoundary, which + * equals to expectedValue + (100 - marginScale)*upperMargin. Anomalies in response can be filtered by upperBoundary + * and lowerBoundary. By adjusting marginScale value, less significant anomalies can be filtered in client side. The + * index of the array is consistent with the input series. */ - @JsonProperty(value = "upperMargins", required = true) - private List upperMargins; + private final List upperMargins; /* * LowerMargins contain lower margin of each input point. LowerMargin is used to @@ -44,16 +41,14 @@ public final class UnivariateEntireDetectionResult { * ones in client side. The index of the array is consistent with the input * series. */ - @JsonProperty(value = "lowerMargins", required = true) - private List lowerMargins; + private final List lowerMargins; /* * IsAnomaly contains anomaly properties for each input point. True means an * anomaly either negative or positive has been detected. The index of the array * is consistent with the input series. */ - @JsonProperty(value = "isAnomaly", required = true) - private List isAnomaly; + private final List isAnomaly; /* * IsNegativeAnomaly contains anomaly status in negative direction for each input @@ -61,8 +56,7 @@ public final class UnivariateEntireDetectionResult { * means the point is detected as an anomaly and its real value is smaller than * the expected one. The index of the array is consistent with the input series. */ - @JsonProperty(value = "isNegativeAnomaly", required = true) - private List isNegativeAnomaly; + private final List isNegativeAnomaly; /* * IsPositiveAnomaly contain anomaly status in positive direction for each input @@ -70,14 +64,12 @@ public final class UnivariateEntireDetectionResult { * means the point is detected as an anomaly and its real value is larger than the * expected one. The index of the array is consistent with the input series. */ - @JsonProperty(value = "isPositiveAnomaly", required = true) - private List isPositiveAnomaly; + private final List isPositiveAnomaly; /* * The severity score for each input point. The larger the value is, the more * sever the anomaly is. For normal points, the "severity" is always 0. */ - @JsonProperty(value = "severity") private List severity; /** @@ -91,15 +83,9 @@ public final class UnivariateEntireDetectionResult { * @param isNegativeAnomaly the isNegativeAnomaly value to set. * @param isPositiveAnomaly the isPositiveAnomaly value to set. */ - @JsonCreator - private UnivariateEntireDetectionResult( - @JsonProperty(value = "period", required = true) int period, - @JsonProperty(value = "expectedValues", required = true) List expectedValues, - @JsonProperty(value = "upperMargins", required = true) List upperMargins, - @JsonProperty(value = "lowerMargins", required = true) List lowerMargins, - @JsonProperty(value = "isAnomaly", required = true) List isAnomaly, - @JsonProperty(value = "isNegativeAnomaly", required = true) List isNegativeAnomaly, - @JsonProperty(value = "isPositiveAnomaly", required = true) List isPositiveAnomaly) { + private UnivariateEntireDetectionResult(int period, List expectedValues, List upperMargins, + List lowerMargins, List isAnomaly, List isNegativeAnomaly, + List isPositiveAnomaly) { this.period = period; this.expectedValues = expectedValues; this.upperMargins = upperMargins; @@ -194,4 +180,70 @@ public List getIsPositiveAnomaly() { public List getSeverity() { return this.severity; } + + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + return jsonWriter.writeStartObject() + .writeIntField("period", period) + .writeArrayField("expectedValues", expectedValues, JsonWriter::writeNumber) + .writeArrayField("upperMargins", upperMargins, JsonWriter::writeNumber) + .writeArrayField("lowerMargins", lowerMargins, JsonWriter::writeNumber) + .writeArrayField("isAnomaly", isAnomaly, JsonWriter::writeBoolean) + .writeArrayField("isNegativeAnomaly", isNegativeAnomaly, JsonWriter::writeBoolean) + .writeArrayField("isPositiveAnomaly", isPositiveAnomaly, JsonWriter::writeBoolean) + .writeArrayField("severity", severity, JsonWriter::writeNumber) + .writeEndObject(); + } + + /** + * Reads an instance of UnivariateEntireDetectionResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UnivariateEntireDetectionResult 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 UnivariateEntireDetectionResult. + */ + public static UnivariateEntireDetectionResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + int period = 0; + List expectedValues = null; + List upperMargins = null; + List lowerMargins = null; + List isAnomaly = null; + List isNegativeAnomaly = null; + List isPositiveAnomaly = null; + List severity = null; + + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("period".equals(fieldName)) { + period = reader.getInt(); + } else if ("expectedValues".equals(fieldName)) { + expectedValues = reader.readArray(JsonReader::getDouble); + } else if ("upperMargins".equals(fieldName)) { + upperMargins = reader.readArray(JsonReader::getDouble); + } else if ("lowerMargins".equals(fieldName)) { + lowerMargins = reader.readArray(JsonReader::getDouble); + } else if ("isAnomaly".equals(fieldName)) { + isAnomaly = reader.readArray(JsonReader::getBoolean); + } else if ("isNegativeAnomaly".equals(fieldName)) { + isNegativeAnomaly = reader.readArray(JsonReader::getBoolean); + } else if ("isPositiveAnomaly".equals(fieldName)) { + isPositiveAnomaly = reader.readArray(JsonReader::getBoolean); + } else if ("severity".equals(fieldName)) { + severity = reader.readArray(JsonReader::getDouble); + } else { + reader.skipChildren(); + } + } + + UnivariateEntireDetectionResult result = new UnivariateEntireDetectionResult(period, expectedValues, + upperMargins, lowerMargins, isAnomaly, isNegativeAnomaly, isPositiveAnomaly); + result.severity = severity; + return result; + }); + } } diff --git a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/UnivariateLastDetectionResult.java b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/UnivariateLastDetectionResult.java index 7020f403d369..e9664f8049ca 100644 --- a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/UnivariateLastDetectionResult.java +++ b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/UnivariateLastDetectionResult.java @@ -1,79 +1,84 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.anomalydetector.models; +import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The response of last anomaly detection. */ +/** + * Response of the last anomaly detection. + */ @Immutable -public final class UnivariateLastDetectionResult { +public final class UnivariateLastDetectionResult implements JsonSerializable { + /* - * Frequency extracted from the series, zero means no recurrent pattern has been + * Frequency extracted from the series. Zero means no recurrent pattern has been * found. */ - @JsonProperty(value = "period", required = true) - private int period; + @Generated + private final int period; /* * Suggested input series points needed for detecting the latest point. */ - @JsonProperty(value = "suggestedWindow", required = true) - private int suggestedWindow; + @Generated + private final int suggestedWindow; /* * Expected value of the latest point. */ - @JsonProperty(value = "expectedValue", required = true) - private double expectedValue; + @Generated + private final double expectedValue; /* * Upper margin of the latest point. UpperMargin is used to calculate - * upperBoundary, which equals to expectedValue + (100 - marginScale)*upperMargin. + * upperBoundary, which is equal to expectedValue + (100 - marginScale)*upperMargin. * If the value of latest point is between upperBoundary and lowerBoundary, it - * should be treated as normal value. By adjusting marginScale value, anomaly - * status of latest point can be changed. + * should be treated as a normal value. Adjusting the marginScale value enables the anomaly + * status of the latest point to be changed. */ - @JsonProperty(value = "upperMargin", required = true) - private double upperMargin; + @Generated + private final double upperMargin; /* * Lower margin of the latest point. LowerMargin is used to calculate - * lowerBoundary, which equals to expectedValue - (100 - marginScale)*lowerMargin. - * + * lowerBoundary, which is equal to expectedValue - (100 - marginScale)*lowerMargin. */ - @JsonProperty(value = "lowerMargin", required = true) - private double lowerMargin; + @Generated + private final double lowerMargin; /* - * Anomaly status of the latest point, true means the latest point is an anomaly - * either in negative direction or positive direction. + * Anomaly status of the latest point. True means the latest point is an anomaly, + * either in the negative direction or in the positive direction. */ - @JsonProperty(value = "isAnomaly", required = true) - private boolean isAnomaly; + @Generated + private final boolean isAnomaly; /* - * Anomaly status in negative direction of the latest point. True means the latest + * Anomaly status of the latest point in a negative direction. True means the latest * point is an anomaly and its real value is smaller than the expected one. */ - @JsonProperty(value = "isNegativeAnomaly", required = true) - private boolean isNegativeAnomaly; + @Generated + private final boolean isNegativeAnomaly; /* - * Anomaly status in positive direction of the latest point. True means the latest + * Anomaly status of the latest point in a positive direction. True means the latest * point is an anomaly and its real value is larger than the expected one. */ - @JsonProperty(value = "isPositiveAnomaly", required = true) - private boolean isPositiveAnomaly; + @Generated + private final boolean isPositiveAnomaly; /* - * The severity score for the last input point. The larger the value is, the more - * sever the anomaly is. For normal points, the "severity" is always 0. + * Severity score for the last input point. The larger the value is, the more + * severe the anomaly is. For normal points, the severity is always 0. */ - @JsonProperty(value = "severity") + @Generated private Double severity; /** @@ -88,16 +93,9 @@ public final class UnivariateLastDetectionResult { * @param isNegativeAnomaly the isNegativeAnomaly value to set. * @param isPositiveAnomaly the isPositiveAnomaly value to set. */ - @JsonCreator - private UnivariateLastDetectionResult( - @JsonProperty(value = "period", required = true) int period, - @JsonProperty(value = "suggestedWindow", required = true) int suggestedWindow, - @JsonProperty(value = "expectedValue", required = true) double expectedValue, - @JsonProperty(value = "upperMargin", required = true) double upperMargin, - @JsonProperty(value = "lowerMargin", required = true) double lowerMargin, - @JsonProperty(value = "isAnomaly", required = true) boolean isAnomaly, - @JsonProperty(value = "isNegativeAnomaly", required = true) boolean isNegativeAnomaly, - @JsonProperty(value = "isPositiveAnomaly", required = true) boolean isPositiveAnomaly) { + @Generated + private UnivariateLastDetectionResult(int period, int suggestedWindow, double expectedValue, double upperMargin, + double lowerMargin, boolean isAnomaly, boolean isNegativeAnomaly, boolean isPositiveAnomaly) { this.period = period; this.suggestedWindow = suggestedWindow; this.expectedValue = expectedValue; @@ -109,10 +107,12 @@ private UnivariateLastDetectionResult( } /** - * Get the period property: Frequency extracted from the series, zero means no recurrent pattern has been found. + * Get the period property: Frequency extracted from the series. Zero means no recurrent pattern has been + * found. * * @return the period value. */ + @Generated public int getPeriod() { return this.period; } @@ -122,6 +122,7 @@ public int getPeriod() { * * @return the suggestedWindow value. */ + @Generated public int getSuggestedWindow() { return this.suggestedWindow; } @@ -131,69 +132,152 @@ public int getSuggestedWindow() { * * @return the expectedValue value. */ + @Generated public double getExpectedValue() { return this.expectedValue; } /** - * Get the upperMargin property: Upper margin of the latest point. UpperMargin is used to calculate upperBoundary, - * which equals to expectedValue + (100 - marginScale)*upperMargin. If the value of latest point is between - * upperBoundary and lowerBoundary, it should be treated as normal value. By adjusting marginScale value, anomaly - * status of latest point can be changed. + * Get the upperMargin property: Upper margin of the latest point. UpperMargin is used to calculate + * upperBoundary, which is equal to expectedValue + (100 - marginScale)*upperMargin. + * If the value of latest point is between upperBoundary and lowerBoundary, it + * should be treated as a normal value. Adjusting the marginScale value enables the anomaly + * status of the latest point to be changed. * * @return the upperMargin value. */ + @Generated public double getUpperMargin() { return this.upperMargin; } /** - * Get the lowerMargin property: Lower margin of the latest point. LowerMargin is used to calculate lowerBoundary, - * which equals to expectedValue - (100 - marginScale)*lowerMargin. + * Get the lowerMargin property: Lower margin of the latest point. LowerMargin is used to calculate + * lowerBoundary, which is equal to expectedValue - (100 - marginScale)*lowerMargin. * * @return the lowerMargin value. */ + @Generated public double getLowerMargin() { return this.lowerMargin; } /** - * Get the isAnomaly property: Anomaly status of the latest point, true means the latest point is an anomaly either - * in negative direction or positive direction. + * Get the isAnomaly property: Anomaly status of the latest point. True means the latest point is an anomaly, + * either in the negative direction or in the positive direction. * * @return the isAnomaly value. */ + @Generated public boolean isAnomaly() { return this.isAnomaly; } /** - * Get the isNegativeAnomaly property: Anomaly status in negative direction of the latest point. True means the - * latest point is an anomaly and its real value is smaller than the expected one. + * Get the isNegativeAnomaly property: Anomaly status of the latest point in a negative direction. True means the + * latest + * point is an anomaly and its real value is smaller than the expected one. * * @return the isNegativeAnomaly value. */ + @Generated public boolean isNegativeAnomaly() { return this.isNegativeAnomaly; } /** - * Get the isPositiveAnomaly property: Anomaly status in positive direction of the latest point. True means the - * latest point is an anomaly and its real value is larger than the expected one. + * Get the isPositiveAnomaly property: Anomaly status of the latest point in a positive direction. True means the + * latest + * point is an anomaly and its real value is larger than the expected one. * * @return the isPositiveAnomaly value. */ + @Generated public boolean isPositiveAnomaly() { return this.isPositiveAnomaly; } /** - * Get the severity property: The severity score for the last input point. The larger the value is, the more sever - * the anomaly is. For normal points, the "severity" is always 0. + * Get the severity property: Severity score for the last input point. The larger the value is, the more + * severe the anomaly is. For normal points, the severity is always 0. * * @return the severity value. */ + @Generated public Double getSeverity() { return this.severity; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("period", this.period); + jsonWriter.writeIntField("suggestedWindow", this.suggestedWindow); + jsonWriter.writeDoubleField("expectedValue", this.expectedValue); + jsonWriter.writeDoubleField("upperMargin", this.upperMargin); + jsonWriter.writeDoubleField("lowerMargin", this.lowerMargin); + jsonWriter.writeBooleanField("isAnomaly", this.isAnomaly); + jsonWriter.writeBooleanField("isNegativeAnomaly", this.isNegativeAnomaly); + jsonWriter.writeBooleanField("isPositiveAnomaly", this.isPositiveAnomaly); + jsonWriter.writeNumberField("severity", this.severity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UnivariateLastDetectionResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UnivariateLastDetectionResult 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 UnivariateLastDetectionResult. + */ + @Generated + public static UnivariateLastDetectionResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + int period = 0; + int suggestedWindow = 0; + double expectedValue = 0.0; + double upperMargin = 0.0; + double lowerMargin = 0.0; + boolean isAnomaly = false; + boolean isNegativeAnomaly = false; + boolean isPositiveAnomaly = false; + Double severity = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("period".equals(fieldName)) { + period = reader.getInt(); + } else if ("suggestedWindow".equals(fieldName)) { + suggestedWindow = reader.getInt(); + } else if ("expectedValue".equals(fieldName)) { + expectedValue = reader.getDouble(); + } else if ("upperMargin".equals(fieldName)) { + upperMargin = reader.getDouble(); + } else if ("lowerMargin".equals(fieldName)) { + lowerMargin = reader.getDouble(); + } else if ("isAnomaly".equals(fieldName)) { + isAnomaly = reader.getBoolean(); + } else if ("isNegativeAnomaly".equals(fieldName)) { + isNegativeAnomaly = reader.getBoolean(); + } else if ("isPositiveAnomaly".equals(fieldName)) { + isPositiveAnomaly = reader.getBoolean(); + } else if ("severity".equals(fieldName)) { + severity = reader.getNullable(JsonReader::getDouble); + } else { + reader.skipChildren(); + } + } + UnivariateLastDetectionResult deserializedUnivariateLastDetectionResult + = new UnivariateLastDetectionResult(period, suggestedWindow, expectedValue, upperMargin, lowerMargin, + isAnomaly, isNegativeAnomaly, isPositiveAnomaly); + deserializedUnivariateLastDetectionResult.severity = severity; + return deserializedUnivariateLastDetectionResult; + }); + } } diff --git a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/VariableState.java b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/VariableState.java index bcdd13530bfe..da114134b877 100644 --- a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/VariableState.java +++ b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/VariableState.java @@ -1,146 +1,161 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.anomalydetector.models; -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +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; + +/** + * Variable status. + */ +@Immutable +public final class VariableState implements JsonSerializable { -/** Variable Status. */ -@Fluent -public final class VariableState { /* * Variable name in variable states. */ - @JsonProperty(value = "variable") + @Generated private String variable; /* * Proportion of missing values that need to be filled by fillNAMethod. */ - @JsonProperty(value = "filledNARatio") + @Generated private Double filledNARatio; /* - * Number of effective data points before applying fillNAMethod. + * Number of effective data points before fillNAMethod is applied. */ - @JsonProperty(value = "effectiveCount") + @Generated private Integer effectiveCount; /* - * First valid timestamp with value of input data. + * First valid time stamp with a value of input data. */ - @JsonProperty(value = "firstTimestamp") + @Generated private OffsetDateTime firstTimestamp; /* - * Last valid timestamp with value of input data. + * Last valid time stamp with a value of input data. */ - @JsonProperty(value = "lastTimestamp") + @Generated private OffsetDateTime lastTimestamp; - /** Creates an instance of VariableState class. */ - public VariableState() {} + /** + * Creates an instance of VariableState class. + */ + @Generated + private VariableState() { + } /** * Get the variable property: Variable name in variable states. * * @return the variable value. */ + @Generated public String getVariable() { return this.variable; } - /** - * Set the variable property: Variable name in variable states. - * - * @param variable the variable value to set. - * @return the VariableState object itself. - */ - public VariableState setVariable(String variable) { - this.variable = variable; - return this; - } - /** * Get the filledNARatio property: Proportion of missing values that need to be filled by fillNAMethod. * * @return the filledNARatio value. */ + @Generated public Double getFilledNARatio() { return this.filledNARatio; } /** - * Set the filledNARatio property: Proportion of missing values that need to be filled by fillNAMethod. - * - * @param filledNARatio the filledNARatio value to set. - * @return the VariableState object itself. - */ - public VariableState setFilledNARatio(Double filledNARatio) { - this.filledNARatio = filledNARatio; - return this; - } - - /** - * Get the effectiveCount property: Number of effective data points before applying fillNAMethod. + * Get the effectiveCount property: Number of effective data points before fillNAMethod is applied. * * @return the effectiveCount value. */ + @Generated public Integer getEffectiveCount() { return this.effectiveCount; } /** - * Set the effectiveCount property: Number of effective data points before applying fillNAMethod. - * - * @param effectiveCount the effectiveCount value to set. - * @return the VariableState object itself. - */ - public VariableState setEffectiveCount(Integer effectiveCount) { - this.effectiveCount = effectiveCount; - return this; - } - - /** - * Get the firstTimestamp property: First valid timestamp with value of input data. + * Get the firstTimestamp property: First valid time stamp with a value of input data. * * @return the firstTimestamp value. */ + @Generated public OffsetDateTime getFirstTimestamp() { return this.firstTimestamp; } /** - * Set the firstTimestamp property: First valid timestamp with value of input data. + * Get the lastTimestamp property: Last valid time stamp with a value of input data. * - * @param firstTimestamp the firstTimestamp value to set. - * @return the VariableState object itself. + * @return the lastTimestamp value. */ - public VariableState setFirstTimestamp(OffsetDateTime firstTimestamp) { - this.firstTimestamp = firstTimestamp; - return this; + @Generated + public OffsetDateTime getLastTimestamp() { + return this.lastTimestamp; } /** - * Get the lastTimestamp property: Last valid timestamp with value of input data. - * - * @return the lastTimestamp value. + * {@inheritDoc} */ - public OffsetDateTime getLastTimestamp() { - return this.lastTimestamp; + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("variable", this.variable); + jsonWriter.writeNumberField("filledNARatio", this.filledNARatio); + jsonWriter.writeNumberField("effectiveCount", this.effectiveCount); + jsonWriter.writeStringField("firstTimestamp", + this.firstTimestamp == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.firstTimestamp)); + jsonWriter.writeStringField("lastTimestamp", + this.lastTimestamp == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastTimestamp)); + return jsonWriter.writeEndObject(); } /** - * Set the lastTimestamp property: Last valid timestamp with value of input data. + * Reads an instance of VariableState from the JsonReader. * - * @param lastTimestamp the lastTimestamp value to set. - * @return the VariableState object itself. + * @param jsonReader The JsonReader being read. + * @return An instance of VariableState if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the VariableState. */ - public VariableState setLastTimestamp(OffsetDateTime lastTimestamp) { - this.lastTimestamp = lastTimestamp; - return this; + @Generated + public static VariableState fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VariableState deserializedVariableState = new VariableState(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("variable".equals(fieldName)) { + deserializedVariableState.variable = reader.getString(); + } else if ("filledNARatio".equals(fieldName)) { + deserializedVariableState.filledNARatio = reader.getNullable(JsonReader::getDouble); + } else if ("effectiveCount".equals(fieldName)) { + deserializedVariableState.effectiveCount = reader.getNullable(JsonReader::getInt); + } else if ("firstTimestamp".equals(fieldName)) { + deserializedVariableState.firstTimestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastTimestamp".equals(fieldName)) { + deserializedVariableState.lastTimestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + return deserializedVariableState; + }); } } diff --git a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/VariableValues.java b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/VariableValues.java index 8372ef5d93d8..eb3df14fa267 100644 --- a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/VariableValues.java +++ b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/VariableValues.java @@ -1,34 +1,40 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.anomalydetector.models; +import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.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; -/** Variable values. */ +/** + * Variable values. + */ @Immutable -public final class VariableValues { +public final class VariableValues implements JsonSerializable { + /* - * Variable name of last detection request. + * Variable name of the last detection request. */ - @JsonProperty(value = "variable", required = true) - private String variable; + @Generated + private final String variable; /* - * Timestamps of last detection request + * Time stamps of the last detection request. */ - @JsonProperty(value = "timestamps", required = true) - private List timestamps; + @Generated + private final List timestamps; /* * Values of variables. */ - @JsonProperty(value = "values", required = true) - private List values; + @Generated + private final List values; /** * Creates an instance of VariableValues class. @@ -37,30 +43,29 @@ public final class VariableValues { * @param timestamps the timestamps value to set. * @param values the values value to set. */ - @JsonCreator - public VariableValues( - @JsonProperty(value = "variable", required = true) String variable, - @JsonProperty(value = "timestamps", required = true) List timestamps, - @JsonProperty(value = "values", required = true) List values) { + @Generated + public VariableValues(String variable, List timestamps, List values) { this.variable = variable; this.timestamps = timestamps; this.values = values; } /** - * Get the variable property: Variable name of last detection request. + * Get the variable property: Variable name of the last detection request. * * @return the variable value. */ + @Generated public String getVariable() { return this.variable; } /** - * Get the timestamps property: Timestamps of last detection request. + * Get the timestamps property: Time stamps of the last detection request. * * @return the timestamps value. */ + @Generated public List getTimestamps() { return this.timestamps; } @@ -70,7 +75,53 @@ public List getTimestamps() { * * @return the values value. */ + @Generated public List getValues() { return this.values; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("variable", this.variable); + jsonWriter.writeArrayField("timestamps", this.timestamps, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("values", this.values, (writer, element) -> writer.writeDouble(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VariableValues from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VariableValues 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 VariableValues. + */ + @Generated + public static VariableValues fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String variable = null; + List timestamps = null; + List values = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("variable".equals(fieldName)) { + variable = reader.getString(); + } else if ("timestamps".equals(fieldName)) { + timestamps = reader.readArray(reader1 -> reader1.getString()); + } else if ("values".equals(fieldName)) { + values = reader.readArray(reader1 -> reader1.getDouble()); + } else { + reader.skipChildren(); + } + } + return new VariableValues(variable, timestamps, values); + }); + } } diff --git a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/package-info.java b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/package-info.java index 89b355aedf89..647bd9a1de1c 100644 --- a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/package-info.java +++ b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/models/package-info.java @@ -1,19 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the data models for AnomalyDetector. The Anomaly Detector API detects anomalies automatically in - * time series data. It supports two kinds of mode, one is for stateless using, another is for stateful using. In - * stateless mode, there are three functionalities. Entire Detect is for detecting the whole series with model trained - * by the time series, Last Detect is detecting last point with model trained by points before. ChangePoint Detect is - * for detecting trend changes in time series. In stateful mode, user can store time series, the stored time series will - * be used for detection anomalies. Under this mode, user can still use the above three functionalities by only giving a - * time range without preparing time series in client side. Besides the above three functionalities, stateful model also - * provide group based detection and labeling service. By leveraging labeling service user can provide labels for each - * detection result, these labels will be used for retuning or regenerating detection models. Inconsistency detection is - * a kind of group based detection, this detection will find inconsistency ones in a set of time series. By using - * anomaly detector service, business customers can discover incidents and establish a logic flow for root cause - * analysis. + * + * Package containing the data models for AnomalyDetector. + * The Anomaly Detector API detects anomalies automatically in time series data. + * It supports both a stateless detection mode and a + * stateful detection mode. In stateless mode, there are three functionalities. Entire + * Detect is for detecting the whole series, with the model trained by the time series. + * Last Detect is for detecting the last point, with the model trained by points before. + * ChangePoint Detect is for detecting trend changes in the time series. In stateful + * mode, the user can store time series. The stored time series will be used for + * detection anomalies. In this mode, the user can still use the preceding three + * functionalities by only giving a time range without preparing time series on the + * client side. Besides the preceding three functionalities, the stateful model + * provides group-based detection and labeling services. By using the labeling + * service, the user can provide labels for each detection result. These labels will be + * used for retuning or regenerating detection models. Inconsistency detection is + * a kind of group-based detection that finds inconsistencies in + * a set of time series. By using the anomaly detector service, business customers can + * discover incidents and establish a logic flow for root cause analysis. + * */ package com.azure.ai.anomalydetector.models; diff --git a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/package-info.java b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/package-info.java index 0f8777c3c0d7..b233df6a7ade 100644 --- a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/package-info.java +++ b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/com/azure/ai/anomalydetector/package-info.java @@ -1,7 +1,6 @@ // 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 AnomalyDetector. The Anomaly Detector API detects anomalies automatically in time * series data. It supports two kinds of mode, one is for stateless using, another is for stateful using. In stateless diff --git a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/module-info.java b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/module-info.java index 11af83df3445..bb8913828d93 100644 --- a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/module-info.java +++ b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/java/module-info.java @@ -1,14 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. module com.azure.ai.anomalydetector { requires transitive com.azure.core; - exports com.azure.ai.anomalydetector; exports com.azure.ai.anomalydetector.models; - - opens com.azure.ai.anomalydetector.models to - com.azure.core, - com.fasterxml.jackson.databind; + opens com.azure.ai.anomalydetector.models to com.azure.core; } diff --git a/sdk/anomalydetector/azure-ai-anomalydetector/src/main/resources/META-INF/azure-ai-anomalydetector_apiview_properties.json b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/resources/META-INF/azure-ai-anomalydetector_apiview_properties.json new file mode 100644 index 000000000000..45972b34c28f --- /dev/null +++ b/sdk/anomalydetector/azure-ai-anomalydetector/src/main/resources/META-INF/azure-ai-anomalydetector_apiview_properties.json @@ -0,0 +1,73 @@ +{ + "flavor": "azure", + "CrossLanguageDefinitionId": { + "com.azure.ai.anomalydetector.AnomalyDetectorClientBuilder": "AnomalyDetector.AnomalyDetectorClient", + "com.azure.ai.anomalydetector.MultivariateAsyncClient": "null", + "com.azure.ai.anomalydetector.MultivariateAsyncClient.deleteMultivariateModel": "AnomalyDetector.Multivariate.deleteMultivariateModel", + "com.azure.ai.anomalydetector.MultivariateAsyncClient.deleteMultivariateModelWithResponse": "AnomalyDetector.Multivariate.deleteMultivariateModel", + "com.azure.ai.anomalydetector.MultivariateAsyncClient.detectMultivariateBatchAnomaly": "AnomalyDetector.Multivariate.detectMultivariateBatchAnomaly", + "com.azure.ai.anomalydetector.MultivariateAsyncClient.detectMultivariateBatchAnomalyWithResponse": "AnomalyDetector.Multivariate.detectMultivariateBatchAnomaly", + "com.azure.ai.anomalydetector.MultivariateAsyncClient.detectMultivariateLastAnomaly": "AnomalyDetector.Multivariate.detectMultivariateLastAnomaly", + "com.azure.ai.anomalydetector.MultivariateAsyncClient.detectMultivariateLastAnomalyWithResponse": "AnomalyDetector.Multivariate.detectMultivariateLastAnomaly", + "com.azure.ai.anomalydetector.MultivariateAsyncClient.getMultivariateBatchDetectionResult": "AnomalyDetector.Multivariate.getMultivariateBatchDetectionResult", + "com.azure.ai.anomalydetector.MultivariateAsyncClient.getMultivariateBatchDetectionResultWithResponse": "AnomalyDetector.Multivariate.getMultivariateBatchDetectionResult", + "com.azure.ai.anomalydetector.MultivariateAsyncClient.getMultivariateModel": "AnomalyDetector.Multivariate.getMultivariateModel", + "com.azure.ai.anomalydetector.MultivariateAsyncClient.getMultivariateModelWithResponse": "AnomalyDetector.Multivariate.getMultivariateModel", + "com.azure.ai.anomalydetector.MultivariateAsyncClient.listMultivariateModels": "AnomalyDetector.Multivariate.listMultivariateModels", + "com.azure.ai.anomalydetector.MultivariateAsyncClient.trainMultivariateModel": "AnomalyDetector.Multivariate.trainMultivariateModel", + "com.azure.ai.anomalydetector.MultivariateAsyncClient.trainMultivariateModelWithResponse": "AnomalyDetector.Multivariate.trainMultivariateModel", + "com.azure.ai.anomalydetector.MultivariateClient": "null", + "com.azure.ai.anomalydetector.MultivariateClient.deleteMultivariateModel": "AnomalyDetector.Multivariate.deleteMultivariateModel", + "com.azure.ai.anomalydetector.MultivariateClient.deleteMultivariateModelWithResponse": "AnomalyDetector.Multivariate.deleteMultivariateModel", + "com.azure.ai.anomalydetector.MultivariateClient.detectMultivariateBatchAnomaly": "AnomalyDetector.Multivariate.detectMultivariateBatchAnomaly", + "com.azure.ai.anomalydetector.MultivariateClient.detectMultivariateBatchAnomalyWithResponse": "AnomalyDetector.Multivariate.detectMultivariateBatchAnomaly", + "com.azure.ai.anomalydetector.MultivariateClient.detectMultivariateLastAnomaly": "AnomalyDetector.Multivariate.detectMultivariateLastAnomaly", + "com.azure.ai.anomalydetector.MultivariateClient.detectMultivariateLastAnomalyWithResponse": "AnomalyDetector.Multivariate.detectMultivariateLastAnomaly", + "com.azure.ai.anomalydetector.MultivariateClient.getMultivariateBatchDetectionResult": "AnomalyDetector.Multivariate.getMultivariateBatchDetectionResult", + "com.azure.ai.anomalydetector.MultivariateClient.getMultivariateBatchDetectionResultWithResponse": "AnomalyDetector.Multivariate.getMultivariateBatchDetectionResult", + "com.azure.ai.anomalydetector.MultivariateClient.getMultivariateModel": "AnomalyDetector.Multivariate.getMultivariateModel", + "com.azure.ai.anomalydetector.MultivariateClient.getMultivariateModelWithResponse": "AnomalyDetector.Multivariate.getMultivariateModel", + "com.azure.ai.anomalydetector.MultivariateClient.listMultivariateModels": "AnomalyDetector.Multivariate.listMultivariateModels", + "com.azure.ai.anomalydetector.MultivariateClient.trainMultivariateModel": "AnomalyDetector.Multivariate.trainMultivariateModel", + "com.azure.ai.anomalydetector.MultivariateClient.trainMultivariateModelWithResponse": "AnomalyDetector.Multivariate.trainMultivariateModel", + "com.azure.ai.anomalydetector.UnivariateAsyncClient": "null", + "com.azure.ai.anomalydetector.UnivariateAsyncClient.detectUnivariateChangePoint": "AnomalyDetector.Univariate.detectUnivariateChangePoint", + "com.azure.ai.anomalydetector.UnivariateAsyncClient.detectUnivariateChangePointWithResponse": "AnomalyDetector.Univariate.detectUnivariateChangePoint", + "com.azure.ai.anomalydetector.UnivariateAsyncClient.detectUnivariateLastPoint": "AnomalyDetector.Univariate.detectUnivariateLastPoint", + "com.azure.ai.anomalydetector.UnivariateAsyncClient.detectUnivariateLastPointWithResponse": "AnomalyDetector.Univariate.detectUnivariateLastPoint", + "com.azure.ai.anomalydetector.UnivariateClient": "null", + "com.azure.ai.anomalydetector.UnivariateClient.detectUnivariateChangePoint": "AnomalyDetector.Univariate.detectUnivariateChangePoint", + "com.azure.ai.anomalydetector.UnivariateClient.detectUnivariateChangePointWithResponse": "AnomalyDetector.Univariate.detectUnivariateChangePoint", + "com.azure.ai.anomalydetector.UnivariateClient.detectUnivariateLastPoint": "AnomalyDetector.Univariate.detectUnivariateLastPoint", + "com.azure.ai.anomalydetector.UnivariateClient.detectUnivariateLastPointWithResponse": "AnomalyDetector.Univariate.detectUnivariateLastPoint", + "com.azure.ai.anomalydetector.models.AlignMode": "AnomalyDetector.Multivariate.AlignMode", + "com.azure.ai.anomalydetector.models.AlignPolicy": "AnomalyDetector.Multivariate.AlignPolicy", + "com.azure.ai.anomalydetector.models.AnomalyDetectionModel": "AnomalyDetector.Multivariate.AnomalyDetectionModel", + "com.azure.ai.anomalydetector.models.AnomalyInterpretation": "AnomalyDetector.Multivariate.AnomalyInterpretation", + "com.azure.ai.anomalydetector.models.AnomalyState": "AnomalyDetector.Multivariate.AnomalyState", + "com.azure.ai.anomalydetector.models.AnomalyValue": "AnomalyDetector.Multivariate.AnomalyValue", + "com.azure.ai.anomalydetector.models.CorrelationChanges": "AnomalyDetector.Multivariate.CorrelationChanges", + "com.azure.ai.anomalydetector.models.DataSchema": "AnomalyDetector.Multivariate.DataSchema", + "com.azure.ai.anomalydetector.models.DiagnosticsInfo": "AnomalyDetector.Multivariate.DiagnosticsInfo", + "com.azure.ai.anomalydetector.models.ErrorResponse": "AnomalyDetector.Multivariate.ErrorResponse", + "com.azure.ai.anomalydetector.models.FillNAMethod": "AnomalyDetector.Multivariate.FillNAMethod", + "com.azure.ai.anomalydetector.models.ImputeMode": "AnomalyDetector.Univariate.ImputeMode", + "com.azure.ai.anomalydetector.models.ModelInfo": "AnomalyDetector.Multivariate.ModelInfo", + "com.azure.ai.anomalydetector.models.ModelState": "AnomalyDetector.Multivariate.ModelState", + "com.azure.ai.anomalydetector.models.ModelStatus": "AnomalyDetector.Multivariate.ModelStatus", + "com.azure.ai.anomalydetector.models.MultivariateBatchDetectionOptions": "AnomalyDetector.Multivariate.MultivariateBatchDetectionOptions", + "com.azure.ai.anomalydetector.models.MultivariateBatchDetectionResultSummary": "AnomalyDetector.Multivariate.MultivariateBatchDetectionResultSummary", + "com.azure.ai.anomalydetector.models.MultivariateBatchDetectionStatus": "AnomalyDetector.Multivariate.MultivariateBatchDetectionStatus", + "com.azure.ai.anomalydetector.models.MultivariateDetectionResult": "AnomalyDetector.Multivariate.MultivariateDetectionResult", + "com.azure.ai.anomalydetector.models.MultivariateLastDetectionOptions": "AnomalyDetector.Multivariate.MultivariateLastDetectionOptions", + "com.azure.ai.anomalydetector.models.MultivariateLastDetectionResult": "AnomalyDetector.Multivariate.MultivariateLastDetectionResult", + "com.azure.ai.anomalydetector.models.TimeGranularity": "AnomalyDetector.Univariate.TimeGranularity", + "com.azure.ai.anomalydetector.models.TimeSeriesPoint": "AnomalyDetector.Univariate.TimeSeriesPoint", + "com.azure.ai.anomalydetector.models.UnivariateChangePointDetectionOptions": "AnomalyDetector.Univariate.UnivariateChangePointDetectionOptions", + "com.azure.ai.anomalydetector.models.UnivariateChangePointDetectionResult": "AnomalyDetector.Univariate.UnivariateChangePointDetectionResult", + "com.azure.ai.anomalydetector.models.UnivariateDetectionOptions": "AnomalyDetector.Univariate.UnivariateDetectionOptions", + "com.azure.ai.anomalydetector.models.UnivariateLastDetectionResult": "AnomalyDetector.Univariate.UnivariateLastDetectionResult", + "com.azure.ai.anomalydetector.models.VariableState": "AnomalyDetector.Multivariate.VariableState", + "com.azure.ai.anomalydetector.models.VariableValues": "AnomalyDetector.Multivariate.VariableValues" + } +} diff --git a/sdk/anomalydetector/azure-ai-anomalydetector/src/samples/java/com/azure/ai/anomalydetector/DetectAnomaliesEntireSeries.java b/sdk/anomalydetector/azure-ai-anomalydetector/src/samples/java/com/azure/ai/anomalydetector/DetectAnomaliesEntireSeries.java index 6381e04ffc50..f665070aadd7 100644 --- a/sdk/anomalydetector/azure-ai-anomalydetector/src/samples/java/com/azure/ai/anomalydetector/DetectAnomaliesEntireSeries.java +++ b/sdk/anomalydetector/azure-ai-anomalydetector/src/samples/java/com/azure/ai/anomalydetector/DetectAnomaliesEntireSeries.java @@ -3,23 +3,16 @@ package com.azure.ai.anomalydetector; -import com.azure.ai.anomalydetector.models.UnivariateDetectionOptions; -import com.azure.ai.anomalydetector.models.UnivariateEntireDetectionResult; -import com.azure.ai.anomalydetector.models.TimeGranularity; import com.azure.ai.anomalydetector.models.ImputeMode; +import com.azure.ai.anomalydetector.models.TimeGranularity; import com.azure.ai.anomalydetector.models.TimeSeriesPoint; - +import com.azure.ai.anomalydetector.models.UnivariateDetectionOptions; +import com.azure.ai.anomalydetector.models.UnivariateEntireDetectionResult; import com.azure.core.credential.AzureKeyCredential; import com.azure.core.util.Configuration; import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.time.OffsetDateTime; -import java.util.Arrays; import java.util.List; -import java.util.stream.Collectors; /** @@ -37,32 +30,13 @@ public static void main(final String[] args) throws IOException { String endpoint = Configuration.getGlobalConfiguration().get("AZURE_ANOMALY_DETECTOR_ENDPOINT"); String key = Configuration.getGlobalConfiguration().get("AZURE_ANOMALY_DETECTOR_API_KEY"); - AnomalyDetectorClient anomalyDetectorClient = + UnivariateClient anomalyDetectorClient = new AnomalyDetectorClientBuilder() .credential(new AzureKeyCredential(key)) .endpoint(endpoint) - .buildClient(); + .buildUnivariateClient(); - // Read the time series from csv file and organize the time series into list of TimeSeriesPoint. - // The sample csv file has no header, and it contains 2 columns, namely timestamp and value. - // The following is a snippet of the sample csv file: - // 2018-03-01T00:00:00Z,32858923 - // 2018-03-02T00:00:00Z,29615278 - // 2018-03-03T00:00:00Z,22839355 - // 2018-03-04T00:00:00Z,25948736 - Path path = Paths.get("azure-ai-anomalydetector/src/samples/java/sample_data/request-data.csv"); - List requestData = Files.readAllLines(path); - List series = requestData.stream() - .map(line -> line.trim()) - .filter(line -> line.length() > 0) - .map(line -> line.split(",", 2)) - .filter(splits -> splits.length == 2) - .map(splits -> { - TimeSeriesPoint timeSeriesPoint = new TimeSeriesPoint(Float.parseFloat(splits[1])); - timeSeriesPoint.setTimestamp(OffsetDateTime.parse(splits[0])); - return timeSeriesPoint; - }) - .collect(Collectors.toList()); + List series = SampleUtils.loadTimeSeriesData(); System.out.println("Detecting anomalies as a batch..."); UnivariateDetectionOptions request = new UnivariateDetectionOptions(series); @@ -86,9 +60,9 @@ public static void main(final String[] args) throws IOException { System.out.println(); System.out.println("All response data: "); System.out.println(response.getPeriod()); - System.out.println("expectedValues: " + Arrays.toString(response.getExpectedValues().toArray(new Double[0]))); - System.out.print("upperMargins: " + Arrays.toString(response.getUpperMargins().toArray(new Double[0]))); - System.out.print("lowerMargins: " + Arrays.toString(response.getLowerMargins().toArray(new Double[0]))); - System.out.print("isAnomaly: " + Arrays.toString(response.getIsAnomaly().toArray(new Boolean[0]))); + System.out.println("expectedValues: " + response.getExpectedValues()); + System.out.print("upperMargins: " + response.getUpperMargins()); + System.out.print("lowerMargins: " + response.getLowerMargins()); + System.out.print("isAnomaly: " + response.getIsAnomaly()); } } diff --git a/sdk/anomalydetector/azure-ai-anomalydetector/src/samples/java/com/azure/ai/anomalydetector/DetectAnomaliesLastPoint.java b/sdk/anomalydetector/azure-ai-anomalydetector/src/samples/java/com/azure/ai/anomalydetector/DetectAnomaliesLastPoint.java index c9f145773e25..81a174b15334 100644 --- a/sdk/anomalydetector/azure-ai-anomalydetector/src/samples/java/com/azure/ai/anomalydetector/DetectAnomaliesLastPoint.java +++ b/sdk/anomalydetector/azure-ai-anomalydetector/src/samples/java/com/azure/ai/anomalydetector/DetectAnomaliesLastPoint.java @@ -3,23 +3,16 @@ package com.azure.ai.anomalydetector; -import com.azure.ai.anomalydetector.models.UnivariateDetectionOptions; -import com.azure.ai.anomalydetector.models.UnivariateLastDetectionResult; +import com.azure.ai.anomalydetector.models.ImputeMode; import com.azure.ai.anomalydetector.models.TimeGranularity; import com.azure.ai.anomalydetector.models.TimeSeriesPoint; -import com.azure.ai.anomalydetector.models.ImputeMode; - +import com.azure.ai.anomalydetector.models.UnivariateDetectionOptions; +import com.azure.ai.anomalydetector.models.UnivariateLastDetectionResult; import com.azure.core.credential.AzureKeyCredential; import com.azure.core.util.Configuration; import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.time.OffsetDateTime; import java.util.List; -import java.util.stream.Collectors; - /** * Sample for detecting whether the last point of time series is anomaly or not. @@ -36,32 +29,10 @@ public static void main(final String[] args) throws IOException { String endpoint = Configuration.getGlobalConfiguration().get("AZURE_ANOMALY_DETECTOR_ENDPOINT"); String key = Configuration.getGlobalConfiguration().get("AZURE_ANOMALY_DETECTOR_API_KEY"); - AnomalyDetectorClient anomalyDetectorClient = - new AnomalyDetectorClientBuilder() - .credential(new AzureKeyCredential(key)) - .endpoint(endpoint) - .buildClient(); + UnivariateClient anomalyDetectorClient = new AnomalyDetectorClientBuilder().credential( + new AzureKeyCredential(key)).endpoint(endpoint).buildUnivariateClient(); - // Read the time series from csv file and organize the time series into list of TimeSeriesPoint. - // The sample csv file has no header, and it contains 2 columns, namely timestamp and value. - // The following is a snippet of the sample csv file: - // 2018-03-01T00:00:00Z,32858923 - // 2018-03-02T00:00:00Z,29615278 - // 2018-03-03T00:00:00Z,22839355 - // 2018-03-04T00:00:00Z,25948736 - Path path = Paths.get("azure-ai-anomalydetector/src/samples/java/sample_data/request-data.csv"); - List requestData = Files.readAllLines(path); - List series = requestData.stream() - .map(line -> line.trim()) - .filter(line -> line.length() > 0) - .map(line -> line.split(",", 2)) - .filter(splits -> splits.length == 2) - .map(splits -> { - TimeSeriesPoint timeSeriesPoint = new TimeSeriesPoint(Float.parseFloat(splits[1])); - timeSeriesPoint.setTimestamp(OffsetDateTime.parse(splits[0])); - return timeSeriesPoint; - }) - .collect(Collectors.toList()); + List series = SampleUtils.loadTimeSeriesData(); System.out.println("Determining if latest data point is an anomaly..."); UnivariateDetectionOptions request = new UnivariateDetectionOptions(series); @@ -70,8 +41,7 @@ public static void main(final String[] args) throws IOException { request.setImputeMode(ImputeMode.AUTO); UnivariateLastDetectionResult response = anomalyDetectorClient.detectUnivariateLastPoint(request); - System.out.println("ExpectedValue: " + response.getExpectedValue() - + ", Severity: " + response.getSeverity()); + System.out.println("ExpectedValue: " + response.getExpectedValue() + ", Severity: " + response.getSeverity()); if (response.isAnomaly()) { System.out.println("The latest point was detected as an anomaly."); } else { diff --git a/sdk/anomalydetector/azure-ai-anomalydetector/src/samples/java/com/azure/ai/anomalydetector/DetectChangePoints.java b/sdk/anomalydetector/azure-ai-anomalydetector/src/samples/java/com/azure/ai/anomalydetector/DetectChangePoints.java index c9691fca3453..66ae8354421a 100644 --- a/sdk/anomalydetector/azure-ai-anomalydetector/src/samples/java/com/azure/ai/anomalydetector/DetectChangePoints.java +++ b/sdk/anomalydetector/azure-ai-anomalydetector/src/samples/java/com/azure/ai/anomalydetector/DetectChangePoints.java @@ -3,23 +3,15 @@ package com.azure.ai.anomalydetector; +import com.azure.ai.anomalydetector.models.TimeGranularity; +import com.azure.ai.anomalydetector.models.TimeSeriesPoint; import com.azure.ai.anomalydetector.models.UnivariateChangePointDetectionOptions; import com.azure.ai.anomalydetector.models.UnivariateChangePointDetectionResult; -import com.azure.ai.anomalydetector.models.TimeSeriesPoint; -import com.azure.ai.anomalydetector.models.TimeGranularity; - import com.azure.core.credential.AzureKeyCredential; import com.azure.core.util.Configuration; import java.io.IOException; -import java.nio.file.Files; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.nio.file.Path; -import java.nio.file.Paths; import java.util.List; -import java.util.stream.Collectors; - /** * Sample for detecting change points in a piece of time series. @@ -36,36 +28,15 @@ public static void main(final String[] args) throws IOException { String endpoint = Configuration.getGlobalConfiguration().get("AZURE_ANOMALY_DETECTOR_ENDPOINT"); String key = Configuration.getGlobalConfiguration().get("AZURE_ANOMALY_DETECTOR_API_KEY"); - AnomalyDetectorClient anomalyDetectorClient = - new AnomalyDetectorClientBuilder() - .credential(new AzureKeyCredential(key)) - .endpoint(endpoint) - .buildClient(); + UnivariateClient anomalyDetectorClient = new AnomalyDetectorClientBuilder().credential( + new AzureKeyCredential(key)).endpoint(endpoint).buildUnivariateClient(); - // Read the time series from csv file and organize the time series into list of TimeSeriesPoint. - // The sample csv file has no header, and it contains 2 columns, namely timestamp and value. - // The following is a snippet of the sample csv file: - // 2018-03-01T00:00:00Z,32858923 - // 2018-03-02T00:00:00Z,29615278 - // 2018-03-03T00:00:00Z,22839355 - // 2018-03-04T00:00:00Z,25948736 - Path path = Paths.get("azure-ai-anomalydetector/src/samples/java/sample_data/request-data.csv"); - List requestData = Files.readAllLines(path); - List series = requestData.stream() - .map(line -> line.trim()) - .filter(line -> line.length() > 0) - .map(line -> line.split(",", 2)) - .filter(splits -> splits.length == 2) - .map(splits -> { - TimeSeriesPoint timeSeriesPoint = new TimeSeriesPoint(Float.parseFloat(splits[1])); - timeSeriesPoint.setTimestamp(OffsetDateTime.parse(splits[0])); - return timeSeriesPoint; - }) - .collect(Collectors.toList()); + List series = SampleUtils.loadTimeSeriesData(); System.out.println("Detecting change points..."); // Set the granularity to be DAILY since the minimal interval in time of the sample data is one day. - UnivariateChangePointDetectionOptions request = new UnivariateChangePointDetectionOptions(series, TimeGranularity.DAILY); + UnivariateChangePointDetectionOptions request = new UnivariateChangePointDetectionOptions(series, + TimeGranularity.DAILY); UnivariateChangePointDetectionResult response = anomalyDetectorClient.detectUnivariateChangePoint(request); if (response.getIsChangePoint().contains(true)) { System.out.println("Change points found in the following data positions:"); @@ -81,9 +52,8 @@ public static void main(final String[] args) throws IOException { System.out.println("All response data: "); System.out.println(response.getPeriod()); - System.out.println(Arrays.toString(response.getIsChangePoint().toArray(new Boolean[0]))); - System.out.println(Arrays.toString(response.getConfidenceScores().toArray(new Double[0]))); - System.out.println(Arrays.toString(response.getIsChangePoint().toArray(new Boolean[0]))); - + System.out.println(response.getIsChangePoint()); + System.out.println(response.getConfidenceScores()); + System.out.println(response.getIsChangePoint()); } } diff --git a/sdk/anomalydetector/azure-ai-anomalydetector/src/samples/java/com/azure/ai/anomalydetector/MultivariateSample.java b/sdk/anomalydetector/azure-ai-anomalydetector/src/samples/java/com/azure/ai/anomalydetector/MultivariateSample.java index a4857c1c1dd1..ccf184b236b8 100644 --- a/sdk/anomalydetector/azure-ai-anomalydetector/src/samples/java/com/azure/ai/anomalydetector/MultivariateSample.java +++ b/sdk/anomalydetector/azure-ai-anomalydetector/src/samples/java/com/azure/ai/anomalydetector/MultivariateSample.java @@ -3,41 +3,36 @@ package com.azure.ai.anomalydetector; -import com.azure.ai.anomalydetector.models.ModelInfo; +import com.azure.ai.anomalydetector.models.AlignMode; +import com.azure.ai.anomalydetector.models.AlignPolicy; import com.azure.ai.anomalydetector.models.AnomalyDetectionModel; +import com.azure.ai.anomalydetector.models.AnomalyState; +import com.azure.ai.anomalydetector.models.DataSchema; +import com.azure.ai.anomalydetector.models.ErrorResponse; +import com.azure.ai.anomalydetector.models.FillNAMethod; +import com.azure.ai.anomalydetector.models.ModelInfo; import com.azure.ai.anomalydetector.models.ModelStatus; import com.azure.ai.anomalydetector.models.MultivariateBatchDetectionOptions; -import com.azure.ai.anomalydetector.models.MultivariateDetectionResult; import com.azure.ai.anomalydetector.models.MultivariateBatchDetectionStatus; +import com.azure.ai.anomalydetector.models.MultivariateDetectionResult; import com.azure.ai.anomalydetector.models.MultivariateLastDetectionOptions; import com.azure.ai.anomalydetector.models.MultivariateLastDetectionResult; -import com.azure.ai.anomalydetector.models.DataSchema; -import com.azure.ai.anomalydetector.models.AlignPolicy; -import com.azure.ai.anomalydetector.models.ErrorResponse; -import com.azure.ai.anomalydetector.models.AnomalyState; -import com.azure.ai.anomalydetector.models.AlignMode; -import com.azure.ai.anomalydetector.models.FillNAMethod; - import com.azure.core.credential.AzureKeyCredential; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.BinaryData; import com.azure.core.util.Configuration; +import com.azure.json.JsonProviders; +import com.azure.json.JsonReader; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; -import java.io.UncheckedIOException; import java.io.InputStream; - +import java.io.UncheckedIOException; import java.nio.ByteBuffer; import java.time.OffsetDateTime; import java.util.UUID; import java.util.concurrent.TimeUnit; -import javax.json.Json; -import javax.json.JsonReader; - - public class MultivariateSample { private static void close(FileOutputStream fos) { try { @@ -56,38 +51,31 @@ private static void write(FileOutputStream fos, ByteBuffer b) { } } - private static AnomalyDetectorClient getClient(String endpoint, String key) { - AnomalyDetectorClient anomalyDetectorClient = - new AnomalyDetectorClientBuilder() - .credential(new AzureKeyCredential(key)) - .endpoint(endpoint) - .buildClient(); - return anomalyDetectorClient; + private static MultivariateClient getClient(String endpoint, String key) { + return new AnomalyDetectorClientBuilder().credential(new AzureKeyCredential(key)) + .endpoint(endpoint) + .buildMultivariateClient(); } - private static UUID createModel(AnomalyDetectorClient client, ModelInfo modelInfo) { + private static UUID createModel(MultivariateClient client, ModelInfo modelInfo) { AnomalyDetectionModel model = client.trainMultivariateModel(modelInfo); - UUID modelId = UUID.fromString(model.getModelId()); - return modelId; + return UUID.fromString(model.getModelId()); } - private static ModelInfo getModelInfo(AnomalyDetectorClient client, UUID modelId) { - AnomalyDetectionModel model = client.getMultivariateModel(modelId.toString()); - return model.getModelInfo(); + private static ModelInfo getModelInfo(MultivariateClient client, UUID modelId) { + return client.getMultivariateModel(modelId.toString()).getModelInfo(); } - private static UUID getResultId(AnomalyDetectorClient client, MultivariateBatchDetectionOptions body, UUID modelId) { + private static UUID getResultId(MultivariateClient client, MultivariateBatchDetectionOptions body, UUID modelId) { MultivariateDetectionResult detectionResult = client.detectMultivariateBatchAnomaly(modelId.toString(), body); - UUID resultId = UUID.fromString(detectionResult.getResultId()); - return resultId; + return UUID.fromString(detectionResult.getResultId()); } - private static MultivariateBatchDetectionStatus getInferenceStatus(AnomalyDetectorClient client, UUID resultId) { - MultivariateDetectionResult detectionResult = client.getMultivariateBatchDetectionResult(resultId.toString()); - return detectionResult.getSummary().getStatus(); + private static MultivariateBatchDetectionStatus getInferenceStatus(MultivariateClient client, UUID resultId) { + return client.getMultivariateBatchDetectionResult(resultId.toString()).getSummary().getStatus(); } - private static void getModelList(AnomalyDetectorClient client) { + private static void getModelList(MultivariateClient client) { PagedIterable response = client.listMultivariateModels(); System.out.println("ModelList: "); @@ -98,9 +86,9 @@ private static void getModelList(AnomalyDetectorClient client) { }); } - private static MultivariateLastDetectionResult getLastDetectResult(AnomalyDetectorClient client, MultivariateLastDetectionOptions body, UUID modelId) { - MultivariateLastDetectionResult res = client.detectMultivariateLastAnomaly(modelId.toString(), body); - return res; + private static MultivariateLastDetectionResult getLastDetectResult(MultivariateClient client, + MultivariateLastDetectionOptions body, UUID modelId) { + return client.detectMultivariateLastAnomaly(modelId.toString(), body); } public static void run(String datasource, DataSchema dataSchema) throws Exception { @@ -108,15 +96,14 @@ public static void run(String datasource, DataSchema dataSchema) throws Exceptio String key = Configuration.getGlobalConfiguration().get("AZURE_ANOMALY_DETECTOR_API_KEY"); // Get multivariate client - AnomalyDetectorClient client = getClient(endpoint, key); + MultivariateClient client = getClient(endpoint, key); // set training request OffsetDateTime startTime = OffsetDateTime.parse("2021-01-02T00:00:00Z"); OffsetDateTime endTime = OffsetDateTime.parse("2021-01-02T05:00:00Z"); ModelInfo trainRequest = new ModelInfo(datasource, startTime, endTime); trainRequest.setSlidingWindow(200) - .setAlignPolicy(new AlignPolicy() - .setAlignMode(AlignMode.OUTER) + .setAlignPolicy(new AlignPolicy().setAlignMode(AlignMode.OUTER) .setFillNAMethod(FillNAMethod.LINEAR) .setPaddingValue(0.0)) .setDataSchema(dataSchema) @@ -128,16 +115,16 @@ public static void run(String datasource, DataSchema dataSchema) throws Exceptio // Check model status util the model get ready while (true) { ModelInfo modelInfo = getModelInfo(client, modelId); - ModelStatus modelStatus = ModelStatus.valueOf(modelInfo.getStatus().toString()); + ModelStatus modelStatus = modelInfo.getStatus(); if (modelStatus == ModelStatus.READY) { System.out.println("READY"); break; } else if (modelStatus == ModelStatus.FAILED) { System.out.println("FAILED"); - String errorStr = ""; + StringBuilder errorStr = new StringBuilder(); for (ErrorResponse errorResponse : modelInfo.getErrors()) { System.out.println(errorResponse.getCode() + errorResponse.getMessage()); - errorStr += ";" + errorResponse.getCode() + errorResponse.getMessage(); + errorStr.append(";").append(errorResponse.getCode()).append(errorResponse.getMessage()); } throw new RuntimeException("Training Failed. Error: " + errorStr); } @@ -147,7 +134,9 @@ public static void run(String datasource, DataSchema dataSchema) throws Exceptio // Start inference and get the Result ID OffsetDateTime endTimeDetect = OffsetDateTime.parse("2021-01-02T12:00:00Z"); - MultivariateBatchDetectionOptions detectionRequest = new MultivariateBatchDetectionOptions(datasource, 10, startTime, endTimeDetect); + MultivariateBatchDetectionOptions detectionRequest = new MultivariateBatchDetectionOptions(datasource, + startTime, endTimeDetect) + .setTopContributorCount(10); UUID resultId = getResultId(client, detectionRequest, modelId); System.out.println("resultId: " + resultId); while (true) { // Check inference status util the result get ready @@ -164,16 +153,19 @@ public static void run(String datasource, DataSchema dataSchema) throws Exceptio } // Synchronized anomaly detection - InputStream fileInputStream = new FileInputStream("azure-ai-anomalydetector\\src\\samples\\java\\sample_data\\sync_infer_body.json"); - JsonReader reader = Json.createReader(fileInputStream); - BinaryData detectBody = BinaryData.fromString(reader.readObject().toString()); - MultivariateLastDetectionOptions lastDetectionRequest = detectBody.toObject(MultivariateLastDetectionOptions.class); - MultivariateLastDetectionResult lastDetectionResult = getLastDetectResult(client, lastDetectionRequest, modelId); + MultivariateLastDetectionOptions lastDetectionRequest; + try (InputStream fileInputStream = new FileInputStream( + "azure-ai-anomalydetector\\src\\samples\\java\\sample_data\\sync_infer_body.json"); + JsonReader jsonReader = JsonProviders.createReader(fileInputStream)) { + lastDetectionRequest = MultivariateLastDetectionOptions.fromJson(jsonReader); + } + + MultivariateLastDetectionResult lastDetectionResult = getLastDetectResult(client, lastDetectionRequest, + modelId); for (AnomalyState anomalyState : lastDetectionResult.getResults()) { - System.out.println("timestamp: " + anomalyState.getTimestamp().toString() - + ", isAnomaly: " + anomalyState.getValue().isAnomaly() - + ", Score: " + anomalyState.getValue().getScore() - ); + System.out.println( + "timestamp: " + anomalyState.getTimestamp().toString() + ", isAnomaly: " + anomalyState.getValue() + .isAnomaly() + ", Score: " + anomalyState.getValue().getScore()); } //Delete model diff --git a/sdk/anomalydetector/azure-ai-anomalydetector/src/samples/java/com/azure/ai/anomalydetector/ReadmeSamples.java b/sdk/anomalydetector/azure-ai-anomalydetector/src/samples/java/com/azure/ai/anomalydetector/ReadmeSamples.java index a73d634e99f5..3779e79672e1 100644 --- a/sdk/anomalydetector/azure-ai-anomalydetector/src/samples/java/com/azure/ai/anomalydetector/ReadmeSamples.java +++ b/sdk/anomalydetector/azure-ai-anomalydetector/src/samples/java/com/azure/ai/anomalydetector/ReadmeSamples.java @@ -13,11 +13,15 @@ private static void createClient() { String endpoint = Configuration.getGlobalConfiguration().get("AZURE_ANOMALY_DETECTOR_ENDPOINT"); String key = Configuration.getGlobalConfiguration().get("AZURE_ANOMALY_DETECTOR_API_KEY"); - AnomalyDetectorClient anomalyDetectorClient = - new AnomalyDetectorClientBuilder() - .credential(new AzureKeyCredential(key)) - .endpoint(endpoint) - .buildClient(); + MultivariateClient multivariateClient = new AnomalyDetectorClientBuilder() + .credential(new AzureKeyCredential(key)) + .endpoint(endpoint) + .buildMultivariateClient(); + + UnivariateClient univariateClient = new AnomalyDetectorClientBuilder() + .credential(new AzureKeyCredential(key)) + .endpoint(endpoint) + .buildUnivariateClient(); // END: readme-sample-createAnomalyDetectorClient } } diff --git a/sdk/anomalydetector/azure-ai-anomalydetector/src/samples/java/com/azure/ai/anomalydetector/SampleUtils.java b/sdk/anomalydetector/azure-ai-anomalydetector/src/samples/java/com/azure/ai/anomalydetector/SampleUtils.java new file mode 100644 index 000000000000..f0ecb3ca454a --- /dev/null +++ b/sdk/anomalydetector/azure-ai-anomalydetector/src/samples/java/com/azure/ai/anomalydetector/SampleUtils.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.ai.anomalydetector; + +import com.azure.ai.anomalydetector.models.TimeSeriesPoint; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.stream.Collectors; + +/** + * Helper class for common sample methods. + */ +final class SampleUtils { + /** + * Loads the {@link TimeSeriesPoint} data from the csv file. + * + * @return A list of {@link TimeSeriesPoint} data. + * @throws IOException Exception thrown when there is an error in reading all the lines from the csv file. + */ + static List loadTimeSeriesData() throws IOException { + // Read the time series from csv file and organize the time series into list of TimeSeriesPoint. + // The sample csv file has no header, and it contains 2 columns, namely timestamp and value. + // The following is a snippet of the sample csv file: + // 2018-03-01T00:00:00Z,32858923 + // 2018-03-02T00:00:00Z,29615278 + // 2018-03-03T00:00:00Z,22839355 + // 2018-03-04T00:00:00Z,25948736 + Path path = Paths.get("azure-ai-anomalydetector/src/samples/java/sample_data/request-data.csv"); + List requestData = Files.readAllLines(path); + return requestData.stream() + .map(String::trim) + .filter(line -> !line.isEmpty()) + .map(line -> line.split(",", 2)) + .filter(splits -> splits.length == 2) + .map(splits -> { + TimeSeriesPoint timeSeriesPoint = new TimeSeriesPoint(Float.parseFloat(splits[1])); + timeSeriesPoint.setTimestamp(OffsetDateTime.parse(splits[0])); + return timeSeriesPoint; + }) + .collect(Collectors.toList()); + } +} diff --git a/sdk/anomalydetector/azure-ai-anomalydetector/src/test/java/com/azure/ai/anomalydetector/AnomalyDetectorClientTest.java b/sdk/anomalydetector/azure-ai-anomalydetector/src/test/java/com/azure/ai/anomalydetector/AnomalyDetectorClientTest.java index 4e800c59234b..7c74b3dd922d 100644 --- a/sdk/anomalydetector/azure-ai-anomalydetector/src/test/java/com/azure/ai/anomalydetector/AnomalyDetectorClientTest.java +++ b/sdk/anomalydetector/azure-ai-anomalydetector/src/test/java/com/azure/ai/anomalydetector/AnomalyDetectorClientTest.java @@ -3,29 +3,29 @@ package com.azure.ai.anomalydetector; +import com.azure.ai.anomalydetector.models.UnivariateEntireDetectionResult; import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.logging.LogLevel; +import com.azure.json.JsonProviders; +import com.azure.json.JsonReader; +import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import javax.json.Json; -import javax.json.JsonArray; -import javax.json.JsonObject; -import java.io.StringReader; +import java.io.IOException; import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; /** - * Unit tests for {@link AnomalyDetectorClient}. + * Unit tests for {@link UnivariateClient}. */ public class AnomalyDetectorClientTest extends AnomalyDetectorClientTestBase { private static final ClientLogger LOGGER = new ClientLogger(AnomalyDetectorClientTest.class); - private AnomalyDetectorClient getClient() { - return getClientBuilder().buildClient(); + private UnivariateClient getClient() { + return getClientBuilder().buildUnivariateClient(); } @Test @@ -36,25 +36,24 @@ public void testDetect() { LOGGER.log(LogLevel.INFORMATIONAL, response::toString); String responseBodyStr = response.getValue().toString(); - JsonObject responseJsonObject = Json.createReader(new StringReader(responseBodyStr)).readObject(); - assertEquals(200, response.getStatusCode()); - assertEquals(24, responseJsonObject.getJsonArray("expectedValues").size()); - assertEquals(24, responseJsonObject.getJsonArray("isAnomaly").size()); - assertEquals(24, responseJsonObject.getJsonArray("isPositiveAnomaly").size()); - assertEquals(24, responseJsonObject.getJsonArray("lowerMargins").size()); - assertEquals(24, responseJsonObject.getJsonArray("severity").size()); - assertEquals(24, responseJsonObject.getJsonArray("upperMargins").size()); - - JsonArray isAnomalyJA = responseJsonObject.getJsonArray("isAnomaly"); - for (int i = 0; i < isAnomalyJA.size(); i++) { - assertFalse(isAnomalyJA.getBoolean(i)); - } - JsonArray isPositiveAnomalyJA = responseJsonObject.getJsonArray("isPositiveAnomaly"); - for (int i = 0; i < isPositiveAnomalyJA.size(); i++) { - assertFalse(isPositiveAnomalyJA.getBoolean(i)); + UnivariateEntireDetectionResult result; + try (JsonReader jsonReader = JsonProviders.createReader(responseBodyStr)) { + result = UnivariateEntireDetectionResult.fromJson(jsonReader); + } catch (IOException e) { + throw new RuntimeException(e); } + assertEquals(200, response.getStatusCode()); + assertEquals(24, result.getExpectedValues().size()); + assertEquals(24, result.getIsAnomaly().size()); + assertEquals(24, result.getIsPositiveAnomaly().size()); + assertEquals(24, result.getLowerMargins().size()); + assertEquals(24, result.getSeverity().size()); + assertEquals(24, result.getUpperMargins().size()); + + result.getIsAnomaly().forEach(Assertions::assertFalse); + result.getIsPositiveAnomaly().forEach(Assertions::assertFalse); }); } } diff --git a/sdk/anomalydetector/azure-ai-anomalydetector/src/test/java/com/azure/ai/anomalydetector/MultivariateAnomalyDetectorClientTest.java b/sdk/anomalydetector/azure-ai-anomalydetector/src/test/java/com/azure/ai/anomalydetector/MultivariateAnomalyDetectorClientTest.java index 874283d77379..7fc928da8ef9 100644 --- a/sdk/anomalydetector/azure-ai-anomalydetector/src/test/java/com/azure/ai/anomalydetector/MultivariateAnomalyDetectorClientTest.java +++ b/sdk/anomalydetector/azure-ai-anomalydetector/src/test/java/com/azure/ai/anomalydetector/MultivariateAnomalyDetectorClientTest.java @@ -12,11 +12,11 @@ public class MultivariateAnomalyDetectorClientTest extends AnomalyDetectorClientTestBase { private static final ClientLogger LOGGER = new ClientLogger(MultivariateAnomalyDetectorClientTest.class); - private AnomalyDetectorClient getClient() { - return getClientBuilder().buildClient(); + private MultivariateClient getClient() { + return getClientBuilder().buildMultivariateClient(); } - private static void getModelList(AnomalyDetectorClient client, Integer skip, Integer top) { + private static void getModelList(MultivariateClient client, Integer skip, Integer top) { PagedIterable response = client.listMultivariateModels(skip, top); LOGGER.info("ModelList: "); @@ -26,7 +26,7 @@ private static void getModelList(AnomalyDetectorClient client, Integer skip, Int @Test public void testDetect() { testDetectEntireSeriesWithResponse(request -> { - AnomalyDetectorClient client = getClient(); + MultivariateClient client = getClient(); Integer skip = 0; Integer top = 5; diff --git a/sdk/anomalydetector/azure-ai-anomalydetector/src/test/java/com/azure/ai/anomalydetector/generated/AnomalyDetectorClientTestBase.java b/sdk/anomalydetector/azure-ai-anomalydetector/src/test/java/com/azure/ai/anomalydetector/generated/AnomalyDetectorClientTestBase.java index 2ac4734f64a8..a3163ac10156 100644 --- a/sdk/anomalydetector/azure-ai-anomalydetector/src/test/java/com/azure/ai/anomalydetector/generated/AnomalyDetectorClientTestBase.java +++ b/sdk/anomalydetector/azure-ai-anomalydetector/src/test/java/com/azure/ai/anomalydetector/generated/AnomalyDetectorClientTestBase.java @@ -1,33 +1,51 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.anomalydetector.generated; -import com.azure.ai.anomalydetector.AnomalyDetectorClient; +// The Java test files under 'generated' package are generated for your reference. +// If you wish to modify these files, please copy them out of the 'generated' package, and modify there. +// See https://aka.ms/azsdk/dpg/java/tests for guide on adding a test. + import com.azure.ai.anomalydetector.AnomalyDetectorClientBuilder; +import com.azure.ai.anomalydetector.MultivariateClient; +import com.azure.ai.anomalydetector.UnivariateClient; import com.azure.core.http.HttpClient; import com.azure.core.http.policy.HttpLogDetailLevel; import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.test.TestBase; import com.azure.core.test.TestMode; +import com.azure.core.test.TestProxyTestBase; import com.azure.core.util.Configuration; -class AnomalyDetectorClientTestBase extends TestBase { - protected AnomalyDetectorClient anomalyDetectorClient; +class AnomalyDetectorClientTestBase extends TestProxyTestBase { + protected UnivariateClient univariateClient; + + protected MultivariateClient multivariateClient; @Override protected void beforeTest() { - AnomalyDetectorClientBuilder anomalyDetectorClientbuilder = - new AnomalyDetectorClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + AnomalyDetectorClientBuilder univariateClientbuilder = new AnomalyDetectorClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { - anomalyDetectorClientbuilder.httpClient(interceptorManager.getPlaybackClient()); + univariateClientbuilder.httpClient(interceptorManager.getPlaybackClient()); } else if (getTestMode() == TestMode.RECORD) { - anomalyDetectorClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + univariateClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); } - anomalyDetectorClient = anomalyDetectorClientbuilder.buildClient(); + univariateClient = univariateClientbuilder.buildUnivariateClient(); + + AnomalyDetectorClientBuilder multivariateClientbuilder = new AnomalyDetectorClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + multivariateClientbuilder.httpClient(interceptorManager.getPlaybackClient()); + } else if (getTestMode() == TestMode.RECORD) { + multivariateClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + multivariateClient = multivariateClientbuilder.buildMultivariateClient(); + } } diff --git a/sdk/anomalydetector/azure-ai-anomalydetector/tsp-location.yaml b/sdk/anomalydetector/azure-ai-anomalydetector/tsp-location.yaml index 6f12bb836466..7786fdedab04 100644 --- a/sdk/anomalydetector/azure-ai-anomalydetector/tsp-location.yaml +++ b/sdk/anomalydetector/azure-ai-anomalydetector/tsp-location.yaml @@ -1,3 +1,3 @@ directory: specification/cognitiveservices/AnomalyDetector -commit: 75376d385724a046204f53baccc6fa1bbfdbe73b -repo: Azure/azure-rest-api-specs \ No newline at end of file +commit: db63bea839f5648462c94e685d5cc96f8e8b38ba +repo: Azure/azure-rest-api-specs diff --git a/sdk/aot/azure-aot-graalvm-samples/pom.xml b/sdk/aot/azure-aot-graalvm-samples/pom.xml index dcd4e3bf3c38..96dd3a254470 100644 --- a/sdk/aot/azure-aot-graalvm-samples/pom.xml +++ b/sdk/aot/azure-aot-graalvm-samples/pom.xml @@ -66,7 +66,7 @@ com.azure azure-identity - 1.13.0 + 1.13.1 com.azure @@ -93,7 +93,7 @@ com.azure azure-messaging-eventhubs - 5.18.4 + 5.18.5 com.azure diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/pom.xml b/sdk/apicenter/azure-resourcemanager-apicenter/pom.xml index 245bab01fa91..9a472097417e 100644 --- a/sdk/apicenter/azure-resourcemanager-apicenter/pom.xml +++ b/sdk/apicenter/azure-resourcemanager-apicenter/pom.xml @@ -50,23 +50,23 @@ com.azure azure-core - 1.49.1 + 1.50.0 com.azure azure-core-management - 1.15.0 + 1.15.1 com.azure azure-core-test - 1.26.0 + 1.26.1 test com.azure azure-identity - 1.13.0 + 1.13.1 test diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/pom.xml b/sdk/apimanagement/azure-resourcemanager-apimanagement/pom.xml index 5c6efb0eefd6..f89da3baa7de 100644 --- a/sdk/apimanagement/azure-resourcemanager-apimanagement/pom.xml +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/pom.xml @@ -51,23 +51,23 @@ com.azure azure-core - 1.49.1 + 1.50.0 com.azure azure-core-management - 1.15.0 + 1.15.1 com.azure azure-core-test - 1.26.0 + 1.26.1 test com.azure azure-identity - 1.13.0 + 1.13.1 test diff --git a/sdk/appcomplianceautomation/azure-resourcemanager-appcomplianceautomation/pom.xml b/sdk/appcomplianceautomation/azure-resourcemanager-appcomplianceautomation/pom.xml index db0c3b0a0c94..2d011ae1cbca 100644 --- a/sdk/appcomplianceautomation/azure-resourcemanager-appcomplianceautomation/pom.xml +++ b/sdk/appcomplianceautomation/azure-resourcemanager-appcomplianceautomation/pom.xml @@ -55,23 +55,23 @@ com.azure azure-core - 1.49.1 + 1.50.0 com.azure azure-core-management - 1.15.0 + 1.15.1 com.azure azure-core-test - 1.26.0 + 1.26.1 test com.azure azure-identity - 1.13.0 + 1.13.1 test diff --git a/sdk/appconfiguration/azure-data-appconfiguration-perf/pom.xml b/sdk/appconfiguration/azure-data-appconfiguration-perf/pom.xml index 59cae33ace86..145261d117a0 100644 --- a/sdk/appconfiguration/azure-data-appconfiguration-perf/pom.xml +++ b/sdk/appconfiguration/azure-data-appconfiguration-perf/pom.xml @@ -38,12 +38,12 @@ com.azure azure-core - 1.49.1 + 1.50.0 com.azure azure-core-http-netty - 1.15.1 + 1.15.2 @@ -97,7 +97,7 @@ com.azure azure-identity - 1.13.0 + 1.13.1 diff --git a/sdk/appconfiguration/azure-data-appconfiguration/CHANGELOG.md b/sdk/appconfiguration/azure-data-appconfiguration/CHANGELOG.md index f681d453d45a..f99c331e3422 100644 --- a/sdk/appconfiguration/azure-data-appconfiguration/CHANGELOG.md +++ b/sdk/appconfiguration/azure-data-appconfiguration/CHANGELOG.md @@ -8,6 +8,8 @@ ### Bugs Fixed +Fixed `FeatureFlagConfigurationSetting`'s `setKey()` which should always add the feature flag prefix `.appconfig.featureflag/` before the input key. ([#33332](https://github.com/Azure/azure-sdk-for-java/issues/33332)) + ### Other Changes ## 1.6.2 (2024-06-25) @@ -257,7 +259,7 @@ Note: Below breaking changes only affect the version `1.5.0-beta.1`. ## 1.4.0 (2023-01-11) ### Features Added -- Added `getEnpoint()` method to both App Configuration synchronous and asynchronous clients. +- Added `getEndpoint()` method to both App Configuration synchronous and asynchronous clients. ### Other Changes @@ -492,7 +494,7 @@ and [samples](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/appconfiguration/azure-data-appconfiguration/src/samples/java/com/azure/data/appconfiguration) ## 1.0.0-preview.5 (2019-10-11) -- Fixed a explored bug that ConfigurationClientCredential is already pacakge-private. Using connection String instead. +- Fixed a explored bug that ConfigurationClientCredential is already package-private. Using connection String instead. This package's [documentation](https://github.com/Azure/azure-sdk-for-java/blob/4375acbb70d4b85db238d6b5147b697d9355f45e/sdk/appconfiguration/azure-data-appconfiguration/README.md) @@ -515,7 +517,7 @@ demonstrate the new API. ## 1.0.0-preview.3 (2019-09-10) - Removed dependency on Netty. -- Added logging when throwing `RutimeException`s. +- Added logging when throwing `RuntimeException`s. This package's [documentation](https://github.com/Azure/azure-sdk-for-java/blob/4375acbb70d4b85db238d6b5147b697d9355f45e/sdk/appconfiguration/azure-data-appconfiguration/README.md) diff --git a/sdk/appconfiguration/azure-data-appconfiguration/README.md b/sdk/appconfiguration/azure-data-appconfiguration/README.md index 41c44bc6d215..77bc8cc7f559 100644 --- a/sdk/appconfiguration/azure-data-appconfiguration/README.md +++ b/sdk/appconfiguration/azure-data-appconfiguration/README.md @@ -6,13 +6,14 @@ Modern programs, especially programs running in a cloud, generally have many com Use the client library for App Configuration to create and manage application configuration settings. [Source code][source_code] | [Package (Maven)][package] | [API reference documentation][api_documentation] -| [Product documentation][azconfig_docs] | [Samples][samples] | [Troubleshooting][troubleshooting] +| [Product documentation][app_config_docs] | [Samples][samples] | [Troubleshooting][troubleshooting] ## Getting started ### Prerequisites - A [Java Development Kit (JDK)][jdk_link], version 8 or later. + - Here are details about [Java 8 client compatibility with Azure Certificate Authority](https://learn.microsoft.com/azure/security/fundamentals/azure-ca-details?tabs=root-and-subordinate-cas-list#client-compatibility-for-public-pkis). - [Azure Subscription][azure_subscription] - [App Configuration Store][app_config_store] @@ -585,7 +586,7 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [api_documentation]: https://aka.ms/java-docs [app_config_store]: https://docs.microsoft.com/azure/azure-app-configuration/quickstart-dotnet-core-app#create-an-app-configuration-store [app_config_role]: https://docs.microsoft.com/azure/azure-app-configuration/rest-api-authorization-azure-ad#roles -[azconfig_docs]: https://docs.microsoft.com/azure/azure-app-configuration +[app_config_docs]: https://docs.microsoft.com/azure/azure-app-configuration [azure_cli]: https://docs.microsoft.com/cli/azure [azure_identity]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/identity/azure-identity [azure_subscription]: https://azure.microsoft.com/free diff --git a/sdk/appconfiguration/azure-data-appconfiguration/pom.xml b/sdk/appconfiguration/azure-data-appconfiguration/pom.xml index 87501285d4a3..a7a71a764dda 100644 --- a/sdk/appconfiguration/azure-data-appconfiguration/pom.xml +++ b/sdk/appconfiguration/azure-data-appconfiguration/pom.xml @@ -51,7 +51,7 @@ com.azure azure-core - 1.49.1 + 1.50.0 com.azure @@ -61,19 +61,19 @@ com.azure azure-core-http-netty - 1.15.1 + 1.15.2 com.azure azure-core-test - 1.26.0 + 1.26.1 test com.azure azure-core-http-okhttp - 1.12.0 + 1.12.1 test @@ -115,7 +115,7 @@ com.azure azure-identity - 1.13.0-beta.2 + 1.14.0-beta.1 test diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/ConfigurationClientBuilder.java b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/ConfigurationClientBuilder.java index 489a1b35b7d3..700a764f4acc 100644 --- a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/ConfigurationClientBuilder.java +++ b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/ConfigurationClientBuilder.java @@ -99,7 +99,7 @@ * * ConfigurationClient configurationClient = new ConfigurationClientBuilder() * .pipeline(pipeline) - * .endpoint("https://myconfig.azure.net/") + * .endpoint("https://dummy.azure.net/") * .connectionString(connectionString) * .buildClient(); * diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/models/FeatureFlagConfigurationSetting.java b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/models/FeatureFlagConfigurationSetting.java index 6f4db70903db..9b6e729b54bd 100644 --- a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/models/FeatureFlagConfigurationSetting.java +++ b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/models/FeatureFlagConfigurationSetting.java @@ -136,7 +136,12 @@ public String getValue() { */ @Override public FeatureFlagConfigurationSetting setKey(String key) { - super.setKey(key); + if (key != null && !key.startsWith(KEY_PREFIX)) { + super.setKey(KEY_PREFIX + key); + } else { + super.setKey(key); + } + return this; } diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/samples/README.md b/sdk/appconfiguration/azure-data-appconfiguration/src/samples/README.md index 09e0ae71e60e..6fed7bdab67d 100644 --- a/sdk/appconfiguration/azure-data-appconfiguration/src/samples/README.md +++ b/sdk/appconfiguration/azure-data-appconfiguration/src/samples/README.md @@ -40,7 +40,7 @@ The following sections provide several code snippets covering some of the most c Troubleshooting steps can be found [here][SDK_README_TROUBLESHOOTING]. ## Next steps -Start using App Configuration Java SDK in your solutions. Our SDK documentation could be found at [SDK Documentation][azconfig_docs]. +Start using App Configuration Java SDK in your solutions. Our SDK documentation could be found at [SDK Documentation][app_config_docs]. ## Contributing This project welcomes contributions and suggestions. Find [more contributing][SDK_README_CONTRIBUTING] details here. @@ -51,7 +51,7 @@ This project welcomes contributions and suggestions. Find [more contributing][SD [SDK_README_GETTING_STARTED]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/appconfiguration/azure-data-appconfiguration/README.md#getting-started [SDK_README_TROUBLESHOOTING]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/appconfiguration/azure-data-appconfiguration/README.md#troubleshooting [SDK_README_KEY_CONCEPTS]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/appconfiguration/azure-data-appconfiguration/README.md#key-concepts -[azconfig_docs]: https://docs.microsoft.com/azure/azure-app-configuration +[app_config_docs]: https://docs.microsoft.com/azure/azure-app-configuration [proxy_option]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/appconfiguration/azure-data-appconfiguration/src/samples/java/com/azure/data/appconfiguration/ProxyOptionsSample.java [sample_hello_world]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/appconfiguration/azure-data-appconfiguration/src/samples/java/com/azure/data/appconfiguration/HelloWorld.java [sample_list_configuration_settings]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/appconfiguration/azure-data-appconfiguration/src/samples/java/com/azure/data/appconfiguration/ConfigurationSets.java diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/samples/java/com/azure/data/appconfiguration/ConfigurationClientJavaDocCodeSnippets.java b/sdk/appconfiguration/azure-data-appconfiguration/src/samples/java/com/azure/data/appconfiguration/ConfigurationClientJavaDocCodeSnippets.java index 50a6915870e7..822f9788bd3c 100644 --- a/sdk/appconfiguration/azure-data-appconfiguration/src/samples/java/com/azure/data/appconfiguration/ConfigurationClientJavaDocCodeSnippets.java +++ b/sdk/appconfiguration/azure-data-appconfiguration/src/samples/java/com/azure/data/appconfiguration/ConfigurationClientJavaDocCodeSnippets.java @@ -51,7 +51,7 @@ public ConfigurationClient createAsyncConfigurationClientWithPipeline() { ConfigurationClient configurationClient = new ConfigurationClientBuilder() .pipeline(pipeline) - .endpoint("https://myconfig.azure.net/") + .endpoint("https://dummy.azure.net/") .connectionString(connectionString) .buildClient(); // END: com.azure.data.applicationconfig.configurationclient.pipeline.instantiation diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/test/java/com/azure/data/appconfiguration/FeatureFlagSettingUnitTest.java b/sdk/appconfiguration/azure-data-appconfiguration/src/test/java/com/azure/data/appconfiguration/FeatureFlagSettingUnitTest.java index 2de957cbbafb..30cf20c64943 100644 --- a/sdk/appconfiguration/azure-data-appconfiguration/src/test/java/com/azure/data/appconfiguration/FeatureFlagSettingUnitTest.java +++ b/sdk/appconfiguration/azure-data-appconfiguration/src/test/java/com/azure/data/appconfiguration/FeatureFlagSettingUnitTest.java @@ -112,6 +112,18 @@ public void addFilter() { assertEquals(1, setting.getClientFilters().size()); } + @Test + public void setKeyShowFeatureFlagPrefix() { + String keyWithPrefix = KEY_PREFIX + "key"; + FeatureFlagConfigurationSetting setting = new FeatureFlagConfigurationSetting("featureID", true); + setting.setKey("key"); + assertEquals(keyWithPrefix, setting.getKey()); + + FeatureFlagConfigurationSetting settingWithPrefix = new FeatureFlagConfigurationSetting("featureID", true); + settingWithPrefix.setKey(keyWithPrefix); + assertEquals(keyWithPrefix, settingWithPrefix.getKey()); + } + private FeatureFlagConfigurationSetting createFeatureFlagConfigurationSetting() { // Create a new feature flag configuration setting, final List featureFlagFilters = Arrays.asList( diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/pom.xml b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/pom.xml index 38e47b34b3f1..e5ac90002526 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/pom.xml +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/pom.xml @@ -50,23 +50,23 @@ com.azure azure-core - 1.49.1 + 1.50.0 com.azure azure-core-management - 1.15.0 + 1.15.1 com.azure azure-core-test - 1.26.0 + 1.26.1 test com.azure azure-identity - 1.13.0 + 1.13.1 test diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/CHANGELOG.md b/sdk/appcontainers/azure-resourcemanager-appcontainers/CHANGELOG.md index 2d8837938fff..9a88344116de 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/CHANGELOG.md +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 1.0.0-beta.8 (Unreleased) +## 1.0.0-beta.9 (Unreleased) ### Features Added @@ -10,6 +10,1258 @@ ### Other Changes +## 1.0.0-beta.8 (2024-07-24) + +- Azure Resource Manager ContainerAppsApi client library for Java. This package contains Microsoft Azure SDK for ContainerAppsApi Management SDK. Functions is an extension resource to revisions and the api listed is used to proxy the call from Web RP to the function app's host process, this api is not exposed to users and only Web RP is allowed to invoke functions extension resource. Package tag package-preview-2024-02. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +### Breaking Changes + +#### `models.Jobs` was modified + +* `listDetectorsWithResponse(java.lang.String,java.lang.String,com.azure.core.util.Context)` was removed +* `models.DiagnosticsCollection listDetectors(java.lang.String,java.lang.String)` -> `com.azure.core.http.rest.PagedIterable listDetectors(java.lang.String,java.lang.String)` + +#### `models.BillingMeter` was modified + +* `systemData()` was removed + +#### `models.JavaComponent$Definition` was modified + +* `withComponentType(models.JavaComponentType)` was removed +* `withConfigurations(java.util.List)` was removed +* `withServiceBinds(java.util.List)` was removed + +#### `models.JavaComponent` was modified + +* `provisioningState()` was removed +* `serviceBinds()` was removed +* `componentType()` was removed +* `configurations()` was removed + +#### `models.JavaComponent$Update` was modified + +* `withServiceBinds(java.util.List)` was removed +* `withComponentType(models.JavaComponentType)` was removed +* `withConfigurations(java.util.List)` was removed + +### Features Added + +* `models.SessionContainer` was added + +* `models.ContainerAppsBuilds` was added + +* `models.LogicApp$Definition` was added + +* `models.Runtime` was added + +* `models.SessionPoolUpdatableProperties` was added + +* `models.LoggerSetting` was added + +* `models.ScaleConfiguration` was added + +* `models.ManagedEnvironmentPrivateEndpointConnections` was added + +* `models.RuntimeJavaAgentLogging` was added + +* `models.WorkflowState` was added + +* `models.PrivateEndpointConnectionListResult` was added + +* `models.PoolManagementType` was added + +* `models.PatchType` was added + +* `models.SmbStorage` was added + +* `models.IdentitySettingsLifeCycle` was added + +* `models.SessionPoolProvisioningState` was added + +* `models.SpringBootAdminComponent` was added + +* `models.PrivateEndpoint` was added + +* `models.PatchDetailsOldLayer` was added + +* `models.PatchApplyStatus` was added + +* `models.ContainerAppsPatches` was added + +* `models.LogicApps` was added + +* `models.PrivateEndpointConnection$Definition` was added + +* `models.SessionPool$UpdateStages` was added + +* `models.SpringCloudConfigComponent` was added + +* `models.PrivateEndpointConnection` was added + +* `models.FunctionsExtensions` was added + +* `models.SessionPool$Definition` was added + +* `models.ImageType` was added + +* `models.PatchCollection` was added + +* `models.WorkflowEnvelopeProperties` was added + +* `models.WorkflowHealthState` was added + +* `models.ContainerAppsPatchResource` was added + +* `models.SessionPool$DefinitionStages` was added + +* `models.PrivateEndpointServiceConnectionStatus` was added + +* `models.SessionIngress` was added + +* `models.ContainerAppsBuildConfiguration` was added + +* `models.WorkflowEnvelopeCollection` was added + +* `models.PrivateEndpointConnection$Update` was added + +* `models.ContainerAppsBuildCollection` was added + +* `models.ErrorEntity` was added + +* `models.LogicApp$UpdateStages` was added + +* `models.PrivateLinkServiceConnectionState` was added + +* `models.WorkflowHealth` was added + +* `models.PatchProperties` was added + +* `models.PatchDetails` was added + +* `models.PrivateEndpointConnectionProvisioningState` was added + +* `models.SessionPool` was added + +* `models.PrivateLinkResource` was added + +* `models.SessionContainerResources` was added + +* `models.SessionPoolSecret` was added + +* `models.PatchSkipConfig` was added + +* `models.SessionPool$Update` was added + +* `models.WorkflowEnvelope` was added + +* `models.PrivateLinkResourceListResult` was added + +* `models.Level` was added + +* `models.SessionNetworkStatus` was added + +* `models.LogicAppsProxyMethod` was added + +* `models.ManagedEnvironmentPrivateLinkResources` was added + +* `models.RuntimeJava` was added + +* `models.ManagedEnvironmentPropertiesPeerTrafficConfiguration` was added + +* `models.ExecutionType` was added + +* `models.LogicApp` was added + +* `models.PatchDetailsNewLayer` was added + +* `models.DetectionStatus` was added + +* `models.ReplicaExecutionStatus` was added + +* `models.ContainerExecutionStatus` was added + +* `models.ContainerAppsBuildsByContainerApps` was added + +* `models.CustomContainerTemplate` was added + +* `models.WorkflowArtifacts` was added + +* `models.SessionNetworkConfiguration` was added + +* `models.RuntimeJavaAgent` was added + +* `models.DynamicPoolConfiguration` was added + +* `models.ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption` was added + +* `models.PatchingMode` was added + +* `models.ContainerAppsBuildResource` was added + +* `models.PrivateEndpointConnection$UpdateStages` was added + +* `models.IdentitySettings` was added + +* `models.ExecutionStatus` was added + +* `models.ContainerType` was added + +* `models.SessionRegistryCredentials` was added + +* `models.RuntimeDotnet` was added + +* `models.JavaComponentProperties` was added + +* `models.Kind` was added + +* `models.ContainerAppsSessionPools` was added + +* `models.SessionPoolCollection` was added + +* `models.ContainerAppPropertiesPatchingConfiguration` was added + +* `models.LogicApp$Update` was added + +* `models.NacosComponent` was added + +* `models.LogicApp$DefinitionStages` was added + +* `models.JavaComponentIngress` was added + +* `models.PublicNetworkAccess` was added + +* `models.PrivateEndpointConnection$DefinitionStages` was added + +* `models.SpringCloudEurekaComponent` was added + +#### `models.JobConfigurationScheduleTriggerConfig` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.DaprComponentResiliencyPolicyTimeoutPolicyConfiguration` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.HttpConnectionPool` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ManagedCertificatePatch` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ServiceBind` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.Secret` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.AzureActiveDirectoryValidation` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.WorkloadProfileStatesCollection` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.DaprComponentsCollection` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.BuildConfiguration` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ManagedCertificateCollection` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ManagedEnvironment$Update` was modified + +* `withPublicNetworkAccess(models.PublicNetworkAccess)` was added +* `withPeerTrafficConfiguration(models.ManagedEnvironmentPropertiesPeerTrafficConfiguration)` was added + +#### `models.LoginScopes` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.AvailableWorkloadProfileProperties` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.HttpSettings` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.CertificateKeyVaultProperties` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.Google` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.AllowedPrincipals` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.EnvironmentVariable` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.DotNetComponentServiceBind` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ContainerAppProbeHttpGetHttpHeadersItem` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.KedaConfiguration` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.DiagnosticsDefinition` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.JavaComponentServiceBind` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.GlobalValidation` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.AzureActiveDirectoryLogin` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.LogsConfiguration` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.WorkloadProfile` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.InitContainer` was modified + +* `withImageType(models.ImageType)` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.EnvironmentVar` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.CertificatePatch` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.UsageName` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.AvailableWorkloadProfilesCollection` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.TrafficWeight` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.JobScale` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.IpSecurityRestrictionRule` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.AppleRegistration` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.QueueScaleRule` was modified + +* `identity()` was added +* `accountName()` was added +* `withAccountName(java.lang.String)` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `withIdentity(java.lang.String)` was added + +#### `models.HttpGet` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.CheckNameAvailabilityRequest` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.JobsCollection` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.OpenIdConnectLogin` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.UserAssignedIdentity` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.JavaComponentConfigurationProperty` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.Jobs` was modified + +* `listDetectors(java.lang.String,java.lang.String,com.azure.core.util.Context)` was added + +#### `models.ConnectedEnvironmentStorageProperties` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `withSmb(models.SmbStorage)` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `smb()` was added + +#### `models.ListUsagesResult` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.AppRegistration` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ContainerAppSecret` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.BuilderResourceUpdate` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.Service` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.BillingMeterProperties` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ManagedEnvironment$Definition` was modified + +* `withPeerTrafficConfiguration(models.ManagedEnvironmentPropertiesPeerTrafficConfiguration)` was added +* `withPublicNetworkAccess(models.PublicNetworkAccess)` was added + +#### `models.ContainerApp$Update` was modified + +* `withPatchingConfiguration(models.ContainerAppPropertiesPatchingConfiguration)` was added + +#### `models.ManagedEnvironmentStorageProperties` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.OpenIdConnectConfig` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.BillingMeter` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `id()` was added +* `name()` was added +* `type()` was added + +#### `models.DaprComponentResiliencyPoliciesCollection` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.GithubActionConfiguration` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ContainerRegistry` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.JobPatchPropertiesProperties` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.AllowedAudiencesValidation` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ScaleRule` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ClientRegistration` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.CustomHostnameAnalysisResultCustomDomainVerificationFailureInfoDetailsItem` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ContainerAppCollection` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.OtlpConfiguration` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ForwardProxy` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.MetricsConfiguration` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.DaprServiceBindMetadata` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.IdentityProviders` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ContainerAppProbe` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ScaleRuleAuth` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.JobConfiguration` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `identitySettings()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `withIdentitySettings(java.util.List)` was added + +#### `models.TcpScaleRule` was modified + +* `identity()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `withIdentity(java.lang.String)` was added + +#### `models.TracesConfiguration` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.SecretVolumeItem` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.OperationDisplay` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.JobConfigurationManualTriggerConfig` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.DaprSubscriptionBulkSubscribeOptions` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.JobConfigurationEventTriggerConfig` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ConnectedEnvironmentCollection` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.JavaComponent$Definition` was modified + +* `withProperties(models.JavaComponentProperties)` was added + +#### `models.Scale` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.CustomDomain` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.CertificateCollection` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.TimeoutPolicy` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.IngressStickySessions` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.DotNetComponentConfigurationProperty` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.DaprSubscriptionsCollection` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.TokenStore` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.VnetConfiguration` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.AppInsightsConfiguration` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.LogAnalyticsConfiguration` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.DaprSubscriptionRoutes` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.Mtls` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.HttpRetryPolicy` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.NfsAzureFileProperties` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ManagedEnvironment` was modified + +* `peerTrafficConfiguration()` was added +* `privateEndpointConnections()` was added +* `publicNetworkAccess()` was added + +#### `models.CircuitBreakerPolicy` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.TcpRetryPolicy` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.AzureFileProperties` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.HeaderMatch` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.AppResiliencyCollection` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.AuthPlatform` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.CorsPolicy` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.BuilderCollection` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.RegistryCredentials` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.DaprComponentResiliencyPolicyConfiguration` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.OpenIdConnectClientCredential` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.JobTemplate` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.AzureActiveDirectoryRegistration` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.JavaComponentsCollection` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ManagedServiceIdentity` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.DefaultAuthorizationPolicy` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.DefaultErrorResponseError` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.AzureCredentials` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.OpenTelemetryConfiguration` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.WorkloadProfileStatesProperties` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.AvailableOperations` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.JavaComponent` was modified + +* `properties()` was added + +#### `models.HttpScaleRule` was modified + +* `withIdentity(java.lang.String)` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `identity()` was added + +#### `models.AzureActiveDirectory` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.Login` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.DiagnosticsDataApiResponse` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.JobExecution` was modified + +* `detailedStatus()` was added + +#### `models.ManagedCertificateProperties` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.DestinationsConfiguration` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.JobExecutionContainer` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.DataDogConfiguration` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.DotNetComponentsCollection` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.AzureStaticWebApps` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.DaprConfiguration` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.JobPatchProperties` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.AzureStaticWebAppsRegistration` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.TwitterRegistration` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.RevisionCollection` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.EncryptionSettings` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.Twitter` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.BuildCollection` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.Container` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `withImageType(models.ImageType)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.CustomHostnameAnalysisResultCustomDomainVerificationFailureInfo` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.Facebook` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.CookieExpiration` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.CustomOpenIdConnectProvider` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.CertificateProperties` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.DiagnosticRendering` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.PreBuildStep` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.Apple` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.DaprComponentServiceBinding` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.DiagnosticSupportTopic` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ContainerApp` was modified + +* `kind()` was added +* `patchingConfiguration()` was added + +#### `models.JwtClaimChecks` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ContainerAppProbeHttpGet` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.JobScaleRule` was modified + +* `withIdentity(java.lang.String)` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `identity()` was added + +#### `models.RegistryInfo` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.Volume` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.DaprSecret` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.DaprMetadata` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.JobExecutionTemplate` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.DiagnosticsProperties` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `ContainerAppsApiManager` was modified + +* `containerAppsBuilds()` was added +* `containerAppsSessionPools()` was added +* `managedEnvironmentPrivateEndpointConnections()` was added +* `logicApps()` was added +* `containerAppsBuildsByContainerApps()` was added +* `functionsExtensions()` was added +* `managedEnvironmentPrivateLinkResources()` was added +* `containerAppsPatches()` was added + +#### `models.IngressPortMapping` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.DiagnosticsStatus` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ReplicaContainer` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.BaseContainer` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `imageType()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `withImageType(models.ImageType)` was added + +#### `models.ContainerRegistryWithCustomImage` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.BlobStorageTokenStore` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.VolumeMount` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.DiagnosticDataProviderMetadata` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ExtendedLocation` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.DiagnosticDataTableResponseObject` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ManagedEnvironmentPropertiesPeerAuthentication` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.DiagnosticDataProviderMetadataPropertyBagItem` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.AppLogsConfiguration` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.SourceControlCollection` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.GitHub` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ManagedEnvironmentsCollection` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.CustomScaleRule` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `withIdentity(java.lang.String)` was added +* `identity()` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.AuthConfigCollection` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.Nonce` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ContainerApp$Definition` was modified + +* `withPatchingConfiguration(models.ContainerAppPropertiesPatchingConfiguration)` was added +* `withKind(models.Kind)` was added + +#### `models.ContainerResources` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.OpenIdConnectRegistration` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.Ingress` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.CustomDomainConfiguration` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.JavaComponent$Update` was modified + +* `withProperties(models.JavaComponentProperties)` was added + +#### `models.Dapr` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.Header` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.TcpConnectionPool` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.DaprSubscriptionRouteRule` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.HttpSettingsRoutes` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.DiagnosticDataTableResponseColumn` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.Configuration` was modified + +* `withIdentitySettings(java.util.List)` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `runtime()` was added +* `withRuntime(models.Runtime)` was added +* `identitySettings()` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.Template` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ContainerAppProbeTcpSocket` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.LoginRoutes` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + ## 1.0.0-beta.7 (2024-03-20) - Azure Resource Manager ContainerAppsApi client library for Java. This package contains Microsoft Azure SDK for ContainerAppsApi Management SDK. Package tag package-preview-2023-11. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/README.md b/sdk/appcontainers/azure-resourcemanager-appcontainers/README.md index 59a801fc4d04..7065b455a5af 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/README.md +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/README.md @@ -2,7 +2,7 @@ Azure Resource Manager ContainerAppsApi client library for Java. -This package contains Microsoft Azure SDK for ContainerAppsApi Management SDK. Package tag package-preview-2023-11. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for ContainerAppsApi Management SDK. Functions is an extension resource to revisions and the api listed is used to proxy the call from Web RP to the function app's host process, this api is not exposed to users and only Web RP is allowed to invoke functions extension resource. Package tag package-preview-2024-02. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-appcontainers - 1.0.0-beta.7 + 1.0.0-beta.8 ``` [//]: # ({x-version-update-end}) @@ -45,15 +45,11 @@ Azure Management Libraries require a `TokenCredential` implementation for authen ### Authentication -By default, Microsoft Entra ID token authentication depends on correct configuration of the following environment variables. +Microsoft Entra ID token authentication relies on the [credential class][azure_identity_credentials] from [Azure Identity][azure_identity] package. -- `AZURE_CLIENT_ID` for Azure client ID. -- `AZURE_TENANT_ID` for Azure tenant ID. -- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. +Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. -In addition, Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. - -With above configuration, `azure` client can be authenticated using the following code: +Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: ```java AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); @@ -97,6 +93,7 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [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 diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/SAMPLE.md b/sdk/appcontainers/azure-resourcemanager-appcontainers/SAMPLE.md index bb9e2e0bf3b2..43e8efcc1216 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/SAMPLE.md +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/SAMPLE.md @@ -102,6 +102,15 @@ - [Get](#containerappsauthconfigs_get) - [ListByContainerApp](#containerappsauthconfigs_listbycontainerapp) +## ContainerAppsBuilds + +- [Delete](#containerappsbuilds_delete) +- [Get](#containerappsbuilds_get) + +## ContainerAppsBuildsByContainerApp + +- [List](#containerappsbuildsbycontainerapp_list) + ## ContainerAppsDiagnostics - [GetDetector](#containerappsdiagnostics_getdetector) @@ -110,6 +119,14 @@ - [ListDetectors](#containerappsdiagnostics_listdetectors) - [ListRevisions](#containerappsdiagnostics_listrevisions) +## ContainerAppsPatches + +- [Apply](#containerappspatches_apply) +- [Delete](#containerappspatches_delete) +- [Get](#containerappspatches_get) +- [ListByContainerApp](#containerappspatches_listbycontainerapp) +- [SkipConfigure](#containerappspatches_skipconfigure) + ## ContainerAppsRevisionReplicas - [GetReplica](#containerappsrevisionreplicas_getreplica) @@ -123,6 +140,15 @@ - [ListRevisions](#containerappsrevisions_listrevisions) - [RestartRevision](#containerappsrevisions_restartrevision) +## ContainerAppsSessionPools + +- [CreateOrUpdate](#containerappssessionpools_createorupdate) +- [Delete](#containerappssessionpools_delete) +- [GetByResourceGroup](#containerappssessionpools_getbyresourcegroup) +- [List](#containerappssessionpools_list) +- [ListByResourceGroup](#containerappssessionpools_listbyresourcegroup) +- [Update](#containerappssessionpools_update) + ## ContainerAppsSourceControls - [CreateOrUpdate](#containerappssourcecontrols_createorupdate) @@ -160,6 +186,10 @@ - [List](#dotnetcomponents_list) - [Update](#dotnetcomponents_update) +## FunctionsExtension + +- [InvokeFunctionsHost](#functionsextension_invokefunctionshost) + ## JavaComponents - [CreateOrUpdate](#javacomponents_createorupdate) @@ -188,6 +218,17 @@ - [List](#jobsexecutions_list) +## LogicApps + +- [CreateOrUpdate](#logicapps_createorupdate) +- [Delete](#logicapps_delete) +- [DeployWorkflowArtifacts](#logicapps_deployworkflowartifacts) +- [Get](#logicapps_get) +- [GetWorkflow](#logicapps_getworkflow) +- [Invoke](#logicapps_invoke) +- [ListWorkflows](#logicapps_listworkflows) +- [ListWorkflowsConnections](#logicapps_listworkflowsconnections) + ## ManagedCertificates - [CreateOrUpdate](#managedcertificates_createorupdate) @@ -201,6 +242,17 @@ - [GetDetector](#managedenvironmentdiagnostics_getdetector) - [ListDetectors](#managedenvironmentdiagnostics_listdetectors) +## ManagedEnvironmentPrivateEndpointConnections + +- [CreateOrUpdate](#managedenvironmentprivateendpointconnections_createorupdate) +- [Delete](#managedenvironmentprivateendpointconnections_delete) +- [Get](#managedenvironmentprivateendpointconnections_get) +- [List](#managedenvironmentprivateendpointconnections_list) + +## ManagedEnvironmentPrivateLinkResources + +- [List](#managedenvironmentprivatelinkresources_list) + ## ManagedEnvironmentUsages - [List](#managedenvironmentusages_list) @@ -261,7 +313,7 @@ import java.util.Arrays; public final class AppResiliencyCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/AppResiliency_CreateOrUpdate + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/AppResiliency_CreateOrUpdate * .json */ /** @@ -271,20 +323,27 @@ public final class AppResiliencyCreateOrUpdateSamples { */ public static void createOrUpdateAppResiliency(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.appResiliencies().define("resiliency-policy-1").withExistingContainerApp("rg", "testcontainerApp0") + manager.appResiliencies() + .define("resiliency-policy-1") + .withExistingContainerApp("rg", "testcontainerApp0") .withTimeoutPolicy(new TimeoutPolicy().withResponseTimeoutInSeconds(15).withConnectionTimeoutInSeconds(5)) - .withHttpRetryPolicy(new HttpRetryPolicy().withMaxRetries(5).withInitialDelayInMilliseconds(1000L) - .withMaxIntervalInMilliseconds(10000L) - .withHeaders( - Arrays.asList(new HeaderMatch().withHeaderProperty("X-Content-Type").withPrefixMatch("GOATS"))) - .withHttpStatusCodes(Arrays.asList(502, 503)).withErrors( - Arrays.asList("5xx", "connect-failure", "reset", "retriable-headers", "retriable-status-codes"))) + .withHttpRetryPolicy( + new HttpRetryPolicy().withMaxRetries(5) + .withInitialDelayInMilliseconds(1000L) + .withMaxIntervalInMilliseconds(10000L) + .withHeaders( + Arrays.asList(new HeaderMatch().withHeaderProperty("X-Content-Type").withPrefixMatch("GOATS"))) + .withHttpStatusCodes(Arrays.asList(502, 503)) + .withErrors(Arrays.asList("5xx", "connect-failure", "reset", "retriable-headers", + "retriable-status-codes"))) .withTcpRetryPolicy(new TcpRetryPolicy().withMaxConnectAttempts(3)) - .withCircuitBreakerPolicy(new CircuitBreakerPolicy().withConsecutiveErrors(5).withIntervalInSeconds(10) + .withCircuitBreakerPolicy(new CircuitBreakerPolicy().withConsecutiveErrors(5) + .withIntervalInSeconds(10) .withMaxEjectionPercent(50)) .withHttpConnectionPool( new HttpConnectionPool().withHttp1MaxPendingRequests(1024).withHttp2MaxRequests(1024)) - .withTcpConnectionPool(new TcpConnectionPool().withMaxConnections(100)).create(); + .withTcpConnectionPool(new TcpConnectionPool().withMaxConnections(100)) + .create(); } } ``` @@ -298,7 +357,7 @@ public final class AppResiliencyCreateOrUpdateSamples { public final class AppResiliencyDeleteSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/AppResiliency_Delete.json + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/AppResiliency_Delete.json */ /** * Sample code: Delete App Resiliency. @@ -306,8 +365,8 @@ public final class AppResiliencyDeleteSamples { * @param manager Entry point to ContainerAppsApiManager. */ public static void deleteAppResiliency(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.appResiliencies().deleteWithResponse("rg", "testcontainerApp0", "resiliency-policy-1", - com.azure.core.util.Context.NONE); + manager.appResiliencies() + .deleteWithResponse("rg", "testcontainerApp0", "resiliency-policy-1", com.azure.core.util.Context.NONE); } } ``` @@ -321,7 +380,7 @@ public final class AppResiliencyDeleteSamples { public final class AppResiliencyGetSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/AppResiliency_Get.json + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/AppResiliency_Get.json */ /** * Sample code: Get App Resiliency. @@ -329,8 +388,8 @@ public final class AppResiliencyGetSamples { * @param manager Entry point to ContainerAppsApiManager. */ public static void getAppResiliency(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.appResiliencies().getWithResponse("rg", "testcontainerApp0", "resiliency-policy-1", - com.azure.core.util.Context.NONE); + manager.appResiliencies() + .getWithResponse("rg", "testcontainerApp0", "resiliency-policy-1", com.azure.core.util.Context.NONE); } } ``` @@ -344,7 +403,7 @@ public final class AppResiliencyGetSamples { public final class AppResiliencyListSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/AppResiliency_List.json + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/AppResiliency_List.json */ /** * Sample code: List App Resiliency. @@ -369,7 +428,7 @@ import com.azure.resourcemanager.appcontainers.models.TimeoutPolicy; public final class AppResiliencyUpdateSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/AppResiliency_Patch.json + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/AppResiliency_Patch.json */ /** * Sample code: Update App Resiliency. @@ -395,7 +454,7 @@ public final class AppResiliencyUpdateSamples { */ public final class AvailableWorkloadProfilesGetSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * AvailableWorkloadProfiles_Get.json */ /** @@ -418,7 +477,7 @@ public final class AvailableWorkloadProfilesGetSamples { public final class BillingMetersGetSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/BillingMeters_Get.json + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/BillingMeters_Get.json */ /** * Sample code: BillingMeters_Get. @@ -440,7 +499,7 @@ public final class BillingMetersGetSamples { public final class BuildAuthTokenListSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Builds_ListAuthToken.json + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/Builds_ListAuthToken.json */ /** * Sample code: Get Build Auth Token. @@ -470,7 +529,7 @@ import java.util.Map; public final class BuildersCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Builders_CreateOrUpdate.json + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/Builders_CreateOrUpdate.json */ /** * Sample code: Builders_CreateOrUpdate_0. @@ -479,7 +538,10 @@ public final class BuildersCreateOrUpdateSamples { */ public static void buildersCreateOrUpdate0(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.builders().define("testBuilder").withRegion("eastus").withExistingResourceGroup("rg") + manager.builders() + .define("testBuilder") + .withRegion("eastus") + .withExistingResourceGroup("rg") .withTags(mapOf("company", "Microsoft")) .withIdentity(new ManagedServiceIdentity() .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) @@ -488,11 +550,13 @@ public final class BuildersCreateOrUpdateSamples { new UserAssignedIdentity()))) .withEnvironmentId( "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/Microsoft.App/managedEnvironments/testEnv") - .withContainerRegistries(Arrays.asList( - new ContainerRegistry().withContainerRegistryServer("test.azurecr.io").withIdentityResourceId( + .withContainerRegistries(Arrays.asList(new ContainerRegistry() + .withContainerRegistryServer("test.azurecr.io") + .withIdentityResourceId( "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1"), - new ContainerRegistry().withContainerRegistryServer("test2.azurecr.io").withIdentityResourceId( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1"))) + new ContainerRegistry().withContainerRegistryServer("test2.azurecr.io") + .withIdentityResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1"))) .create(); } @@ -519,7 +583,7 @@ public final class BuildersCreateOrUpdateSamples { public final class BuildersDeleteSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Builders_Delete.json + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/Builders_Delete.json */ /** * Sample code: Builders_Delete_0. @@ -541,7 +605,7 @@ public final class BuildersDeleteSamples { public final class BuildersGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Builders_Get.json + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/Builders_Get.json */ /** * Sample code: Builders_Get_0. @@ -563,7 +627,7 @@ public final class BuildersGetByResourceGroupSamples { public final class BuildersListSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Builders_ListBySubscription. + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/Builders_ListBySubscription. * json */ /** @@ -587,7 +651,7 @@ public final class BuildersListSamples { public final class BuildersListByResourceGroupSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Builders_ListByResourceGroup + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/Builders_ListByResourceGroup * .json */ /** @@ -615,7 +679,7 @@ import java.util.Map; public final class BuildersUpdateSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Builders_Update.json + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/Builders_Update.json */ /** * Sample code: Builders_Update_0. @@ -624,7 +688,8 @@ public final class BuildersUpdateSamples { */ public static void buildersUpdate0(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { BuilderResource resource = manager.builders() - .getByResourceGroupWithResponse("rg", "testBuilder", com.azure.core.util.Context.NONE).getValue(); + .getByResourceGroupWithResponse("rg", "testBuilder", com.azure.core.util.Context.NONE) + .getValue(); resource.update().withTags(mapOf("mytag1", "myvalue1")).apply(); } @@ -658,7 +723,7 @@ import java.util.Arrays; public final class BuildsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Builds_CreateOrUpdate.json + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/Builds_CreateOrUpdate.json */ /** * Sample code: Builds_CreateOrUpdate_WithConfig. @@ -667,29 +732,32 @@ public final class BuildsCreateOrUpdateSamples { */ public static void buildsCreateOrUpdateWithConfig(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.builds().define("testBuild-123456789az").withExistingBuilder("rg", "testBuilder") + manager.builds() + .define("testBuild-123456789az") + .withExistingBuilder("rg", "testBuilder") .withDestinationContainerRegistry(new ContainerRegistryWithCustomImage().withServer("test.azurecr.io") .withImage("test.azurecr.io/repo:tag")) - .withConfiguration( - new BuildConfiguration().withBaseOs("DebianBullseye").withPlatform("dotnetcore") - .withPlatformVersion("7.0") - .withEnvironmentVariables( - Arrays.asList(new EnvironmentVariable().withName("foo1").withValue("bar1"), - new EnvironmentVariable().withName("foo2").withValue("bar2"))) - .withPreBuildSteps(Arrays.asList( - new PreBuildStep().withDescription("First pre build step.") - .withScripts(Arrays.asList("echo 'hello'", "echo 'world'")) - .withHttpGet(new HttpGet().withUrl("https://microsoft.com").withFileName("output.txt") - .withHeaders(Arrays.asList("foo", "bar"))), - new PreBuildStep().withDescription("Second pre build step.") - .withScripts(Arrays.asList("echo 'hello'", "echo 'again'")) - .withHttpGet(new HttpGet().withUrl("https://microsoft.com").withFileName("output.txt") - .withHeaders(Arrays.asList("foo")))))) + .withConfiguration(new BuildConfiguration().withBaseOs("DebianBullseye") + .withPlatform("dotnetcore") + .withPlatformVersion("7.0") + .withEnvironmentVariables(Arrays.asList(new EnvironmentVariable().withName("foo1").withValue("bar1"), + new EnvironmentVariable().withName("foo2").withValue("bar2"))) + .withPreBuildSteps(Arrays.asList( + new PreBuildStep().withDescription("First pre build step.") + .withScripts(Arrays.asList("echo 'hello'", "echo 'world'")) + .withHttpGet(new HttpGet().withUrl("https://microsoft.com") + .withFileName("output.txt") + .withHeaders(Arrays.asList("foo", "bar"))), + new PreBuildStep().withDescription("Second pre build step.") + .withScripts(Arrays.asList("echo 'hello'", "echo 'again'")) + .withHttpGet(new HttpGet().withUrl("https://microsoft.com") + .withFileName("output.txt") + .withHeaders(Arrays.asList("foo")))))) .create(); } /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * Builds_CreateOrUpdate_NoConfig.json */ /** @@ -713,7 +781,7 @@ public final class BuildsCreateOrUpdateSamples { public final class BuildsDeleteSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Builds_Delete.json + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/Builds_Delete.json */ /** * Sample code: Builds_Delete_0. @@ -735,7 +803,7 @@ public final class BuildsDeleteSamples { public final class BuildsGetSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Builds_Get.json + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/Builds_Get.json */ /** * Sample code: Builds_Get_0. @@ -757,7 +825,7 @@ public final class BuildsGetSamples { public final class BuildsByBuilderResourceListSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Builds_ListByBuilderResource + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/Builds_ListByBuilderResource * .json */ /** @@ -785,7 +853,7 @@ import com.azure.resourcemanager.appcontainers.models.CertificateType; */ public final class CertificatesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * Certificate_CreateOrUpdate_FromKeyVault.json */ /** @@ -795,18 +863,20 @@ public final class CertificatesCreateOrUpdateSamples { */ public static void createOrUpdateCertificateUsingManagedIdentity( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.certificates().createOrUpdateWithResponse("examplerg", "testcontainerenv", "certificate-firendly-name", - new CertificateInner().withLocation("East US").withProperties(new CertificateProperties() - .withCertificateKeyVaultProperties(new CertificateKeyVaultProperties().withIdentity( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test-rg/providers/microsoft.managedidentity/userassignedidentities/test-user-mi") - .withKeyVaultUrl("fakeTokenPlaceholder")) - .withCertificateType(CertificateType.SERVER_SSLCERTIFICATE)), - com.azure.core.util.Context.NONE); + manager.certificates() + .createOrUpdateWithResponse("examplerg", "testcontainerenv", "certificate-firendly-name", + new CertificateInner().withLocation("East US") + .withProperties(new CertificateProperties() + .withCertificateKeyVaultProperties(new CertificateKeyVaultProperties().withIdentity( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test-rg/providers/microsoft.managedidentity/userassignedidentities/test-user-mi") + .withKeyVaultUrl("fakeTokenPlaceholder")) + .withCertificateType(CertificateType.SERVER_SSLCERTIFICATE)), + com.azure.core.util.Context.NONE); } /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Certificate_CreateOrUpdate. + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/Certificate_CreateOrUpdate. * json */ /** @@ -816,11 +886,13 @@ public final class CertificatesCreateOrUpdateSamples { */ public static void createOrUpdateCertificate(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.certificates().createOrUpdateWithResponse("examplerg", "testcontainerenv", "certificate-firendly-name", - new CertificateInner().withLocation("East US") - .withProperties(new CertificateProperties().withPassword("fakeTokenPlaceholder") - .withValue("Y2VydA==".getBytes()).withCertificateType(CertificateType.IMAGE_PULL_TRUSTED_CA)), - com.azure.core.util.Context.NONE); + manager.certificates() + .createOrUpdateWithResponse("examplerg", "testcontainerenv", "certificate-firendly-name", + new CertificateInner().withLocation("East US") + .withProperties(new CertificateProperties().withPassword("fakeTokenPlaceholder") + .withValue("Y2VydA==".getBytes()) + .withCertificateType(CertificateType.IMAGE_PULL_TRUSTED_CA)), + com.azure.core.util.Context.NONE); } } ``` @@ -834,7 +906,7 @@ public final class CertificatesCreateOrUpdateSamples { public final class CertificatesDeleteSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Certificate_Delete.json + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/Certificate_Delete.json */ /** * Sample code: Delete Certificate. @@ -842,8 +914,9 @@ public final class CertificatesDeleteSamples { * @param manager Entry point to ContainerAppsApiManager. */ public static void deleteCertificate(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.certificates().deleteWithResponse("examplerg", "testcontainerenv", "certificate-firendly-name", - com.azure.core.util.Context.NONE); + manager.certificates() + .deleteWithResponse("examplerg", "testcontainerenv", "certificate-firendly-name", + com.azure.core.util.Context.NONE); } } ``` @@ -857,7 +930,7 @@ public final class CertificatesDeleteSamples { public final class CertificatesGetSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Certificate_Get.json + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/Certificate_Get.json */ /** * Sample code: Get Certificate. @@ -865,8 +938,9 @@ public final class CertificatesGetSamples { * @param manager Entry point to ContainerAppsApiManager. */ public static void getCertificate(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.certificates().getWithResponse("examplerg", "testcontainerenv", "certificate-firendly-name", - com.azure.core.util.Context.NONE); + manager.certificates() + .getWithResponse("examplerg", "testcontainerenv", "certificate-firendly-name", + com.azure.core.util.Context.NONE); } } ``` @@ -879,7 +953,7 @@ public final class CertificatesGetSamples { */ public final class CertificatesListSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * Certificates_ListByManagedEnvironment.json */ /** @@ -907,7 +981,7 @@ import java.util.Map; public final class CertificatesUpdateSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Certificates_Patch.json + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/Certificates_Patch.json */ /** * Sample code: Patch Certificate. @@ -915,9 +989,10 @@ public final class CertificatesUpdateSamples { * @param manager Entry point to ContainerAppsApiManager. */ public static void patchCertificate(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.certificates().updateWithResponse("examplerg", "testcontainerenv", "certificate-firendly-name", - new CertificatePatch().withTags(mapOf("tag1", "value1", "tag2", "value2")), - com.azure.core.util.Context.NONE); + manager.certificates() + .updateWithResponse("examplerg", "testcontainerenv", "certificate-firendly-name", + new CertificatePatch().withTags(mapOf("tag1", "value1", "tag2", "value2")), + com.azure.core.util.Context.NONE); } // Use "Map.of" if available @@ -944,7 +1019,7 @@ import com.azure.resourcemanager.appcontainers.models.CheckNameAvailabilityReque */ public final class ConnectedEnvironmentsCheckNameAvailabilitySamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * ConnectedEnvironmentsCertificates_CheckNameAvailability.json */ /** @@ -955,8 +1030,9 @@ public final class ConnectedEnvironmentsCheckNameAvailabilitySamples { public static void certificatesCheckNameAvailability(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { manager.connectedEnvironments() - .checkNameAvailabilityWithResponse("examplerg", "testcontainerenv", new CheckNameAvailabilityRequest() - .withName("testcertificatename").withType("Microsoft.App/connectedEnvironments/certificates"), + .checkNameAvailabilityWithResponse("examplerg", "testcontainerenv", + new CheckNameAvailabilityRequest().withName("testcertificatename") + .withType("Microsoft.App/connectedEnvironments/certificates"), com.azure.core.util.Context.NONE); } } @@ -972,7 +1048,7 @@ import com.azure.resourcemanager.appcontainers.models.CustomDomainConfiguration; */ public final class ConnectedEnvironmentsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * ConnectedEnvironments_CreateOrUpdate.json */ /** @@ -981,12 +1057,16 @@ public final class ConnectedEnvironmentsCreateOrUpdateSamples { * @param manager Entry point to ContainerAppsApiManager. */ public static void createKubeEnvironments(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.connectedEnvironments().define("testenv").withRegion("East US").withExistingResourceGroup("examplerg") + manager.connectedEnvironments() + .define("testenv") + .withRegion("East US") + .withExistingResourceGroup("examplerg") .withStaticIp("1.2.3.4") .withDaprAIConnectionString( "InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://northcentralus-0.in.applicationinsights.azure.com/") .withCustomDomainConfiguration(new CustomDomainConfiguration().withDnsSuffix("www.my-name.com") - .withCertificateValue("Y2VydA==".getBytes()).withCertificatePassword("fakeTokenPlaceholder")) + .withCertificateValue("Y2VydA==".getBytes()) + .withCertificatePassword("fakeTokenPlaceholder")) .create(); } } @@ -1001,7 +1081,7 @@ public final class ConnectedEnvironmentsCreateOrUpdateSamples { public final class ConnectedEnvironmentsDeleteSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ConnectedEnvironments_Delete + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ConnectedEnvironments_Delete * .json */ /** @@ -1025,7 +1105,7 @@ public final class ConnectedEnvironmentsDeleteSamples { public final class ConnectedEnvironmentsGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ConnectedEnvironments_Get. + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ConnectedEnvironments_Get. * json */ /** @@ -1035,8 +1115,8 @@ public final class ConnectedEnvironmentsGetByResourceGroupSamples { */ public static void getConnectedEnvironmentByConnectedEnvironmentName( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.connectedEnvironments().getByResourceGroupWithResponse("examplerg", "examplekenv", - com.azure.core.util.Context.NONE); + manager.connectedEnvironments() + .getByResourceGroupWithResponse("examplerg", "examplekenv", com.azure.core.util.Context.NONE); } } ``` @@ -1049,7 +1129,7 @@ public final class ConnectedEnvironmentsGetByResourceGroupSamples { */ public final class ConnectedEnvironmentsListSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * ConnectedEnvironments_ListBySubscription.json */ /** @@ -1072,7 +1152,7 @@ public final class ConnectedEnvironmentsListSamples { */ public final class ConnectedEnvironmentsListByResourceGroupSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * ConnectedEnvironments_ListByResourceGroup.json */ /** @@ -1096,7 +1176,7 @@ public final class ConnectedEnvironmentsListByResourceGroupSamples { public final class ConnectedEnvironmentsUpdateSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ConnectedEnvironments_Patch. + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ConnectedEnvironments_Patch. * json */ /** @@ -1121,7 +1201,7 @@ import com.azure.resourcemanager.appcontainers.models.CertificateProperties; */ public final class ConnectedEnvironmentsCertificatesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * ConnectedEnvironmentsCertificate_CreateOrUpdate.json */ /** @@ -1131,7 +1211,9 @@ public final class ConnectedEnvironmentsCertificatesCreateOrUpdateSamples { */ public static void createOrUpdateCertificate(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.connectedEnvironmentsCertificates().define("certificate-firendly-name").withRegion("East US") + manager.connectedEnvironmentsCertificates() + .define("certificate-firendly-name") + .withRegion("East US") .withExistingConnectedEnvironment("examplerg", "testcontainerenv") .withProperties( new CertificateProperties().withPassword("fakeTokenPlaceholder").withValue("Y2VydA==".getBytes())) @@ -1148,7 +1230,7 @@ public final class ConnectedEnvironmentsCertificatesCreateOrUpdateSamples { */ public final class ConnectedEnvironmentsCertificatesDeleteSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * ConnectedEnvironmentsCertificate_Delete.json */ /** @@ -1157,8 +1239,9 @@ public final class ConnectedEnvironmentsCertificatesDeleteSamples { * @param manager Entry point to ContainerAppsApiManager. */ public static void deleteCertificate(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.connectedEnvironmentsCertificates().deleteWithResponse("examplerg", "testcontainerenv", - "certificate-firendly-name", com.azure.core.util.Context.NONE); + manager.connectedEnvironmentsCertificates() + .deleteWithResponse("examplerg", "testcontainerenv", "certificate-firendly-name", + com.azure.core.util.Context.NONE); } } ``` @@ -1171,7 +1254,7 @@ public final class ConnectedEnvironmentsCertificatesDeleteSamples { */ public final class ConnectedEnvironmentsCertificatesGetSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * ConnectedEnvironmentsCertificate_Get.json */ /** @@ -1180,8 +1263,9 @@ public final class ConnectedEnvironmentsCertificatesGetSamples { * @param manager Entry point to ContainerAppsApiManager. */ public static void getCertificate(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.connectedEnvironmentsCertificates().getWithResponse("examplerg", "testcontainerenv", - "certificate-firendly-name", com.azure.core.util.Context.NONE); + manager.connectedEnvironmentsCertificates() + .getWithResponse("examplerg", "testcontainerenv", "certificate-firendly-name", + com.azure.core.util.Context.NONE); } } ``` @@ -1194,7 +1278,7 @@ public final class ConnectedEnvironmentsCertificatesGetSamples { */ public final class ConnectedEnvironmentsCertificatesListSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * ConnectedEnvironmentsCertificates_ListByConnectedEnvironment.json */ /** @@ -1204,8 +1288,8 @@ public final class ConnectedEnvironmentsCertificatesListSamples { */ public static void listCertificatesByConnectedEnvironment( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.connectedEnvironmentsCertificates().list("examplerg", "testcontainerenv", - com.azure.core.util.Context.NONE); + manager.connectedEnvironmentsCertificates() + .list("examplerg", "testcontainerenv", com.azure.core.util.Context.NONE); } } ``` @@ -1222,7 +1306,7 @@ import java.util.Map; */ public final class ConnectedEnvironmentsCertificatesUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * ConnectedEnvironmentsCertificates_Patch.json */ /** @@ -1231,8 +1315,10 @@ public final class ConnectedEnvironmentsCertificatesUpdateSamples { * @param manager Entry point to ContainerAppsApiManager. */ public static void patchCertificate(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - Certificate resource = manager.connectedEnvironmentsCertificates().getWithResponse("examplerg", - "testcontainerenv", "certificate-firendly-name", com.azure.core.util.Context.NONE).getValue(); + Certificate resource = manager.connectedEnvironmentsCertificates() + .getWithResponse("examplerg", "testcontainerenv", "certificate-firendly-name", + com.azure.core.util.Context.NONE) + .getValue(); resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); } @@ -1264,7 +1350,7 @@ import java.util.Arrays; */ public final class ConnectedEnvironmentsDaprComponentsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * ConnectedEnvironmentsDaprComponents_CreateOrUpdate.json */ /** @@ -1274,9 +1360,13 @@ public final class ConnectedEnvironmentsDaprComponentsCreateOrUpdateSamples { */ public static void createOrUpdateDaprComponent(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.connectedEnvironmentsDaprComponents().define("reddog") - .withExistingConnectedEnvironment("examplerg", "myenvironment").withComponentType("state.azure.cosmosdb") - .withVersion("v1").withIgnoreErrors(false).withInitTimeout("50s") + manager.connectedEnvironmentsDaprComponents() + .define("reddog") + .withExistingConnectedEnvironment("examplerg", "myenvironment") + .withComponentType("state.azure.cosmosdb") + .withVersion("v1") + .withIgnoreErrors(false) + .withInitTimeout("50s") .withSecrets(Arrays.asList(new Secret().withName("masterkey").withValue("keyvalue"))) .withMetadata(Arrays.asList(new DaprMetadata().withName("url").withValue(""), new DaprMetadata().withName("database").withValue("itemsDB"), @@ -1300,7 +1390,7 @@ public final class ConnectedEnvironmentsDaprComponentsCreateOrUpdateSamples { */ public final class ConnectedEnvironmentsDaprComponentsDeleteSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * ConnectedEnvironmentsDaprComponents_Delete.json */ /** @@ -1309,8 +1399,8 @@ public final class ConnectedEnvironmentsDaprComponentsDeleteSamples { * @param manager Entry point to ContainerAppsApiManager. */ public static void deleteDaprComponent(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.connectedEnvironmentsDaprComponents().deleteWithResponse("examplerg", "myenvironment", "reddog", - com.azure.core.util.Context.NONE); + manager.connectedEnvironmentsDaprComponents() + .deleteWithResponse("examplerg", "myenvironment", "reddog", com.azure.core.util.Context.NONE); } } ``` @@ -1323,7 +1413,7 @@ public final class ConnectedEnvironmentsDaprComponentsDeleteSamples { */ public final class ConnectedEnvironmentsDaprComponentsGetSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * ConnectedEnvironmentsDaprComponents_Get.json */ /** @@ -1332,8 +1422,8 @@ public final class ConnectedEnvironmentsDaprComponentsGetSamples { * @param manager Entry point to ContainerAppsApiManager. */ public static void getDaprComponent(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.connectedEnvironmentsDaprComponents().getWithResponse("examplerg", "myenvironment", "reddog", - com.azure.core.util.Context.NONE); + manager.connectedEnvironmentsDaprComponents() + .getWithResponse("examplerg", "myenvironment", "reddog", com.azure.core.util.Context.NONE); } } ``` @@ -1346,7 +1436,7 @@ public final class ConnectedEnvironmentsDaprComponentsGetSamples { */ public final class ConnectedEnvironmentsDaprComponentsListSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * ConnectedEnvironmentsDaprComponents_List.json */ /** @@ -1355,8 +1445,8 @@ public final class ConnectedEnvironmentsDaprComponentsListSamples { * @param manager Entry point to ContainerAppsApiManager. */ public static void listDaprComponents(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.connectedEnvironmentsDaprComponents().list("examplerg", "myenvironment", - com.azure.core.util.Context.NONE); + manager.connectedEnvironmentsDaprComponents() + .list("examplerg", "myenvironment", com.azure.core.util.Context.NONE); } } ``` @@ -1369,7 +1459,7 @@ public final class ConnectedEnvironmentsDaprComponentsListSamples { */ public final class ConnectedEnvironmentsDaprComponentsListSecretsSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * ConnectedEnvironmentsDaprComponents_ListSecrets.json */ /** @@ -1379,8 +1469,8 @@ public final class ConnectedEnvironmentsDaprComponentsListSecretsSamples { */ public static void listContainerAppsSecrets(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.connectedEnvironmentsDaprComponents().listSecretsWithResponse("examplerg", "myenvironment", "reddog", - com.azure.core.util.Context.NONE); + manager.connectedEnvironmentsDaprComponents() + .listSecretsWithResponse("examplerg", "myenvironment", "reddog", com.azure.core.util.Context.NONE); } } ``` @@ -1397,7 +1487,7 @@ import com.azure.resourcemanager.appcontainers.models.ConnectedEnvironmentStorag */ public final class ConnectedEnvironmentsStoragesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * ConnectedEnvironmentsStorages_CreateOrUpdate.json */ /** @@ -1407,11 +1497,14 @@ public final class ConnectedEnvironmentsStoragesCreateOrUpdateSamples { */ public static void createOrUpdateEnvironmentsStorage(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.connectedEnvironmentsStorages().define("jlaw-demo1") + manager.connectedEnvironmentsStorages() + .define("jlaw-demo1") .withExistingConnectedEnvironment("examplerg", "env") - .withProperties(new ConnectedEnvironmentStorageProperties().withAzureFile( - new AzureFileProperties().withAccountName("account1").withAccountKey("fakeTokenPlaceholder") - .withAccessMode(AccessMode.READ_ONLY).withShareName("share1"))) + .withProperties(new ConnectedEnvironmentStorageProperties() + .withAzureFile(new AzureFileProperties().withAccountName("account1") + .withAccountKey("fakeTokenPlaceholder") + .withAccessMode(AccessMode.READ_ONLY) + .withShareName("share1"))) .create(); } } @@ -1425,7 +1518,7 @@ public final class ConnectedEnvironmentsStoragesCreateOrUpdateSamples { */ public final class ConnectedEnvironmentsStoragesDeleteSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * ConnectedEnvironmentsStorages_Delete.json */ /** @@ -1435,8 +1528,8 @@ public final class ConnectedEnvironmentsStoragesDeleteSamples { */ public static void listEnvironmentsStoragesBySubscription( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.connectedEnvironmentsStorages().deleteWithResponse("examplerg", "env", "jlaw-demo1", - com.azure.core.util.Context.NONE); + manager.connectedEnvironmentsStorages() + .deleteWithResponse("examplerg", "env", "jlaw-demo1", com.azure.core.util.Context.NONE); } } ``` @@ -1449,7 +1542,7 @@ public final class ConnectedEnvironmentsStoragesDeleteSamples { */ public final class ConnectedEnvironmentsStoragesGetSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * ConnectedEnvironmentsStorages_Get.json */ /** @@ -1459,8 +1552,8 @@ public final class ConnectedEnvironmentsStoragesGetSamples { */ public static void getAEnvironmentsStoragePropertiesBySubscription( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.connectedEnvironmentsStorages().getWithResponse("examplerg", "env", "jlaw-demo1", - com.azure.core.util.Context.NONE); + manager.connectedEnvironmentsStorages() + .getWithResponse("examplerg", "env", "jlaw-demo1", com.azure.core.util.Context.NONE); } } ``` @@ -1473,7 +1566,7 @@ public final class ConnectedEnvironmentsStoragesGetSamples { */ public final class ConnectedEnvironmentsStoragesListSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * ConnectedEnvironmentsStorages_List.json */ /** @@ -1483,8 +1576,8 @@ public final class ConnectedEnvironmentsStoragesListSamples { */ public static void listEnvironmentsStoragesBySubscription( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.connectedEnvironmentsStorages().listWithResponse("examplerg", "managedEnv", - com.azure.core.util.Context.NONE); + manager.connectedEnvironmentsStorages() + .listWithResponse("examplerg", "managedEnv", com.azure.core.util.Context.NONE); } } ``` @@ -1493,6 +1586,7 @@ public final class ConnectedEnvironmentsStoragesListSamples { ```java import com.azure.resourcemanager.appcontainers.models.Action; +import com.azure.resourcemanager.appcontainers.models.ActiveRevisionsMode; import com.azure.resourcemanager.appcontainers.models.Affinity; import com.azure.resourcemanager.appcontainers.models.AppProtocol; import com.azure.resourcemanager.appcontainers.models.BindingType; @@ -1502,6 +1596,7 @@ import com.azure.resourcemanager.appcontainers.models.ContainerAppProbe; import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeHttpGet; import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeHttpGetHttpHeadersItem; import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeTcpSocket; +import com.azure.resourcemanager.appcontainers.models.ContainerAppPropertiesPatchingConfiguration; import com.azure.resourcemanager.appcontainers.models.ContainerResources; import com.azure.resourcemanager.appcontainers.models.CorsPolicy; import com.azure.resourcemanager.appcontainers.models.CustomDomain; @@ -1509,6 +1604,9 @@ import com.azure.resourcemanager.appcontainers.models.CustomScaleRule; import com.azure.resourcemanager.appcontainers.models.Dapr; import com.azure.resourcemanager.appcontainers.models.ExtendedLocation; import com.azure.resourcemanager.appcontainers.models.ExtendedLocationTypes; +import com.azure.resourcemanager.appcontainers.models.IdentitySettings; +import com.azure.resourcemanager.appcontainers.models.IdentitySettingsLifeCycle; +import com.azure.resourcemanager.appcontainers.models.ImageType; import com.azure.resourcemanager.appcontainers.models.Ingress; import com.azure.resourcemanager.appcontainers.models.IngressClientCertificateMode; import com.azure.resourcemanager.appcontainers.models.IngressPortMapping; @@ -1516,7 +1614,19 @@ import com.azure.resourcemanager.appcontainers.models.IngressStickySessions; import com.azure.resourcemanager.appcontainers.models.IngressTransportMethod; import com.azure.resourcemanager.appcontainers.models.InitContainer; import com.azure.resourcemanager.appcontainers.models.IpSecurityRestrictionRule; +import com.azure.resourcemanager.appcontainers.models.Kind; +import com.azure.resourcemanager.appcontainers.models.Level; +import com.azure.resourcemanager.appcontainers.models.LoggerSetting; import com.azure.resourcemanager.appcontainers.models.LogLevel; +import com.azure.resourcemanager.appcontainers.models.ManagedServiceIdentity; +import com.azure.resourcemanager.appcontainers.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.appcontainers.models.PatchingMode; +import com.azure.resourcemanager.appcontainers.models.QueueScaleRule; +import com.azure.resourcemanager.appcontainers.models.Runtime; +import com.azure.resourcemanager.appcontainers.models.RuntimeDotnet; +import com.azure.resourcemanager.appcontainers.models.RuntimeJava; +import com.azure.resourcemanager.appcontainers.models.RuntimeJavaAgent; +import com.azure.resourcemanager.appcontainers.models.RuntimeJavaAgentLogging; import com.azure.resourcemanager.appcontainers.models.Scale; import com.azure.resourcemanager.appcontainers.models.ScaleRule; import com.azure.resourcemanager.appcontainers.models.Service; @@ -1526,6 +1636,7 @@ import com.azure.resourcemanager.appcontainers.models.TcpScaleRule; import com.azure.resourcemanager.appcontainers.models.Template; import com.azure.resourcemanager.appcontainers.models.TrafficWeight; import com.azure.resourcemanager.appcontainers.models.Type; +import com.azure.resourcemanager.appcontainers.models.UserAssignedIdentity; import com.azure.resourcemanager.appcontainers.models.Volume; import com.azure.resourcemanager.appcontainers.models.VolumeMount; import java.util.Arrays; @@ -1537,7 +1648,125 @@ import java.util.Map; */ public final class ContainerAppsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ + * ContainerApps_SourceToCloudApp_CreateOrUpdate.json + */ + /** + * Sample code: Create or Update SourceToCloud App. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + createOrUpdateSourceToCloudApp(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerApps() + .define("testcontainerApp0") + .withRegion("East US") + .withExistingResourceGroup("rg") + .withEnvironmentId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube") + .withWorkloadProfileName("My-GP-01") + .withPatchingConfiguration( + new ContainerAppPropertiesPatchingConfiguration().withPatchingMode(PatchingMode.AUTOMATIC)) + .withConfiguration( + new Configuration() + .withIngress(new Ingress().withExternal(true) + .withTargetPort(3000) + .withTraffic(Arrays.asList(new TrafficWeight() + .withRevisionName("testcontainerApp0-ab1234") + .withWeight(100) + .withLabel("production"))) + .withCustomDomains(Arrays.asList(new CustomDomain() + .withName("www.my-name.com") + .withBindingType(BindingType.SNI_ENABLED) + .withCertificateId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-name-dot-com"), + new CustomDomain().withName("www.my-other-name.com") + .withBindingType(BindingType.SNI_ENABLED) + .withCertificateId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-other-name-dot-com"))) + .withIpSecurityRestrictions( + Arrays + .asList( + new IpSecurityRestrictionRule().withName("Allow work IP A subnet") + .withDescription( + "Allowing all IP's within the subnet below to access containerapp") + .withIpAddressRange("192.168.1.1/32") + .withAction(Action.ALLOW), + new IpSecurityRestrictionRule().withName("Allow work IP B subnet") + .withDescription( + "Allowing all IP's within the subnet below to access containerapp") + .withIpAddressRange("192.168.1.1/8") + .withAction(Action.ALLOW))) + .withStickySessions(new IngressStickySessions().withAffinity(Affinity.STICKY)) + .withClientCertificateMode(IngressClientCertificateMode.ACCEPT) + .withCorsPolicy(new CorsPolicy() + .withAllowedOrigins(Arrays.asList("https://a.test.com", "https://b.test.com")) + .withAllowedMethods(Arrays.asList("GET", "POST")) + .withAllowedHeaders(Arrays.asList("HEADER1", "HEADER2")) + .withExposeHeaders(Arrays.asList("HEADER3", "HEADER4")) + .withMaxAge(1234) + .withAllowCredentials(true)) + .withAdditionalPortMappings(Arrays.asList( + new IngressPortMapping().withExternal(true).withTargetPort(1234), + new IngressPortMapping().withExternal(false).withTargetPort(2345).withExposedPort(3456)))) + .withDapr(new Dapr().withEnabled(true) + .withAppProtocol(AppProtocol.HTTP) + .withAppPort(3000) + .withHttpReadBufferSize(30) + .withHttpMaxRequestSize(10) + .withLogLevel(LogLevel.DEBUG) + .withEnableApiLogging(true)) + .withMaxInactiveRevisions(10) + .withService(new Service().withType("redis"))) + .withTemplate(new Template() + .withInitContainers(Arrays.asList(new InitContainer().withImage("repo/testcontainerApp0:v4") + .withName("testinitcontainerApp0") + .withCommand(Arrays.asList("/bin/sh")) + .withArgs(Arrays.asList("-c", "while true; do echo hello; sleep 10;done")) + .withResources(new ContainerResources().withCpu(0.2D).withMemory("100Mi")))) + .withContainers(Arrays.asList(new Container() + .withImage("") + .withImageType(ImageType.CLOUD_BUILD) + .withName("testcontainerApp0") + .withVolumeMounts( + Arrays.asList( + new VolumeMount().withVolumeName("azurefile") + .withMountPath("/mnt/path1") + .withSubPath("subPath1"), + new VolumeMount() + .withVolumeName("nfsazurefile") + .withMountPath("/mnt/path2") + .withSubPath("subPath2"))) + .withProbes( + Arrays.asList(new ContainerAppProbe().withHttpGet(new ContainerAppProbeHttpGet() + .withHttpHeaders( + Arrays.asList(new ContainerAppProbeHttpGetHttpHeadersItem().withName("Custom-Header") + .withValue("Awesome"))) + .withPath("/health") + .withPort(8080)).withInitialDelaySeconds(3).withPeriodSeconds(3).withType(Type.LIVENESS))))) + .withScale( + new Scale().withMinReplicas(1) + .withMaxReplicas(5) + .withRules(Arrays.asList(new ScaleRule().withName("httpscalingrule") + .withCustom(new CustomScaleRule().withType("http") + .withMetadata(mapOf("concurrentRequests", "50")))))) + .withVolumes(Arrays.asList( + new Volume().withName("azurefile") + .withStorageType(StorageType.AZURE_FILE) + .withStorageName("storage"), + new Volume().withName("nfsazurefile") + .withStorageType(StorageType.NFS_AZURE_FILE) + .withStorageName("nfsStorage"))) + .withServiceBinds(Arrays.asList(new ServiceBind().withServiceId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/redisService") + .withName("redisService") + .withClientType("dotnet") + .withCustomizedKeys(mapOf("DesiredKey", "fakeTokenPlaceholder"))))) + .create(); + } + + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * ContainerApps_CreateOrUpdate_ConnectedEnvironment.json */ /** @@ -1547,67 +1776,99 @@ public final class ContainerAppsCreateOrUpdateSamples { */ public static void createOrUpdateAppOnAConnectedEnvironment( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerApps().define("testcontainerApp0").withRegion("East US").withExistingResourceGroup("rg") + manager.containerApps() + .define("testcontainerApp0") + .withRegion("East US") + .withExistingResourceGroup("rg") .withExtendedLocation(new ExtendedLocation().withName( "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.ExtendedLocation/customLocations/testcustomlocation") .withType(ExtendedLocationTypes.CUSTOM_LOCATION)) .withEnvironmentId( "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/connectedEnvironments/demokube") - .withConfiguration(new Configuration().withIngress(new Ingress().withExternal(true).withTargetPort(3000) - .withTraffic(Arrays.asList(new TrafficWeight().withRevisionName("testcontainerApp0-ab1234") - .withWeight(100).withLabel("production"))) - .withCustomDomains(Arrays.asList(new CustomDomain().withName("www.my-name.com") - .withBindingType(BindingType.SNI_ENABLED).withCertificateId( - "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/connectedEnvironments/demokube/certificates/my-certificate-for-my-name-dot-com"), - new CustomDomain().withName("www.my-other-name.com").withBindingType(BindingType.SNI_ENABLED) - .withCertificateId( - "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/connectedEnvironments/demokube/certificates/my-certificate-for-my-other-name-dot-com"))) - .withIpSecurityRestrictions(Arrays.asList( - new IpSecurityRestrictionRule().withName("Allow work IP A subnet") - .withDescription("Allowing all IP's within the subnet below to access containerapp") - .withIpAddressRange("192.168.1.1/32").withAction(Action.ALLOW), - new IpSecurityRestrictionRule().withName("Allow work IP B subnet") - .withDescription("Allowing all IP's within the subnet below to access containerapp") - .withIpAddressRange("192.168.1.1/8").withAction(Action.ALLOW))) - .withStickySessions(new IngressStickySessions().withAffinity(Affinity.STICKY)) - .withClientCertificateMode(IngressClientCertificateMode.ACCEPT) - .withCorsPolicy(new CorsPolicy() - .withAllowedOrigins(Arrays.asList("https://a.test.com", "https://b.test.com")) - .withAllowedMethods(Arrays.asList("GET", "POST")) - .withAllowedHeaders(Arrays.asList("HEADER1", "HEADER2")) - .withExposeHeaders(Arrays.asList("HEADER3", "HEADER4")).withMaxAge(1234).withAllowCredentials(true)) - .withAdditionalPortMappings( - Arrays.asList(new IngressPortMapping().withExternal(true).withTargetPort(1234), - new IngressPortMapping().withExternal(false).withTargetPort(2345).withExposedPort(3456)))) - .withDapr( - new Dapr().withEnabled(true).withAppProtocol(AppProtocol.HTTP).withAppPort(3000) - .withHttpReadBufferSize(30).withHttpMaxRequestSize(10).withLogLevel( - LogLevel.DEBUG) + .withConfiguration( + new Configuration() + .withIngress(new Ingress().withExternal(true) + .withTargetPort(3000) + .withTraffic(Arrays.asList(new TrafficWeight() + .withRevisionName("testcontainerApp0-ab1234") + .withWeight(100) + .withLabel("production"))) + .withCustomDomains(Arrays.asList(new CustomDomain() + .withName("www.my-name.com") + .withBindingType(BindingType.SNI_ENABLED) + .withCertificateId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/connectedEnvironments/demokube/certificates/my-certificate-for-my-name-dot-com"), + new CustomDomain().withName("www.my-other-name.com") + .withBindingType(BindingType.SNI_ENABLED) + .withCertificateId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/connectedEnvironments/demokube/certificates/my-certificate-for-my-other-name-dot-com"))) + .withIpSecurityRestrictions( + Arrays + .asList( + new IpSecurityRestrictionRule().withName("Allow work IP A subnet") + .withDescription( + "Allowing all IP's within the subnet below to access containerapp") + .withIpAddressRange("192.168.1.1/32") + .withAction(Action.ALLOW), + new IpSecurityRestrictionRule().withName("Allow work IP B subnet") + .withDescription( + "Allowing all IP's within the subnet below to access containerapp") + .withIpAddressRange("192.168.1.1/8") + .withAction(Action.ALLOW))) + .withStickySessions(new IngressStickySessions().withAffinity(Affinity.STICKY)) + .withClientCertificateMode(IngressClientCertificateMode.ACCEPT) + .withCorsPolicy(new CorsPolicy() + .withAllowedOrigins(Arrays.asList("https://a.test.com", "https://b.test.com")) + .withAllowedMethods(Arrays.asList("GET", "POST")) + .withAllowedHeaders(Arrays.asList("HEADER1", "HEADER2")) + .withExposeHeaders(Arrays.asList("HEADER3", "HEADER4")) + .withMaxAge(1234) + .withAllowCredentials(true)) + .withAdditionalPortMappings(Arrays.asList( + new IngressPortMapping().withExternal(true).withTargetPort(1234), + new IngressPortMapping().withExternal(false).withTargetPort(2345).withExposedPort(3456)))) + .withDapr(new Dapr() + .withEnabled(true) + .withAppProtocol(AppProtocol.HTTP) + .withAppPort(3000) + .withHttpReadBufferSize(30) + .withHttpMaxRequestSize(10) + .withLogLevel(LogLevel.DEBUG) .withEnableApiLogging(true)) - .withMaxInactiveRevisions(10)) + .withRuntime(new Runtime().withJava(new RuntimeJava().withEnableMetrics(true) + .withJavaAgent(new RuntimeJavaAgent().withEnabled(true) + .withLogging(new RuntimeJavaAgentLogging().withLoggerSettings(Arrays.asList( + new LoggerSetting().withLogger("org.springframework.boot").withLevel(Level.DEBUG)))))) + .withDotnet(new RuntimeDotnet().withAutoConfigureDataProtection(true))) + .withMaxInactiveRevisions(10)) .withTemplate(new Template() .withInitContainers(Arrays.asList(new InitContainer().withImage("repo/testcontainerApp0:v4") - .withName("testinitcontainerApp0").withCommand(Arrays.asList("/bin/sh")) + .withName("testinitcontainerApp0") + .withCommand(Arrays.asList("/bin/sh")) .withArgs(Arrays.asList("-c", "while true; do echo hello; sleep 10;done")) .withResources(new ContainerResources().withCpu(0.2D).withMemory("100Mi")))) - .withContainers( - Arrays - .asList(new Container().withImage("repo/testcontainerApp0:v1").withName("testcontainerApp0") - .withProbes(Arrays.asList(new ContainerAppProbe() - .withHttpGet(new ContainerAppProbeHttpGet() - .withHttpHeaders(Arrays.asList(new ContainerAppProbeHttpGetHttpHeadersItem() - .withName("Custom-Header").withValue("Awesome"))) - .withPath("/health").withPort(8080)) - .withInitialDelaySeconds(3).withPeriodSeconds(3).withType(Type.LIVENESS))))) - .withScale(new Scale().withMinReplicas(1).withMaxReplicas(5) - .withRules(Arrays.asList(new ScaleRule().withName("httpscalingrule").withCustom( - new CustomScaleRule().withType("http").withMetadata(mapOf("concurrentRequests", "50"))))))) + .withContainers(Arrays.asList(new Container() + .withImage("repo/testcontainerApp0:v1") + .withName("testcontainerApp0") + .withProbes( + Arrays.asList(new ContainerAppProbe().withHttpGet(new ContainerAppProbeHttpGet() + .withHttpHeaders( + Arrays.asList(new ContainerAppProbeHttpGetHttpHeadersItem().withName("Custom-Header") + .withValue("Awesome"))) + .withPath("/health") + .withPort(8080)).withInitialDelaySeconds(3).withPeriodSeconds(3).withType(Type.LIVENESS))))) + .withScale( + new Scale().withMinReplicas(1) + .withMaxReplicas(5) + .withRules(Arrays.asList(new ScaleRule().withName("httpscalingrule") + .withCustom(new CustomScaleRule().withType("http") + .withMetadata(mapOf("concurrentRequests", "50"))))))) .create(); } /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ContainerApps_CreateOrUpdate + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ContainerApps_CreateOrUpdate * .json */ /** @@ -1617,76 +1878,141 @@ public final class ContainerAppsCreateOrUpdateSamples { */ public static void createOrUpdateContainerApp(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerApps().define("testcontainerApp0").withRegion("East US").withExistingResourceGroup("rg") + manager.containerApps() + .define("testcontainerApp0") + .withRegion("East US") + .withExistingResourceGroup("rg") + .withIdentity(new ManagedServiceIdentity() + .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity", + new UserAssignedIdentity()))) .withEnvironmentId( "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube") - .withWorkloadProfileName( - "My-GP-01") - .withConfiguration(new Configuration().withIngress(new Ingress().withExternal(true).withTargetPort(3000) - .withTraffic(Arrays.asList(new TrafficWeight().withRevisionName("testcontainerApp0-ab1234") - .withWeight(100).withLabel("production"))) - .withCustomDomains(Arrays.asList(new CustomDomain().withName("www.my-name.com") - .withBindingType(BindingType.SNI_ENABLED).withCertificateId( - "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-name-dot-com"), - new CustomDomain().withName("www.my-other-name.com").withBindingType(BindingType.SNI_ENABLED) - .withCertificateId( - "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-other-name-dot-com"))) - .withIpSecurityRestrictions(Arrays.asList( - new IpSecurityRestrictionRule().withName("Allow work IP A subnet") - .withDescription("Allowing all IP's within the subnet below to access containerapp") - .withIpAddressRange("192.168.1.1/32").withAction(Action.ALLOW), - new IpSecurityRestrictionRule().withName("Allow work IP B subnet") - .withDescription("Allowing all IP's within the subnet below to access containerapp") - .withIpAddressRange("192.168.1.1/8").withAction(Action.ALLOW))) - .withStickySessions(new IngressStickySessions().withAffinity(Affinity.STICKY)) - .withClientCertificateMode(IngressClientCertificateMode.ACCEPT) - .withCorsPolicy(new CorsPolicy() - .withAllowedOrigins(Arrays.asList("https://a.test.com", "https://b.test.com")) - .withAllowedMethods(Arrays.asList("GET", "POST")) - .withAllowedHeaders(Arrays.asList("HEADER1", "HEADER2")) - .withExposeHeaders(Arrays.asList("HEADER3", "HEADER4")).withMaxAge(1234).withAllowCredentials(true)) - .withAdditionalPortMappings( - Arrays.asList(new IngressPortMapping().withExternal(true).withTargetPort(1234), - new IngressPortMapping().withExternal(false).withTargetPort(2345).withExposedPort(3456)))) - .withDapr(new Dapr().withEnabled(true).withAppProtocol(AppProtocol.HTTP).withAppPort(3000) - .withHttpReadBufferSize(30).withHttpMaxRequestSize(10).withLogLevel(LogLevel.DEBUG) - .withEnableApiLogging(true)) - .withMaxInactiveRevisions(10).withService(new Service().withType("redis"))) + .withWorkloadProfileName("My-GP-01") + .withConfiguration( + new Configuration() + .withIngress(new Ingress().withExternal(true) + .withTargetPort(3000) + .withTraffic(Arrays.asList(new TrafficWeight() + .withRevisionName("testcontainerApp0-ab1234") + .withWeight(100) + .withLabel("production"))) + .withCustomDomains(Arrays.asList(new CustomDomain() + .withName("www.my-name.com") + .withBindingType(BindingType.SNI_ENABLED) + .withCertificateId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-name-dot-com"), + new CustomDomain().withName("www.my-other-name.com") + .withBindingType(BindingType.SNI_ENABLED) + .withCertificateId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-other-name-dot-com"))) + .withIpSecurityRestrictions( + Arrays + .asList( + new IpSecurityRestrictionRule().withName("Allow work IP A subnet") + .withDescription( + "Allowing all IP's within the subnet below to access containerapp") + .withIpAddressRange("192.168.1.1/32") + .withAction(Action.ALLOW), + new IpSecurityRestrictionRule().withName("Allow work IP B subnet") + .withDescription( + "Allowing all IP's within the subnet below to access containerapp") + .withIpAddressRange("192.168.1.1/8") + .withAction(Action.ALLOW))) + .withStickySessions(new IngressStickySessions().withAffinity(Affinity.STICKY)) + .withClientCertificateMode(IngressClientCertificateMode.ACCEPT) + .withCorsPolicy(new CorsPolicy() + .withAllowedOrigins(Arrays.asList("https://a.test.com", "https://b.test.com")) + .withAllowedMethods(Arrays.asList("GET", "POST")) + .withAllowedHeaders(Arrays.asList("HEADER1", "HEADER2")) + .withExposeHeaders(Arrays.asList("HEADER3", "HEADER4")) + .withMaxAge(1234) + .withAllowCredentials(true)) + .withAdditionalPortMappings(Arrays.asList( + new IngressPortMapping().withExternal(true).withTargetPort(1234), + new IngressPortMapping().withExternal(false).withTargetPort(2345).withExposedPort(3456)))) + .withDapr(new Dapr() + .withEnabled(true) + .withAppProtocol(AppProtocol.HTTP) + .withAppPort(3000) + .withHttpReadBufferSize(30) + .withHttpMaxRequestSize(10) + .withLogLevel(LogLevel.DEBUG) + .withEnableApiLogging(true)) + .withRuntime(new Runtime().withJava(new RuntimeJava() + .withEnableMetrics(true) + .withJavaAgent(new RuntimeJavaAgent() + .withEnabled(true) + .withLogging(new RuntimeJavaAgentLogging().withLoggerSettings( + Arrays.asList(new LoggerSetting().withLogger("org.springframework.boot") + .withLevel(Level.DEBUG)))))) + .withDotnet(new RuntimeDotnet().withAutoConfigureDataProtection(true))) + .withMaxInactiveRevisions(10) + .withService(new Service().withType("redis")) + .withIdentitySettings(Arrays.asList(new IdentitySettings().withIdentity( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity") + .withLifecycle(IdentitySettingsLifeCycle.ALL), + new IdentitySettings().withIdentity("system").withLifecycle(IdentitySettingsLifeCycle.INIT)))) .withTemplate(new Template() .withInitContainers(Arrays.asList(new InitContainer().withImage("repo/testcontainerApp0:v4") - .withName("testinitcontainerApp0").withCommand(Arrays.asList("/bin/sh")) + .withName("testinitcontainerApp0") + .withCommand(Arrays.asList("/bin/sh")) .withArgs(Arrays.asList("-c", "while true; do echo hello; sleep 10;done")) .withResources(new ContainerResources().withCpu(0.2D).withMemory("100Mi")))) - .withContainers( - Arrays.asList(new Container().withImage("repo/testcontainerApp0:v1").withName("testcontainerApp0") - .withVolumeMounts(Arrays.asList( - new VolumeMount().withVolumeName("azurefile").withMountPath("/mnt/path1") + .withContainers(Arrays.asList(new Container() + .withImage("repo/testcontainerApp0:v1") + .withName("testcontainerApp0") + .withVolumeMounts( + Arrays.asList( + new VolumeMount().withVolumeName("azurefile") + .withMountPath("/mnt/path1") .withSubPath("subPath1"), - new VolumeMount().withVolumeName("nfsazurefile").withMountPath("/mnt/path2") + new VolumeMount() + .withVolumeName("nfsazurefile") + .withMountPath("/mnt/path2") .withSubPath("subPath2"))) - .withProbes(Arrays.asList(new ContainerAppProbe() - .withHttpGet(new ContainerAppProbeHttpGet() - .withHttpHeaders(Arrays.asList(new ContainerAppProbeHttpGetHttpHeadersItem() - .withName("Custom-Header").withValue("Awesome"))) - .withPath("/health").withPort(8080)) - .withInitialDelaySeconds(3).withPeriodSeconds(3).withType(Type.LIVENESS))))) - .withScale(new Scale().withMinReplicas(1).withMaxReplicas(5) - .withRules(Arrays.asList(new ScaleRule().withName("httpscalingrule").withCustom( - new CustomScaleRule().withType("http").withMetadata(mapOf("concurrentRequests", "50")))))) + .withProbes( + Arrays.asList(new ContainerAppProbe().withHttpGet(new ContainerAppProbeHttpGet() + .withHttpHeaders( + Arrays.asList(new ContainerAppProbeHttpGetHttpHeadersItem().withName("Custom-Header") + .withValue("Awesome"))) + .withPath("/health") + .withPort(8080)).withInitialDelaySeconds(3).withPeriodSeconds(3).withType(Type.LIVENESS))))) + .withScale(new Scale().withMinReplicas(1) + .withMaxReplicas(5) + .withRules(Arrays.asList( + new ScaleRule().withName("httpscalingrule") + .withCustom( + new CustomScaleRule().withType("http").withMetadata(mapOf("concurrentRequests", "50"))), + new ScaleRule().withName("servicebus") + .withCustom(new CustomScaleRule().withType("azure-servicebus") + .withMetadata( + mapOf("messageCount", "5", "namespace", "mynamespace", "queueName", "myqueue")) + .withIdentity( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity")), + new ScaleRule().withName("azure-queue") + .withAzureQueue(new QueueScaleRule().withAccountName("account1") + .withQueueName("queue1") + .withQueueLength(1) + .withIdentity("system"))))) .withVolumes(Arrays.asList( - new Volume().withName("azurefile").withStorageType(StorageType.AZURE_FILE) + new Volume().withName("azurefile") + .withStorageType(StorageType.AZURE_FILE) .withStorageName("storage"), - new Volume().withName("nfsazurefile").withStorageType(StorageType.NFS_AZURE_FILE) + new Volume().withName("nfsazurefile") + .withStorageType(StorageType.NFS_AZURE_FILE) .withStorageName("nfsStorage"))) .withServiceBinds(Arrays.asList(new ServiceBind().withServiceId( "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/redisService") - .withName("redisService").withClientType("dotnet") + .withName("redisService") + .withClientType("dotnet") .withCustomizedKeys(mapOf("DesiredKey", "fakeTokenPlaceholder"))))) .create(); } /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * ContainerApps_TcpApp_CreateOrUpdate.json */ /** @@ -1695,35 +2021,64 @@ public final class ContainerAppsCreateOrUpdateSamples { * @param manager Entry point to ContainerAppsApiManager. */ public static void createOrUpdateTcpApp(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerApps().define("testcontainerAppTcp").withRegion("East US").withExistingResourceGroup("rg") + manager.containerApps() + .define("testcontainerAppTcp") + .withRegion("East US") + .withExistingResourceGroup("rg") .withEnvironmentId( "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube") .withConfiguration( - new Configuration() - .withIngress( - new Ingress().withExternal(true).withTargetPort(3000).withExposedPort(4000) - .withTransport( - IngressTransportMethod.TCP) - .withTraffic( - Arrays - .asList( - new TrafficWeight().withRevisionName( - "testcontainerAppTcp-ab1234").withWeight( - 100))))) + new Configuration().withIngress(new Ingress().withExternal(true) + .withTargetPort(3000) + .withExposedPort(4000) + .withTransport(IngressTransportMethod.TCP) + .withTraffic(Arrays + .asList(new TrafficWeight().withRevisionName("testcontainerAppTcp-ab1234").withWeight(100))))) .withTemplate(new Template() .withContainers(Arrays.asList(new Container().withImage("repo/testcontainerAppTcp:v1") .withName("testcontainerAppTcp") - .withProbes(Arrays.asList(new ContainerAppProbe().withInitialDelaySeconds(3).withPeriodSeconds(3) - .withTcpSocket(new ContainerAppProbeTcpSocket().withPort(8080)).withType(Type.LIVENESS))))) - .withScale( - new Scale().withMinReplicas(1).withMaxReplicas(5) - .withRules(Arrays.asList(new ScaleRule().withName("tcpscalingrule") - .withTcp(new TcpScaleRule().withMetadata(mapOf("concurrentConnections", "50"))))))) + .withProbes(Arrays.asList(new ContainerAppProbe().withInitialDelaySeconds(3) + .withPeriodSeconds(3) + .withTcpSocket(new ContainerAppProbeTcpSocket().withPort(8080)) + .withType(Type.LIVENESS))))) + .withScale(new Scale().withMinReplicas(1) + .withMaxReplicas(5) + .withRules(Arrays.asList(new ScaleRule().withName("tcpscalingrule") + .withTcp(new TcpScaleRule().withMetadata(mapOf("concurrentConnections", "50"))))))) .create(); } /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ + * ContainerApps_Kind_CreateOrUpdate.json + */ + /** + * Sample code: Create or Update App Kind. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void createOrUpdateAppKind(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerApps() + .define("testcontainerAppKind") + .withRegion("East Us") + .withExistingResourceGroup("rg") + .withManagedBy( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.Web/sites/testcontainerAppKind") + .withKind(Kind.WORKFLOWAPP) + .withManagedEnvironmentId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/testmanagedenv3") + .withConfiguration(new Configuration().withActiveRevisionsMode(ActiveRevisionsMode.SINGLE) + .withIngress(new Ingress().withExternal(true).withTargetPort(80).withAllowInsecure(true))) + .withTemplate(new Template() + .withContainers(Arrays.asList(new Container().withImage("default/logicapps-base:latest") + .withName("logicapps-container") + .withResources(new ContainerResources().withCpu(1.0D).withMemory("2.0Gi")))) + .withScale(new Scale().withMinReplicas(1).withMaxReplicas(30))) + .create(); + } + + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * ContainerApps_ManagedBy_CreateOrUpdate.json */ /** @@ -1733,30 +2088,31 @@ public final class ContainerAppsCreateOrUpdateSamples { */ public static void createOrUpdateManagedByApp(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerApps().define("testcontainerAppManagedBy").withRegion("East US") + manager.containerApps() + .define("testcontainerAppManagedBy") + .withRegion("East US") .withExistingResourceGroup("rg") .withManagedBy( "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.AppPlatform/Spring/springapp") .withEnvironmentId( "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube") - .withConfiguration( - new Configuration() - .withIngress( - new Ingress().withExternal(true).withTargetPort(3000).withExposedPort(4000) - .withTransport(IngressTransportMethod.TCP).withTraffic( - Arrays - .asList( - new TrafficWeight().withRevisionName("testcontainerAppManagedBy-ab1234") - .withWeight(100))))) + .withConfiguration(new Configuration().withIngress(new Ingress().withExternal(true) + .withTargetPort(3000) + .withExposedPort(4000) + .withTransport(IngressTransportMethod.TCP) + .withTraffic(Arrays + .asList(new TrafficWeight().withRevisionName("testcontainerAppManagedBy-ab1234").withWeight(100))))) .withTemplate(new Template() .withContainers(Arrays.asList(new Container().withImage("repo/testcontainerAppManagedBy:v1") .withName("testcontainerAppManagedBy") - .withProbes(Arrays.asList(new ContainerAppProbe().withInitialDelaySeconds(3).withPeriodSeconds(3) - .withTcpSocket(new ContainerAppProbeTcpSocket().withPort(8080)).withType(Type.LIVENESS))))) - .withScale( - new Scale().withMinReplicas(1).withMaxReplicas(5) - .withRules(Arrays.asList(new ScaleRule().withName("tcpscalingrule") - .withTcp(new TcpScaleRule().withMetadata(mapOf("concurrentConnections", "50"))))))) + .withProbes(Arrays.asList(new ContainerAppProbe().withInitialDelaySeconds(3) + .withPeriodSeconds(3) + .withTcpSocket(new ContainerAppProbeTcpSocket().withPort(8080)) + .withType(Type.LIVENESS))))) + .withScale(new Scale().withMinReplicas(1) + .withMaxReplicas(5) + .withRules(Arrays.asList(new ScaleRule().withName("tcpscalingrule") + .withTcp(new TcpScaleRule().withMetadata(mapOf("concurrentConnections", "50"))))))) .create(); } @@ -1783,7 +2139,7 @@ public final class ContainerAppsCreateOrUpdateSamples { public final class ContainerAppsDeleteSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ContainerApps_Delete.json + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ContainerApps_Delete.json */ /** * Sample code: Delete Container App. @@ -1805,7 +2161,7 @@ public final class ContainerAppsDeleteSamples { public final class ContainerAppsGetAuthTokenSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ContainerApps_GetAuthToken. + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ContainerApps_GetAuthToken. * json */ /** @@ -1829,7 +2185,7 @@ public final class ContainerAppsGetAuthTokenSamples { public final class ContainerAppsGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ContainerApps_Get.json + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ContainerApps_Get.json */ /** * Sample code: Get Container App. @@ -1837,8 +2193,8 @@ public final class ContainerAppsGetByResourceGroupSamples { * @param manager Entry point to ContainerAppsApiManager. */ public static void getContainerApp(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerApps().getByResourceGroupWithResponse("rg", "testcontainerApp0", - com.azure.core.util.Context.NONE); + manager.containerApps() + .getByResourceGroupWithResponse("rg", "testcontainerApp0", com.azure.core.util.Context.NONE); } } ``` @@ -1851,7 +2207,7 @@ public final class ContainerAppsGetByResourceGroupSamples { */ public final class ContainerAppsListSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * ContainerApps_ListBySubscription.json */ /** @@ -1874,7 +2230,7 @@ public final class ContainerAppsListSamples { */ public final class ContainerAppsListByResourceGroupSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * ContainerApps_ListByResourceGroup.json */ /** @@ -1897,7 +2253,7 @@ public final class ContainerAppsListByResourceGroupSamples { */ public final class ContainerAppsListCustomHostnameAnalysisSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * ContainerApps_ListCustomHostNameAnalysis.json */ /** @@ -1906,8 +2262,9 @@ public final class ContainerAppsListCustomHostnameAnalysisSamples { * @param manager Entry point to ContainerAppsApiManager. */ public static void analyzeCustomHostname(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerApps().listCustomHostnameAnalysisWithResponse("rg", "testcontainerApp0", "my.name.corp", - com.azure.core.util.Context.NONE); + manager.containerApps() + .listCustomHostnameAnalysisWithResponse("rg", "testcontainerApp0", "my.name.corp", + com.azure.core.util.Context.NONE); } } ``` @@ -1921,7 +2278,7 @@ public final class ContainerAppsListCustomHostnameAnalysisSamples { public final class ContainerAppsListSecretsSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ContainerApps_ListSecrets. + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ContainerApps_ListSecrets. * json */ /** @@ -1945,7 +2302,7 @@ public final class ContainerAppsListSecretsSamples { public final class ContainerAppsStartSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ContainerApps_Start.json + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ContainerApps_Start.json */ /** * Sample code: Start Container App. @@ -1967,7 +2324,7 @@ public final class ContainerAppsStartSamples { public final class ContainerAppsStopSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ContainerApps_Stop.json + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ContainerApps_Stop.json */ /** * Sample code: Stop Container App. @@ -2001,7 +2358,14 @@ import com.azure.resourcemanager.appcontainers.models.Ingress; import com.azure.resourcemanager.appcontainers.models.IngressStickySessions; import com.azure.resourcemanager.appcontainers.models.InitContainer; import com.azure.resourcemanager.appcontainers.models.IpSecurityRestrictionRule; +import com.azure.resourcemanager.appcontainers.models.Level; +import com.azure.resourcemanager.appcontainers.models.LoggerSetting; import com.azure.resourcemanager.appcontainers.models.LogLevel; +import com.azure.resourcemanager.appcontainers.models.Runtime; +import com.azure.resourcemanager.appcontainers.models.RuntimeDotnet; +import com.azure.resourcemanager.appcontainers.models.RuntimeJava; +import com.azure.resourcemanager.appcontainers.models.RuntimeJavaAgent; +import com.azure.resourcemanager.appcontainers.models.RuntimeJavaAgentLogging; import com.azure.resourcemanager.appcontainers.models.Scale; import com.azure.resourcemanager.appcontainers.models.ScaleRule; import com.azure.resourcemanager.appcontainers.models.Service; @@ -2019,7 +2383,7 @@ import java.util.Map; public final class ContainerAppsUpdateSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ContainerApps_Patch.json + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ContainerApps_Patch.json */ /** * Sample code: Patch Container App. @@ -2028,50 +2392,82 @@ public final class ContainerAppsUpdateSamples { */ public static void patchContainerApp(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { ContainerApp resource = manager.containerApps() - .getByResourceGroupWithResponse("rg", "testcontainerApp0", com.azure.core.util.Context.NONE).getValue(); - resource - .update().withTags( - mapOf("tag1", "value1", "tag2", "value2")) - .withConfiguration(new Configuration().withIngress(new Ingress().withExternal(true).withTargetPort(3000) - .withTraffic(Arrays.asList(new TrafficWeight().withRevisionName("testcontainerApp0-ab1234") - .withWeight(100).withLabel("production"))) - .withCustomDomains(Arrays.asList(new CustomDomain().withName("www.my-name.com") - .withBindingType(BindingType.SNI_ENABLED).withCertificateId( - "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-name-dot-com"), - new CustomDomain().withName("www.my-other-name.com").withBindingType(BindingType.SNI_ENABLED) - .withCertificateId( - "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-other-name-dot-com"))) - .withIpSecurityRestrictions(Arrays.asList( - new IpSecurityRestrictionRule().withName("Allow work IP A subnet") - .withDescription("Allowing all IP's within the subnet below to access containerapp") - .withIpAddressRange("192.168.1.1/32").withAction(Action.ALLOW), - new IpSecurityRestrictionRule().withName("Allow work IP B subnet") - .withDescription("Allowing all IP's within the subnet below to access containerapp") - .withIpAddressRange("192.168.1.1/8").withAction(Action.ALLOW))) - .withStickySessions(new IngressStickySessions().withAffinity(Affinity.STICKY))) - .withDapr(new Dapr().withEnabled(true).withAppProtocol(AppProtocol.HTTP).withAppPort(3000) - .withHttpReadBufferSize(30).withHttpMaxRequestSize(10).withLogLevel(LogLevel.DEBUG) - .withEnableApiLogging(true)) - .withMaxInactiveRevisions(10).withService(new Service().withType("redis"))) - .withTemplate( - new Template() - .withInitContainers(Arrays.asList( - new InitContainer().withImage("repo/testcontainerApp0:v4").withName("testinitcontainerApp0") - .withResources(new ContainerResources().withCpu(0.2D).withMemory("100Mi")))) - .withContainers(Arrays.asList(new Container().withImage("repo/testcontainerApp0:v1") - .withName("testcontainerApp0").withProbes(Arrays.asList(new ContainerAppProbe() - .withHttpGet(new ContainerAppProbeHttpGet() - .withHttpHeaders(Arrays.asList(new ContainerAppProbeHttpGetHttpHeadersItem() - .withName("Custom-Header").withValue("Awesome"))) - .withPath("/health").withPort(8080)) - .withInitialDelaySeconds(3).withPeriodSeconds(3).withType(Type.LIVENESS))))) - .withScale(new Scale().withMinReplicas(1).withMaxReplicas(5) - .withRules(Arrays.asList(new ScaleRule().withName("httpscalingrule").withCustom( - new CustomScaleRule().withType("http").withMetadata(mapOf("concurrentRequests", "50")))))) - .withServiceBinds(Arrays.asList(new ServiceBind().withServiceId( - "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/service") - .withName("service").withClientType("dotnet") - .withCustomizedKeys(mapOf("DesiredKey", "fakeTokenPlaceholder"))))) + .getByResourceGroupWithResponse("rg", "testcontainerApp0", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf("tag1", "value1", "tag2", "value2")) + .withConfiguration( + new Configuration() + .withIngress(new Ingress().withExternal(true) + .withTargetPort(3000) + .withTraffic(Arrays.asList(new TrafficWeight() + .withRevisionName("testcontainerApp0-ab1234") + .withWeight(100) + .withLabel("production"))) + .withCustomDomains(Arrays.asList(new CustomDomain() + .withName("www.my-name.com") + .withBindingType(BindingType.SNI_ENABLED) + .withCertificateId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-name-dot-com"), + new CustomDomain().withName("www.my-other-name.com") + .withBindingType(BindingType.SNI_ENABLED) + .withCertificateId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-other-name-dot-com"))) + .withIpSecurityRestrictions( + Arrays + .asList( + new IpSecurityRestrictionRule().withName("Allow work IP A subnet") + .withDescription( + "Allowing all IP's within the subnet below to access containerapp") + .withIpAddressRange("192.168.1.1/32") + .withAction(Action.ALLOW), + new IpSecurityRestrictionRule().withName("Allow work IP B subnet") + .withDescription( + "Allowing all IP's within the subnet below to access containerapp") + .withIpAddressRange("192.168.1.1/8") + .withAction(Action.ALLOW))) + .withStickySessions(new IngressStickySessions().withAffinity(Affinity.STICKY))) + .withDapr(new Dapr() + .withEnabled(true) + .withAppProtocol(AppProtocol.HTTP) + .withAppPort(3000) + .withHttpReadBufferSize(30) + .withHttpMaxRequestSize(10) + .withLogLevel(LogLevel.DEBUG) + .withEnableApiLogging(true)) + .withRuntime(new Runtime().withJava(new RuntimeJava().withEnableMetrics(true) + .withJavaAgent(new RuntimeJavaAgent().withEnabled(true) + .withLogging(new RuntimeJavaAgentLogging().withLoggerSettings(Arrays.asList( + new LoggerSetting().withLogger("org.springframework.boot").withLevel(Level.DEBUG)))))) + .withDotnet(new RuntimeDotnet().withAutoConfigureDataProtection(true))) + .withMaxInactiveRevisions(10) + .withService(new Service().withType("redis"))) + .withTemplate(new Template() + .withInitContainers(Arrays.asList(new InitContainer().withImage("repo/testcontainerApp0:v4") + .withName("testinitcontainerApp0") + .withResources(new ContainerResources().withCpu(0.2D).withMemory("100Mi")))) + .withContainers(Arrays.asList(new Container() + .withImage("repo/testcontainerApp0:v1") + .withName("testcontainerApp0") + .withProbes( + Arrays.asList(new ContainerAppProbe().withHttpGet(new ContainerAppProbeHttpGet() + .withHttpHeaders( + Arrays.asList(new ContainerAppProbeHttpGetHttpHeadersItem().withName("Custom-Header") + .withValue("Awesome"))) + .withPath("/health") + .withPort(8080)).withInitialDelaySeconds(3).withPeriodSeconds(3).withType(Type.LIVENESS))))) + .withScale( + new Scale().withMinReplicas(1) + .withMaxReplicas(5) + .withRules( + Arrays.asList(new ScaleRule().withName("httpscalingrule") + .withCustom(new CustomScaleRule().withType("http") + .withMetadata(mapOf("concurrentRequests", "50")))))) + .withServiceBinds(Arrays.asList(new ServiceBind().withServiceId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/service") + .withName("service") + .withClientType("dotnet") + .withCustomizedKeys(mapOf("DesiredKey", "fakeTokenPlaceholder"))))) .apply(); } @@ -2106,7 +2502,7 @@ import com.azure.resourcemanager.appcontainers.models.UnauthenticatedClientActio public final class ContainerAppsAuthConfigsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/AuthConfigs_CreateOrUpdate. + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/AuthConfigs_CreateOrUpdate. * json */ /** @@ -2116,7 +2512,8 @@ public final class ContainerAppsAuthConfigsCreateOrUpdateSamples { */ public static void createOrUpdateContainerAppAuthConfig(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerAppsAuthConfigs().define("current") + manager.containerAppsAuthConfigs() + .define("current") .withExistingContainerApp("workerapps-rg-xj", "testcanadacentral") .withPlatform(new AuthPlatform().withEnabled(true)) .withGlobalValidation( @@ -2140,7 +2537,7 @@ public final class ContainerAppsAuthConfigsCreateOrUpdateSamples { public final class ContainerAppsAuthConfigsDeleteSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/AuthConfigs_Delete.json + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/AuthConfigs_Delete.json */ /** * Sample code: Delete Container App AuthConfig. @@ -2149,8 +2546,8 @@ public final class ContainerAppsAuthConfigsDeleteSamples { */ public static void deleteContainerAppAuthConfig(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerAppsAuthConfigs().deleteWithResponse("workerapps-rg-xj", "testcanadacentral", "current", - com.azure.core.util.Context.NONE); + manager.containerAppsAuthConfigs() + .deleteWithResponse("workerapps-rg-xj", "testcanadacentral", "current", com.azure.core.util.Context.NONE); } } ``` @@ -2164,7 +2561,7 @@ public final class ContainerAppsAuthConfigsDeleteSamples { public final class ContainerAppsAuthConfigsGetSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/AuthConfigs_Get.json + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/AuthConfigs_Get.json */ /** * Sample code: Get Container App's AuthConfig. @@ -2173,8 +2570,8 @@ public final class ContainerAppsAuthConfigsGetSamples { */ public static void getContainerAppSAuthConfig(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerAppsAuthConfigs().getWithResponse("workerapps-rg-xj", "testcanadacentral", "current", - com.azure.core.util.Context.NONE); + manager.containerAppsAuthConfigs() + .getWithResponse("workerapps-rg-xj", "testcanadacentral", "current", com.azure.core.util.Context.NONE); } } ``` @@ -2188,7 +2585,7 @@ public final class ContainerAppsAuthConfigsGetSamples { public final class ContainerAppsAuthConfigsListByContainerAppSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/AuthConfigs_ListByContainer. + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/AuthConfigs_ListByContainer. * json */ /** @@ -2198,8 +2595,78 @@ public final class ContainerAppsAuthConfigsListByContainerAppSamples { */ public static void listAuthConfigsByContainerApps(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerAppsAuthConfigs().listByContainerApp("workerapps-rg-xj", "testcanadacentral", - com.azure.core.util.Context.NONE); + manager.containerAppsAuthConfigs() + .listByContainerApp("workerapps-rg-xj", "testcanadacentral", com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerAppsBuilds_Delete + +```java +/** + * Samples for ContainerAppsBuilds Delete. + */ +public final class ContainerAppsBuildsDeleteSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ContainerAppsBuilds_Delete. + * json + */ + /** + * Sample code: ContainerAppsBuilds_Delete_0. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + containerAppsBuildsDelete0(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppsBuilds().delete("rg", "testCapp", "testBuild", com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerAppsBuilds_Get + +```java +/** + * Samples for ContainerAppsBuilds Get. + */ +public final class ContainerAppsBuildsGetSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ContainerAppsBuilds_Get.json + */ + /** + * Sample code: ContainerAppsBuilds_Get_0. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + containerAppsBuildsGet0(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppsBuilds().getWithResponse("rg", "testCapp", "testBuild", com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerAppsBuildsByContainerApp_List + +```java +/** + * Samples for ContainerAppsBuildsByContainerApp List. + */ +public final class ContainerAppsBuildsByContainerAppListSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ + * ContainerAppsBuilds_ListByContainerApp.json + */ + /** + * Sample code: ContainerAppsBuilds_ListByContainerApp_0. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void containerAppsBuildsListByContainerApp0( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppsBuildsByContainerApps().list("rg", "testCapp", com.azure.core.util.Context.NONE); } } ``` @@ -2213,7 +2680,7 @@ public final class ContainerAppsAuthConfigsListByContainerAppSamples { public final class ContainerAppsDiagnosticsGetDetectorSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ContainerAppsDiagnostics_Get + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ContainerAppsDiagnostics_Get * .json */ /** @@ -2223,8 +2690,9 @@ public final class ContainerAppsDiagnosticsGetDetectorSamples { */ public static void getContainerAppSDiagnosticsInfo(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerAppsDiagnostics().getDetectorWithResponse("mikono-workerapp-test-rg", "mikono-capp-stage1", - "cappcontainerappnetworkIO", com.azure.core.util.Context.NONE); + manager.containerAppsDiagnostics() + .getDetectorWithResponse("mikono-workerapp-test-rg", "mikono-capp-stage1", "cappcontainerappnetworkIO", + com.azure.core.util.Context.NONE); } } ``` @@ -2238,7 +2706,7 @@ public final class ContainerAppsDiagnosticsGetDetectorSamples { public final class ContainerAppsDiagnosticsGetRevisionSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Revisions_Get.json + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/Revisions_Get.json */ /** * Sample code: Get Container App's revision. @@ -2247,8 +2715,9 @@ public final class ContainerAppsDiagnosticsGetRevisionSamples { */ public static void getContainerAppSRevision(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerAppsDiagnostics().getRevisionWithResponse("rg", "testcontainerApp0", - "testcontainerApp0-pjxhsye", com.azure.core.util.Context.NONE); + manager.containerAppsDiagnostics() + .getRevisionWithResponse("rg", "testcontainerApp0", "testcontainerApp0-pjxhsye", + com.azure.core.util.Context.NONE); } } ``` @@ -2262,7 +2731,7 @@ public final class ContainerAppsDiagnosticsGetRevisionSamples { public final class ContainerAppsDiagnosticsGetRootSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ContainerApps_Get.json + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ContainerApps_Get.json */ /** * Sample code: Get Container App. @@ -2270,8 +2739,8 @@ public final class ContainerAppsDiagnosticsGetRootSamples { * @param manager Entry point to ContainerAppsApiManager. */ public static void getContainerApp(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerAppsDiagnostics().getRootWithResponse("rg", "testcontainerApp0", - com.azure.core.util.Context.NONE); + manager.containerAppsDiagnostics() + .getRootWithResponse("rg", "testcontainerApp0", com.azure.core.util.Context.NONE); } } ``` @@ -2284,7 +2753,7 @@ public final class ContainerAppsDiagnosticsGetRootSamples { */ public final class ContainerAppsDiagnosticsListDetectorsSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * ContainerAppsDiagnostics_List.json */ /** @@ -2294,8 +2763,8 @@ public final class ContainerAppsDiagnosticsListDetectorsSamples { */ public static void getTheListOfAvailableDiagnosticsForAGivenContainerApp( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerAppsDiagnostics().listDetectors("mikono-workerapp-test-rg", "mikono-capp-stage1", - com.azure.core.util.Context.NONE); + manager.containerAppsDiagnostics() + .listDetectors("mikono-workerapp-test-rg", "mikono-capp-stage1", com.azure.core.util.Context.NONE); } } ``` @@ -2309,7 +2778,7 @@ public final class ContainerAppsDiagnosticsListDetectorsSamples { public final class ContainerAppsDiagnosticsListRevisionsSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Revisions_List.json + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/Revisions_List.json */ /** * Sample code: List Container App's revisions. @@ -2318,8 +2787,131 @@ public final class ContainerAppsDiagnosticsListRevisionsSamples { */ public static void listContainerAppSRevisions(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerAppsDiagnostics().listRevisions("rg", "testcontainerApp0", null, - com.azure.core.util.Context.NONE); + manager.containerAppsDiagnostics() + .listRevisions("rg", "testcontainerApp0", null, com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerAppsPatches_Apply + +```java +/** + * Samples for ContainerAppsPatches Apply. + */ +public final class ContainerAppsPatchesApplySamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ContainerAppsPatches_Apply. + * json + */ + /** + * Sample code: ContainerAppsPatches_Apply_0. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + containerAppsPatchesApply0(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppsPatches().apply("rg", "test-app", "testPatch-25fe4b", com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerAppsPatches_Delete + +```java +/** + * Samples for ContainerAppsPatches Delete. + */ +public final class ContainerAppsPatchesDeleteSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ContainerAppsPatches_Delete. + * json + */ + /** + * Sample code: ContainerAppsPatches_Delete_0. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + containerAppsPatchesDelete0(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppsPatches().delete("rg", "test-app", "testPatch-25fe4b", com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerAppsPatches_Get + +```java +/** + * Samples for ContainerAppsPatches Get. + */ +public final class ContainerAppsPatchesGetSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ContainerAppsPatches_Get. + * json + */ + /** + * Sample code: ContainerAppsPatches_Get_0. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + containerAppsPatchesGet0(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppsPatches() + .getWithResponse("rg", "test-app", "testPatch-25fe4b", com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerAppsPatches_ListByContainerApp + +```java +/** + * Samples for ContainerAppsPatches ListByContainerApp. + */ +public final class ContainerAppsPatchesListByContainerAppSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ + * ContainerAppsPatches_ListByContainerApp.json + */ + /** + * Sample code: ContainerAppsPatches_ListByContainerApp_0. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void containerAppsPatchesListByContainerApp0( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppsPatches().listByContainerApp("rg", "test-app", null, com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerAppsPatches_SkipConfigure + +```java +import com.azure.resourcemanager.appcontainers.models.PatchSkipConfig; + +/** + * Samples for ContainerAppsPatches SkipConfigure. + */ +public final class ContainerAppsPatchesSkipConfigureSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ + * ContainerAppsPatches_Skip_Configure.json + */ + /** + * Sample code: ContainerAppsPatches_Skip_Configure_0. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + containerAppsPatchesSkipConfigure0(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppsPatches() + .skipConfigure("rg", "test-app", "testPatch-25fe4b", new PatchSkipConfig().withSkip(true), + com.azure.core.util.Context.NONE); } } ``` @@ -2333,7 +2925,7 @@ public final class ContainerAppsDiagnosticsListRevisionsSamples { public final class ContainerAppsRevisionReplicasGetReplicaSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Replicas_Get.json + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/Replicas_Get.json */ /** * Sample code: Get Container App's revision replica. @@ -2342,8 +2934,9 @@ public final class ContainerAppsRevisionReplicasGetReplicaSamples { */ public static void getContainerAppSRevisionReplica(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerAppsRevisionReplicas().getReplicaWithResponse("workerapps-rg-xj", "myapp", "myapp--0wlqy09", - "myapp--0wlqy09-5d9774cff-5wnd8", com.azure.core.util.Context.NONE); + manager.containerAppsRevisionReplicas() + .getReplicaWithResponse("workerapps-rg-xj", "myapp", "myapp--0wlqy09", "myapp--0wlqy09-5d9774cff-5wnd8", + com.azure.core.util.Context.NONE); } } ``` @@ -2357,7 +2950,7 @@ public final class ContainerAppsRevisionReplicasGetReplicaSamples { public final class ContainerAppsRevisionReplicasListReplicasSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Replicas_List.json + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/Replicas_List.json */ /** * Sample code: List Container App's replicas. @@ -2366,8 +2959,8 @@ public final class ContainerAppsRevisionReplicasListReplicasSamples { */ public static void listContainerAppSReplicas(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerAppsRevisionReplicas().listReplicasWithResponse("workerapps-rg-xj", "myapp", "myapp--0wlqy09", - com.azure.core.util.Context.NONE); + manager.containerAppsRevisionReplicas() + .listReplicasWithResponse("workerapps-rg-xj", "myapp", "myapp--0wlqy09", com.azure.core.util.Context.NONE); } } ``` @@ -2381,7 +2974,7 @@ public final class ContainerAppsRevisionReplicasListReplicasSamples { public final class ContainerAppsRevisionsActivateRevisionSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Revisions_Activate.json + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/Revisions_Activate.json */ /** * Sample code: Activate Container App's revision. @@ -2390,8 +2983,9 @@ public final class ContainerAppsRevisionsActivateRevisionSamples { */ public static void activateContainerAppSRevision(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerAppsRevisions().activateRevisionWithResponse("rg", "testcontainerApp0", - "testcontainerApp0-pjxhsye", com.azure.core.util.Context.NONE); + manager.containerAppsRevisions() + .activateRevisionWithResponse("rg", "testcontainerApp0", "testcontainerApp0-pjxhsye", + com.azure.core.util.Context.NONE); } } ``` @@ -2405,7 +2999,7 @@ public final class ContainerAppsRevisionsActivateRevisionSamples { public final class ContainerAppsRevisionsDeactivateRevisionSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Revisions_Deactivate.json + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/Revisions_Deactivate.json */ /** * Sample code: Deactivate Container App's revision. @@ -2414,8 +3008,9 @@ public final class ContainerAppsRevisionsDeactivateRevisionSamples { */ public static void deactivateContainerAppSRevision(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerAppsRevisions().deactivateRevisionWithResponse("rg", "testcontainerApp0", - "testcontainerApp0-pjxhsye", com.azure.core.util.Context.NONE); + manager.containerAppsRevisions() + .deactivateRevisionWithResponse("rg", "testcontainerApp0", "testcontainerApp0-pjxhsye", + com.azure.core.util.Context.NONE); } } ``` @@ -2429,7 +3024,7 @@ public final class ContainerAppsRevisionsDeactivateRevisionSamples { public final class ContainerAppsRevisionsGetRevisionSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Revisions_Get.json + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/Revisions_Get.json */ /** * Sample code: Get Container App's revision. @@ -2438,8 +3033,9 @@ public final class ContainerAppsRevisionsGetRevisionSamples { */ public static void getContainerAppSRevision(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerAppsRevisions().getRevisionWithResponse("rg", "testcontainerApp0", "testcontainerApp0-pjxhsye", - com.azure.core.util.Context.NONE); + manager.containerAppsRevisions() + .getRevisionWithResponse("rg", "testcontainerApp0", "testcontainerApp0-pjxhsye", + com.azure.core.util.Context.NONE); } } ``` @@ -2453,7 +3049,7 @@ public final class ContainerAppsRevisionsGetRevisionSamples { public final class ContainerAppsRevisionsListRevisionsSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Revisions_List.json + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/Revisions_List.json */ /** * Sample code: List Container App's revisions. @@ -2462,8 +3058,8 @@ public final class ContainerAppsRevisionsListRevisionsSamples { */ public static void listContainerAppSRevisions(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerAppsRevisions().listRevisions("rg", "testcontainerApp0", null, - com.azure.core.util.Context.NONE); + manager.containerAppsRevisions() + .listRevisions("rg", "testcontainerApp0", null, com.azure.core.util.Context.NONE); } } ``` @@ -2477,7 +3073,7 @@ public final class ContainerAppsRevisionsListRevisionsSamples { public final class ContainerAppsRevisionsRestartRevisionSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Revisions_Restart.json + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/Revisions_Restart.json */ /** * Sample code: Restart Container App's revision. @@ -2486,28 +3082,229 @@ public final class ContainerAppsRevisionsRestartRevisionSamples { */ public static void restartContainerAppSRevision(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerAppsRevisions().restartRevisionWithResponse("rg", "testStaticSite0", - "testcontainerApp0-pjxhsye", com.azure.core.util.Context.NONE); + manager.containerAppsRevisions() + .restartRevisionWithResponse("rg", "testStaticSite0", "testcontainerApp0-pjxhsye", + com.azure.core.util.Context.NONE); } } ``` -### ContainerAppsSourceControls_CreateOrUpdate +### ContainerAppsSessionPools_CreateOrUpdate ```java -import com.azure.resourcemanager.appcontainers.models.AzureCredentials; -import com.azure.resourcemanager.appcontainers.models.EnvironmentVariable; -import com.azure.resourcemanager.appcontainers.models.GithubActionConfiguration; -import com.azure.resourcemanager.appcontainers.models.RegistryInfo; +import com.azure.resourcemanager.appcontainers.models.ContainerType; +import com.azure.resourcemanager.appcontainers.models.CustomContainerTemplate; +import com.azure.resourcemanager.appcontainers.models.DynamicPoolConfiguration; +import com.azure.resourcemanager.appcontainers.models.ExecutionType; +import com.azure.resourcemanager.appcontainers.models.PoolManagementType; +import com.azure.resourcemanager.appcontainers.models.ScaleConfiguration; +import com.azure.resourcemanager.appcontainers.models.SessionContainer; +import com.azure.resourcemanager.appcontainers.models.SessionContainerResources; +import com.azure.resourcemanager.appcontainers.models.SessionIngress; +import com.azure.resourcemanager.appcontainers.models.SessionNetworkConfiguration; +import com.azure.resourcemanager.appcontainers.models.SessionNetworkStatus; import java.util.Arrays; /** - * Samples for ContainerAppsSourceControls CreateOrUpdate. + * Samples for ContainerAppsSessionPools CreateOrUpdate. */ -public final class ContainerAppsSourceControlsCreateOrUpdateSamples { +public final class ContainerAppsSessionPoolsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ - * SourceControls_CreateOrUpdate.json + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/SessionPools_CreateOrUpdate. + * json + */ + /** + * Sample code: Create or Update Session Pool. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + createOrUpdateSessionPool(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppsSessionPools() + .define("testsessionpool") + .withRegion("East US") + .withExistingResourceGroup("rg") + .withEnvironmentId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube") + .withContainerType(ContainerType.CUSTOM_CONTAINER) + .withPoolManagementType(PoolManagementType.DYNAMIC) + .withScaleConfiguration( + new ScaleConfiguration().withMaxConcurrentSessions(500).withReadySessionInstances(100)) + .withDynamicPoolConfiguration( + new DynamicPoolConfiguration().withExecutionType(ExecutionType.TIMED).withCooldownPeriodInSeconds(600)) + .withCustomContainerTemplate(new CustomContainerTemplate() + .withContainers(Arrays.asList(new SessionContainer().withImage("repo/testcontainer:v4") + .withName("testinitcontainer") + .withCommand(Arrays.asList("/bin/sh")) + .withArgs(Arrays.asList("-c", "while true; do echo hello; sleep 10;done")) + .withResources(new SessionContainerResources().withCpu(0.25D).withMemory("0.5Gi")))) + .withIngress(new SessionIngress().withTargetPort(80))) + .withSessionNetworkConfiguration( + new SessionNetworkConfiguration().withStatus(SessionNetworkStatus.EGRESS_ENABLED)) + .create(); + } +} +``` + +### ContainerAppsSessionPools_Delete + +```java +/** + * Samples for ContainerAppsSessionPools Delete. + */ +public final class ContainerAppsSessionPoolsDeleteSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/SessionPools_Delete.json + */ + /** + * Sample code: Delete Session Pool. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void deleteSessionPool(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppsSessionPools().delete("rg", "testsessionpool", com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerAppsSessionPools_GetByResourceGroup + +```java +/** + * Samples for ContainerAppsSessionPools GetByResourceGroup. + */ +public final class ContainerAppsSessionPoolsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/SessionPools_Get.json + */ + /** + * Sample code: Get Session Pool. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void getSessionPool(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppsSessionPools() + .getByResourceGroupWithResponse("rg", "testsessionpool", com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerAppsSessionPools_List + +```java +/** + * Samples for ContainerAppsSessionPools List. + */ +public final class ContainerAppsSessionPoolsListSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ + * SessionPools_ListBySubscription.json + */ + /** + * Sample code: List Session Pools by subscription. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + listSessionPoolsBySubscription(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppsSessionPools().list(com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerAppsSessionPools_ListByResourceGroup + +```java +/** + * Samples for ContainerAppsSessionPools ListByResourceGroup. + */ +public final class ContainerAppsSessionPoolsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ + * SessionPools_ListByResourceGroup.json + */ + /** + * Sample code: List Session Pools by resource group. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + listSessionPoolsByResourceGroup(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppsSessionPools().listByResourceGroup("rg", com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerAppsSessionPools_Update + +```java +import com.azure.resourcemanager.appcontainers.models.CustomContainerTemplate; +import com.azure.resourcemanager.appcontainers.models.DynamicPoolConfiguration; +import com.azure.resourcemanager.appcontainers.models.ExecutionType; +import com.azure.resourcemanager.appcontainers.models.ScaleConfiguration; +import com.azure.resourcemanager.appcontainers.models.SessionContainer; +import com.azure.resourcemanager.appcontainers.models.SessionContainerResources; +import com.azure.resourcemanager.appcontainers.models.SessionIngress; +import com.azure.resourcemanager.appcontainers.models.SessionNetworkConfiguration; +import com.azure.resourcemanager.appcontainers.models.SessionNetworkStatus; +import com.azure.resourcemanager.appcontainers.models.SessionPool; +import java.util.Arrays; + +/** + * Samples for ContainerAppsSessionPools Update. + */ +public final class ContainerAppsSessionPoolsUpdateSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/SessionPools_Patch.json + */ + /** + * Sample code: Update Session Pool. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void updateSessionPool(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + SessionPool resource = manager.containerAppsSessionPools() + .getByResourceGroupWithResponse("rg", "testsessionpool", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withScaleConfiguration( + new ScaleConfiguration().withMaxConcurrentSessions(500).withReadySessionInstances(100)) + .withDynamicPoolConfiguration( + new DynamicPoolConfiguration().withExecutionType(ExecutionType.TIMED).withCooldownPeriodInSeconds(600)) + .withCustomContainerTemplate(new CustomContainerTemplate() + .withContainers(Arrays.asList(new SessionContainer().withImage("repo/testcontainer:v4") + .withName("testinitcontainer") + .withCommand(Arrays.asList("/bin/sh")) + .withArgs(Arrays.asList("-c", "while true; do echo hello; sleep 10;done")) + .withResources(new SessionContainerResources().withCpu(0.25D).withMemory("0.5Gi")))) + .withIngress(new SessionIngress().withTargetPort(80))) + .withSessionNetworkConfiguration( + new SessionNetworkConfiguration().withStatus(SessionNetworkStatus.EGRESS_ENABLED)) + .apply(); + } +} +``` + +### ContainerAppsSourceControls_CreateOrUpdate + +```java +import com.azure.resourcemanager.appcontainers.models.AzureCredentials; +import com.azure.resourcemanager.appcontainers.models.EnvironmentVariable; +import com.azure.resourcemanager.appcontainers.models.GithubActionConfiguration; +import com.azure.resourcemanager.appcontainers.models.RegistryInfo; +import java.util.Arrays; + +/** + * Samples for ContainerAppsSourceControls CreateOrUpdate. + */ +public final class ContainerAppsSourceControlsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ + * SourceControls_CreateOrUpdate.json */ /** * Sample code: Create or Update Container App SourceControl. @@ -2516,15 +3313,22 @@ public final class ContainerAppsSourceControlsCreateOrUpdateSamples { */ public static void createOrUpdateContainerAppSourceControl( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerAppsSourceControls().define("current") + manager.containerAppsSourceControls() + .define("current") .withExistingContainerApp("workerapps-rg-xj", "testcanadacentral") - .withRepoUrl("https://github.com/xwang971/ghatest").withBranch("master") + .withRepoUrl("https://github.com/xwang971/ghatest") + .withBranch("master") .withGithubActionConfiguration(new GithubActionConfiguration() .withRegistryInfo(new RegistryInfo().withRegistryUrl("test-registry.azurecr.io") - .withRegistryUsername("test-registry").withRegistryPassword("fakeTokenPlaceholder")) + .withRegistryUsername("test-registry") + .withRegistryPassword("fakeTokenPlaceholder")) .withAzureCredentials(new AzureCredentials().withClientId("") - .withClientSecret("fakeTokenPlaceholder").withTenantId("").withKind("feaderated")) - .withContextPath("./").withGithubPersonalAccessToken("fakeTokenPlaceholder").withImage("image/tag") + .withClientSecret("fakeTokenPlaceholder") + .withTenantId("") + .withKind("feaderated")) + .withContextPath("./") + .withGithubPersonalAccessToken("fakeTokenPlaceholder") + .withImage("image/tag") .withBuildEnvironmentVariables( Arrays.asList(new EnvironmentVariable().withName("foo1").withValue("bar1"), new EnvironmentVariable().withName("foo2").withValue("bar2")))) @@ -2542,7 +3346,7 @@ public final class ContainerAppsSourceControlsCreateOrUpdateSamples { public final class ContainerAppsSourceControlsDeleteSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/SourceControls_Delete.json + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/SourceControls_Delete.json */ /** * Sample code: Delete Container App SourceControl. @@ -2551,8 +3355,8 @@ public final class ContainerAppsSourceControlsDeleteSamples { */ public static void deleteContainerAppSourceControl(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerAppsSourceControls().delete("workerapps-rg-xj", "testcanadacentral", "current", - com.azure.core.util.Context.NONE); + manager.containerAppsSourceControls() + .delete("workerapps-rg-xj", "testcanadacentral", "current", com.azure.core.util.Context.NONE); } } ``` @@ -2566,7 +3370,7 @@ public final class ContainerAppsSourceControlsDeleteSamples { public final class ContainerAppsSourceControlsGetSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/SourceControls_Get.json + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/SourceControls_Get.json */ /** * Sample code: Get Container App's SourceControl. @@ -2575,8 +3379,8 @@ public final class ContainerAppsSourceControlsGetSamples { */ public static void getContainerAppSSourceControl(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerAppsSourceControls().getWithResponse("workerapps-rg-xj", "testcanadacentral", "current", - com.azure.core.util.Context.NONE); + manager.containerAppsSourceControls() + .getWithResponse("workerapps-rg-xj", "testcanadacentral", "current", com.azure.core.util.Context.NONE); } } ``` @@ -2589,7 +3393,7 @@ public final class ContainerAppsSourceControlsGetSamples { */ public final class ContainerAppsSourceControlsListByContainerAppSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * SourceControls_ListByContainer.json */ /** @@ -2598,8 +3402,8 @@ public final class ContainerAppsSourceControlsListByContainerAppSamples { * @param manager Entry point to ContainerAppsApiManager. */ public static void listAppSSourceControls(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerAppsSourceControls().listByContainerApp("workerapps-rg-xj", "testcanadacentral", - com.azure.core.util.Context.NONE); + manager.containerAppsSourceControls() + .listByContainerApp("workerapps-rg-xj", "testcanadacentral", com.azure.core.util.Context.NONE); } } ``` @@ -2618,7 +3422,7 @@ import com.azure.resourcemanager.appcontainers.models.DaprComponentResiliencyPol */ public final class DaprComponentResiliencyPoliciesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * DaprComponentResiliencyPolicy_CreateOrUpdate_OutboundOnly.json */ /** @@ -2628,21 +3432,25 @@ public final class DaprComponentResiliencyPoliciesCreateOrUpdateSamples { */ public static void createOrUpdateDaprComponentResiliencyPolicyWithOutboundPolicyOnly( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.daprComponentResiliencyPolicies().define("myresiliencypolicy") + manager.daprComponentResiliencyPolicies() + .define("myresiliencypolicy") .withExistingDaprComponent("examplerg", "myenvironment", "mydaprcomponent") .withOutboundPolicy(new DaprComponentResiliencyPolicyConfiguration() .withHttpRetryPolicy(new DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration().withMaxRetries(5) .withRetryBackOff(new DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration() - .withInitialDelayInMilliseconds(100).withMaxIntervalInMilliseconds(30000))) + .withInitialDelayInMilliseconds(100) + .withMaxIntervalInMilliseconds(30000))) .withTimeoutPolicy( new DaprComponentResiliencyPolicyTimeoutPolicyConfiguration().withResponseTimeoutInSeconds(12)) - .withCircuitBreakerPolicy(new DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration() - .withConsecutiveErrors(3).withTimeoutInSeconds(20).withIntervalInSeconds(60))) + .withCircuitBreakerPolicy( + new DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration().withConsecutiveErrors(3) + .withTimeoutInSeconds(20) + .withIntervalInSeconds(60))) .create(); } /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * DaprComponentResiliencyPolicy_CreateOrUpdate_AllOptions.json */ /** @@ -2652,29 +3460,36 @@ public final class DaprComponentResiliencyPoliciesCreateOrUpdateSamples { */ public static void createOrUpdateDaprComponentResiliencyPolicyWithAllOptions( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.daprComponentResiliencyPolicies().define("myresiliencypolicy") + manager.daprComponentResiliencyPolicies() + .define("myresiliencypolicy") .withExistingDaprComponent("examplerg", "myenvironment", "mydaprcomponent") .withInboundPolicy(new DaprComponentResiliencyPolicyConfiguration() .withHttpRetryPolicy(new DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration().withMaxRetries(15) .withRetryBackOff(new DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration() - .withInitialDelayInMilliseconds(2000).withMaxIntervalInMilliseconds(5500))) + .withInitialDelayInMilliseconds(2000) + .withMaxIntervalInMilliseconds(5500))) .withTimeoutPolicy( new DaprComponentResiliencyPolicyTimeoutPolicyConfiguration().withResponseTimeoutInSeconds(30)) - .withCircuitBreakerPolicy(new DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration() - .withConsecutiveErrors(5).withTimeoutInSeconds(10).withIntervalInSeconds(4))) + .withCircuitBreakerPolicy( + new DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration().withConsecutiveErrors(5) + .withTimeoutInSeconds(10) + .withIntervalInSeconds(4))) .withOutboundPolicy(new DaprComponentResiliencyPolicyConfiguration() .withHttpRetryPolicy(new DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration().withMaxRetries(5) .withRetryBackOff(new DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration() - .withInitialDelayInMilliseconds(100).withMaxIntervalInMilliseconds(30000))) + .withInitialDelayInMilliseconds(100) + .withMaxIntervalInMilliseconds(30000))) .withTimeoutPolicy( new DaprComponentResiliencyPolicyTimeoutPolicyConfiguration().withResponseTimeoutInSeconds(12)) - .withCircuitBreakerPolicy(new DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration() - .withConsecutiveErrors(3).withTimeoutInSeconds(20).withIntervalInSeconds(60))) + .withCircuitBreakerPolicy( + new DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration().withConsecutiveErrors(3) + .withTimeoutInSeconds(20) + .withIntervalInSeconds(60))) .create(); } /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * DaprComponentResiliencyPolicy_CreateOrUpdate_SparseOptions.json */ /** @@ -2684,14 +3499,17 @@ public final class DaprComponentResiliencyPoliciesCreateOrUpdateSamples { */ public static void createOrUpdateDaprComponentResiliencyPolicyWithSparseOptions( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.daprComponentResiliencyPolicies().define("myresiliencypolicy") + manager.daprComponentResiliencyPolicies() + .define("myresiliencypolicy") .withExistingDaprComponent("examplerg", "myenvironment", "mydaprcomponent") .withInboundPolicy(new DaprComponentResiliencyPolicyConfiguration() .withHttpRetryPolicy(new DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration().withMaxRetries(5) .withRetryBackOff(new DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration() - .withInitialDelayInMilliseconds(2000).withMaxIntervalInMilliseconds(5500))) - .withCircuitBreakerPolicy(new DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration() - .withConsecutiveErrors(3).withTimeoutInSeconds(20))) + .withInitialDelayInMilliseconds(2000) + .withMaxIntervalInMilliseconds(5500))) + .withCircuitBreakerPolicy( + new DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration().withConsecutiveErrors(3) + .withTimeoutInSeconds(20))) .withOutboundPolicy(new DaprComponentResiliencyPolicyConfiguration().withTimeoutPolicy( new DaprComponentResiliencyPolicyTimeoutPolicyConfiguration().withResponseTimeoutInSeconds(12))) .create(); @@ -2707,7 +3525,7 @@ public final class DaprComponentResiliencyPoliciesCreateOrUpdateSamples { */ public final class DaprComponentResiliencyPoliciesDeleteSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * DaprComponentResiliencyPolicies_Delete.json */ /** @@ -2717,8 +3535,9 @@ public final class DaprComponentResiliencyPoliciesDeleteSamples { */ public static void deleteDaprComponentResiliencyPolicy(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.daprComponentResiliencyPolicies().deleteWithResponse("examplerg", "myenvironment", "mydaprcomponent", - "myresiliencypolicy", com.azure.core.util.Context.NONE); + manager.daprComponentResiliencyPolicies() + .deleteWithResponse("examplerg", "myenvironment", "mydaprcomponent", "myresiliencypolicy", + com.azure.core.util.Context.NONE); } } ``` @@ -2731,7 +3550,7 @@ public final class DaprComponentResiliencyPoliciesDeleteSamples { */ public final class DaprComponentResiliencyPoliciesGetSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * DaprComponentResiliencyPolicies_Get.json */ /** @@ -2741,8 +3560,9 @@ public final class DaprComponentResiliencyPoliciesGetSamples { */ public static void getDaprComponentResiliencyPolicy(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.daprComponentResiliencyPolicies().getWithResponse("examplerg", "myenvironment", "mydaprcomponent", - "myresiliencypolicy", com.azure.core.util.Context.NONE); + manager.daprComponentResiliencyPolicies() + .getWithResponse("examplerg", "myenvironment", "mydaprcomponent", "myresiliencypolicy", + com.azure.core.util.Context.NONE); } } ``` @@ -2755,7 +3575,7 @@ public final class DaprComponentResiliencyPoliciesGetSamples { */ public final class DaprComponentResiliencyPoliciesListSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * DaprComponentResiliencyPolicies_List.json */ /** @@ -2765,8 +3585,8 @@ public final class DaprComponentResiliencyPoliciesListSamples { */ public static void listDaprComponentResiliencyPolicies(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.daprComponentResiliencyPolicies().list("examplerg", "myenvironment", "mydaprcomponent", - com.azure.core.util.Context.NONE); + manager.daprComponentResiliencyPolicies() + .list("examplerg", "myenvironment", "mydaprcomponent", com.azure.core.util.Context.NONE); } } ``` @@ -2786,7 +3606,7 @@ import java.util.Arrays; */ public final class DaprComponentsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * DaprComponents_CreateOrUpdate_Secrets.json */ /** @@ -2796,25 +3616,28 @@ public final class DaprComponentsCreateOrUpdateSamples { */ public static void createOrUpdateDaprComponentWithSecrets( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.daprComponents().createOrUpdateWithResponse("examplerg", "myenvironment", "reddog", - new DaprComponentInner().withComponentType("state.azure.cosmosdb").withVersion("v1").withIgnoreErrors(false) - .withInitTimeout("50s") - .withSecrets(Arrays.asList(new Secret().withName("masterkey").withValue("keyvalue"))) - .withMetadata(Arrays.asList(new DaprMetadata().withName("url").withValue(""), - new DaprMetadata().withName("database").withValue("itemsDB"), - new DaprMetadata().withName("collection").withValue("items"), - new DaprMetadata().withName("masterkey").withSecretRef("fakeTokenPlaceholder"))) - .withScopes(Arrays.asList("container-app-1", "container-app-2")) - .withServiceComponentBind(Arrays.asList(new DaprComponentServiceBinding().withName("statestore") - .withServiceId( - "/subscriptions/9f7371f1-b593-4c3c-84e2-9167806ad358/resourceGroups/ca-syn2-group/providers/Microsoft.App/containerapps/cappredis") - .withMetadata( - new DaprServiceBindMetadata().withName("daprcomponentBind").withValue("redis-bind")))), - com.azure.core.util.Context.NONE); + manager.daprComponents() + .createOrUpdateWithResponse("examplerg", "myenvironment", "reddog", + new DaprComponentInner().withComponentType("state.azure.cosmosdb") + .withVersion("v1") + .withIgnoreErrors(false) + .withInitTimeout("50s") + .withSecrets(Arrays.asList(new Secret().withName("masterkey").withValue("keyvalue"))) + .withMetadata(Arrays.asList(new DaprMetadata().withName("url").withValue(""), + new DaprMetadata().withName("database").withValue("itemsDB"), + new DaprMetadata().withName("collection").withValue("items"), + new DaprMetadata().withName("masterkey").withSecretRef("fakeTokenPlaceholder"))) + .withScopes(Arrays.asList("container-app-1", "container-app-2")) + .withServiceComponentBind(Arrays.asList(new DaprComponentServiceBinding().withName("statestore") + .withServiceId( + "/subscriptions/9f7371f1-b593-4c3c-84e2-9167806ad358/resourceGroups/ca-syn2-group/providers/Microsoft.App/containerapps/cappredis") + .withMetadata( + new DaprServiceBindMetadata().withName("daprcomponentBind").withValue("redis-bind")))), + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * DaprComponents_CreateOrUpdate_SecretStoreComponent.json */ /** @@ -2824,20 +3647,24 @@ public final class DaprComponentsCreateOrUpdateSamples { */ public static void createOrUpdateDaprComponentWithSecretStoreComponent( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.daprComponents().createOrUpdateWithResponse("examplerg", "myenvironment", "reddog", - new DaprComponentInner().withComponentType("state.azure.cosmosdb").withVersion("v1").withIgnoreErrors(false) - .withInitTimeout("50s").withSecretStoreComponent("fakeTokenPlaceholder") - .withMetadata(Arrays.asList(new DaprMetadata().withName("url").withValue(""), - new DaprMetadata().withName("database").withValue("itemsDB"), - new DaprMetadata().withName("collection").withValue("items"), - new DaprMetadata().withName("masterkey").withSecretRef("fakeTokenPlaceholder"))) - .withScopes(Arrays.asList("container-app-1", "container-app-2")) - .withServiceComponentBind(Arrays.asList(new DaprComponentServiceBinding().withName("statestore") - .withServiceId( - "/subscriptions/9f7371f1-b593-4c3c-84e2-9167806ad358/resourceGroups/ca-syn2-group/providers/Microsoft.App/containerapps/cappredis") - .withMetadata( - new DaprServiceBindMetadata().withName("daprcomponentBind").withValue("redis-bind")))), - com.azure.core.util.Context.NONE); + manager.daprComponents() + .createOrUpdateWithResponse("examplerg", "myenvironment", "reddog", + new DaprComponentInner().withComponentType("state.azure.cosmosdb") + .withVersion("v1") + .withIgnoreErrors(false) + .withInitTimeout("50s") + .withSecretStoreComponent("fakeTokenPlaceholder") + .withMetadata(Arrays.asList(new DaprMetadata().withName("url").withValue(""), + new DaprMetadata().withName("database").withValue("itemsDB"), + new DaprMetadata().withName("collection").withValue("items"), + new DaprMetadata().withName("masterkey").withSecretRef("fakeTokenPlaceholder"))) + .withScopes(Arrays.asList("container-app-1", "container-app-2")) + .withServiceComponentBind(Arrays.asList(new DaprComponentServiceBinding().withName("statestore") + .withServiceId( + "/subscriptions/9f7371f1-b593-4c3c-84e2-9167806ad358/resourceGroups/ca-syn2-group/providers/Microsoft.App/containerapps/cappredis") + .withMetadata( + new DaprServiceBindMetadata().withName("daprcomponentBind").withValue("redis-bind")))), + com.azure.core.util.Context.NONE); } } ``` @@ -2851,7 +3678,7 @@ public final class DaprComponentsCreateOrUpdateSamples { public final class DaprComponentsDeleteSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DaprComponents_Delete.json + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/DaprComponents_Delete.json */ /** * Sample code: Delete dapr component. @@ -2859,8 +3686,8 @@ public final class DaprComponentsDeleteSamples { * @param manager Entry point to ContainerAppsApiManager. */ public static void deleteDaprComponent(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.daprComponents().deleteWithResponse("examplerg", "myenvironment", "reddog", - com.azure.core.util.Context.NONE); + manager.daprComponents() + .deleteWithResponse("examplerg", "myenvironment", "reddog", com.azure.core.util.Context.NONE); } } ``` @@ -2873,7 +3700,7 @@ public final class DaprComponentsDeleteSamples { */ public final class DaprComponentsGetSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * DaprComponents_Get_SecretStoreComponent.json */ /** @@ -2883,13 +3710,13 @@ public final class DaprComponentsGetSamples { */ public static void getDaprComponentWithSecretStoreComponent( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.daprComponents().getWithResponse("examplerg", "myenvironment", "reddog", - com.azure.core.util.Context.NONE); + manager.daprComponents() + .getWithResponse("examplerg", "myenvironment", "reddog", com.azure.core.util.Context.NONE); } /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DaprComponents_Get_Secrets. + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/DaprComponents_Get_Secrets. * json */ /** @@ -2899,8 +3726,8 @@ public final class DaprComponentsGetSamples { */ public static void getDaprComponentWithSecrets(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.daprComponents().getWithResponse("examplerg", "myenvironment", "reddog", - com.azure.core.util.Context.NONE); + manager.daprComponents() + .getWithResponse("examplerg", "myenvironment", "reddog", com.azure.core.util.Context.NONE); } } ``` @@ -2914,7 +3741,7 @@ public final class DaprComponentsGetSamples { public final class DaprComponentsListSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DaprComponents_List.json + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/DaprComponents_List.json */ /** * Sample code: List Dapr Components. @@ -2936,7 +3763,7 @@ public final class DaprComponentsListSamples { public final class DaprComponentsListSecretsSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DaprComponents_ListSecrets. + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/DaprComponents_ListSecrets. * json */ /** @@ -2946,8 +3773,8 @@ public final class DaprComponentsListSecretsSamples { */ public static void listContainerAppsSecrets(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.daprComponents().listSecretsWithResponse("examplerg", "myenvironment", "reddog", - com.azure.core.util.Context.NONE); + manager.daprComponents() + .listSecretsWithResponse("examplerg", "myenvironment", "reddog", com.azure.core.util.Context.NONE); } } ``` @@ -2967,7 +3794,7 @@ import java.util.Map; */ public final class DaprSubscriptionsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * DaprSubscriptions_CreateOrUpdate_RouteRulesAndMetadata.json */ /** @@ -2977,19 +3804,22 @@ public final class DaprSubscriptionsCreateOrUpdateSamples { */ public static void createOrUpdateDaprSubscriptionWithRouteRulesAndMetadata( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.daprSubscriptions().define("mysubscription") - .withExistingManagedEnvironment("examplerg", "myenvironment").withPubsubName("mypubsubcomponent") + manager.daprSubscriptions() + .define("mysubscription") + .withExistingManagedEnvironment("examplerg", "myenvironment") + .withPubsubName("mypubsubcomponent") .withTopic("inventory") .withRoutes(new DaprSubscriptionRoutes() .withRules(Arrays.asList( new DaprSubscriptionRouteRule().withMatch("event.type == 'widget'").withPath("/widgets"), new DaprSubscriptionRouteRule().withMatch("event.type == 'gadget'").withPath("/gadgets"))) .withDefaultProperty("/products")) - .withMetadata(mapOf("foo", "bar", "hello", "world")).create(); + .withMetadata(mapOf("foo", "bar", "hello", "world")) + .create(); } /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * DaprSubscriptions_CreateOrUpdate_DefaultRoute.json */ /** @@ -2999,13 +3829,17 @@ public final class DaprSubscriptionsCreateOrUpdateSamples { */ public static void createOrUpdateDaprSubscriptionWithDefaultRouteOnly( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.daprSubscriptions().define("mysubscription") - .withExistingManagedEnvironment("examplerg", "myenvironment").withPubsubName("mypubsubcomponent") - .withTopic("inventory").withRoutes(new DaprSubscriptionRoutes().withDefaultProperty("/products")).create(); + manager.daprSubscriptions() + .define("mysubscription") + .withExistingManagedEnvironment("examplerg", "myenvironment") + .withPubsubName("mypubsubcomponent") + .withTopic("inventory") + .withRoutes(new DaprSubscriptionRoutes().withDefaultProperty("/products")) + .create(); } /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * DaprSubscriptions_CreateOrUpdate_BulkSubscribeAndScopes.json */ /** @@ -3015,11 +3849,15 @@ public final class DaprSubscriptionsCreateOrUpdateSamples { */ public static void createOrUpdateDaprSubscriptionWithBulkSubscribeConfigurationAndScopes( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.daprSubscriptions().define("mysubscription") - .withExistingManagedEnvironment("examplerg", "myenvironment").withPubsubName("mypubsubcomponent") - .withTopic("inventory").withRoutes(new DaprSubscriptionRoutes().withDefaultProperty("/products")) + manager.daprSubscriptions() + .define("mysubscription") + .withExistingManagedEnvironment("examplerg", "myenvironment") + .withPubsubName("mypubsubcomponent") + .withTopic("inventory") + .withRoutes(new DaprSubscriptionRoutes().withDefaultProperty("/products")) .withScopes(Arrays.asList("warehouseapp", "customersupportapp")) - .withBulkSubscribe(new DaprSubscriptionBulkSubscribeOptions().withEnabled(true).withMaxMessagesCount(123) + .withBulkSubscribe(new DaprSubscriptionBulkSubscribeOptions().withEnabled(true) + .withMaxMessagesCount(123) .withMaxAwaitDurationMs(500)) .create(); } @@ -3047,7 +3885,7 @@ public final class DaprSubscriptionsCreateOrUpdateSamples { public final class DaprSubscriptionsDeleteSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DaprSubscriptions_Delete. + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/DaprSubscriptions_Delete. * json */ /** @@ -3056,8 +3894,8 @@ public final class DaprSubscriptionsDeleteSamples { * @param manager Entry point to ContainerAppsApiManager. */ public static void deleteDaprSubscription(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.daprSubscriptions().deleteWithResponse("examplerg", "myenvironment", "mysubscription", - com.azure.core.util.Context.NONE); + manager.daprSubscriptions() + .deleteWithResponse("examplerg", "myenvironment", "mysubscription", com.azure.core.util.Context.NONE); } } ``` @@ -3070,7 +3908,7 @@ public final class DaprSubscriptionsDeleteSamples { */ public final class DaprSubscriptionsGetSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * DaprSubscriptions_Get_DefaultRoute.json */ /** @@ -3080,12 +3918,12 @@ public final class DaprSubscriptionsGetSamples { */ public static void getDaprSubscriptionWithBulkSubscribeConfigurationAndScopes( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.daprSubscriptions().getWithResponse("examplerg", "myenvironment", "mypubsubcomponent", - com.azure.core.util.Context.NONE); + manager.daprSubscriptions() + .getWithResponse("examplerg", "myenvironment", "mypubsubcomponent", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * DaprSubscriptions_Get_BulkSubscribeAndScopes.json */ /** @@ -3095,12 +3933,12 @@ public final class DaprSubscriptionsGetSamples { */ public static void getDaprSubscriptionWithDefaultRouteOnly( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.daprSubscriptions().getWithResponse("examplerg", "myenvironment", "mypubsubcomponent", - com.azure.core.util.Context.NONE); + manager.daprSubscriptions() + .getWithResponse("examplerg", "myenvironment", "mypubsubcomponent", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * DaprSubscriptions_Get_RouteRulesAndMetadata.json */ /** @@ -3110,8 +3948,8 @@ public final class DaprSubscriptionsGetSamples { */ public static void getDaprSubscriptionWithRouteRulesAndMetadata( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.daprSubscriptions().getWithResponse("examplerg", "myenvironment", "mypubsubcomponent", - com.azure.core.util.Context.NONE); + manager.daprSubscriptions() + .getWithResponse("examplerg", "myenvironment", "mypubsubcomponent", com.azure.core.util.Context.NONE); } } ``` @@ -3125,7 +3963,7 @@ public final class DaprSubscriptionsGetSamples { public final class DaprSubscriptionsListSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DaprSubscriptions_List.json + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/DaprSubscriptions_List.json */ /** * Sample code: List Dapr subscriptions. @@ -3151,7 +3989,7 @@ import java.util.Arrays; */ public final class DotNetComponentsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * DotNetComponents_CreateOrUpdate.json */ /** @@ -3161,7 +3999,8 @@ public final class DotNetComponentsCreateOrUpdateSamples { */ public static void createOrUpdateNETComponent(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.dotNetComponents().define("mydotnetcomponent") + manager.dotNetComponents() + .define("mydotnetcomponent") .withExistingManagedEnvironment("examplerg", "myenvironment") .withComponentType(DotNetComponentType.ASPIRE_DASHBOARD) .withConfigurations(Arrays.asList( @@ -3170,7 +4009,7 @@ public final class DotNetComponentsCreateOrUpdateSamples { } /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * DotNetComponents_CreateOrUpdate_ServiceBind.json */ /** @@ -3180,13 +4019,15 @@ public final class DotNetComponentsCreateOrUpdateSamples { */ public static void createOrUpdateNETComponentWithServiceBinds( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.dotNetComponents().define("mydotnetcomponent") + manager.dotNetComponents() + .define("mydotnetcomponent") .withExistingManagedEnvironment("examplerg", "myenvironment") .withComponentType(DotNetComponentType.ASPIRE_DASHBOARD) .withConfigurations(Arrays.asList( new DotNetComponentConfigurationProperty().withPropertyName("dashboard-theme").withValue("dark"))) - .withServiceBinds(Arrays.asList(new DotNetComponentServiceBind().withName("yellowcat").withServiceId( - "/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/dotNetComponents/yellowcat"))) + .withServiceBinds(Arrays.asList(new DotNetComponentServiceBind().withName("yellowcat") + .withServiceId( + "/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/dotNetComponents/yellowcat"))) .create(); } } @@ -3201,7 +4042,7 @@ public final class DotNetComponentsCreateOrUpdateSamples { public final class DotNetComponentsDeleteSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DotNetComponents_Delete.json + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/DotNetComponents_Delete.json */ /** * Sample code: Delete .NET Component. @@ -3209,8 +4050,8 @@ public final class DotNetComponentsDeleteSamples { * @param manager Entry point to ContainerAppsApiManager. */ public static void deleteNETComponent(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.dotNetComponents().delete("examplerg", "myenvironment", "mydotnetcomponent", - com.azure.core.util.Context.NONE); + manager.dotNetComponents() + .delete("examplerg", "myenvironment", "mydotnetcomponent", com.azure.core.util.Context.NONE); } } ``` @@ -3223,7 +4064,7 @@ public final class DotNetComponentsDeleteSamples { */ public final class DotNetComponentsGetSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * DotNetComponents_Get_ServiceBind.json */ /** @@ -3233,13 +4074,13 @@ public final class DotNetComponentsGetSamples { */ public static void getNETComponentWithServiceBinds(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.dotNetComponents().getWithResponse("examplerg", "myenvironment", "mydotnetcomponent", - com.azure.core.util.Context.NONE); + manager.dotNetComponents() + .getWithResponse("examplerg", "myenvironment", "mydotnetcomponent", com.azure.core.util.Context.NONE); } /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DotNetComponents_Get.json + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/DotNetComponents_Get.json */ /** * Sample code: Get .NET Component. @@ -3247,8 +4088,8 @@ public final class DotNetComponentsGetSamples { * @param manager Entry point to ContainerAppsApiManager. */ public static void getNETComponent(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.dotNetComponents().getWithResponse("examplerg", "myenvironment", "mydotnetcomponent", - com.azure.core.util.Context.NONE); + manager.dotNetComponents() + .getWithResponse("examplerg", "myenvironment", "mydotnetcomponent", com.azure.core.util.Context.NONE); } } ``` @@ -3262,7 +4103,7 @@ public final class DotNetComponentsGetSamples { public final class DotNetComponentsListSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DotNetComponents_List.json + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/DotNetComponents_List.json */ /** * Sample code: List .NET Components. @@ -3274,7 +4115,7 @@ public final class DotNetComponentsListSamples { } /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * DotNetComponents_List_ServiceBind.json */ /** @@ -3303,7 +4144,7 @@ import java.util.Arrays; */ public final class DotNetComponentsUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * DotNetComponents_Patch_ServiceBind.json */ /** @@ -3316,17 +4157,19 @@ public final class DotNetComponentsUpdateSamples { DotNetComponent resource = manager.dotNetComponents() .getWithResponse("examplerg", "myenvironment", "mydotnetcomponent", com.azure.core.util.Context.NONE) .getValue(); - resource.update().withComponentType(DotNetComponentType.ASPIRE_DASHBOARD) + resource.update() + .withComponentType(DotNetComponentType.ASPIRE_DASHBOARD) .withConfigurations(Arrays.asList( new DotNetComponentConfigurationProperty().withPropertyName("dashboard-theme").withValue("dark"))) - .withServiceBinds(Arrays.asList(new DotNetComponentServiceBind().withName("yellowcat").withServiceId( - "/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/dotNetComponents/yellowcat"))) + .withServiceBinds(Arrays.asList(new DotNetComponentServiceBind().withName("yellowcat") + .withServiceId( + "/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/dotNetComponents/yellowcat"))) .apply(); } /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DotNetComponents_Patch.json + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/DotNetComponents_Patch.json */ /** * Sample code: Patch .NET Component. @@ -3337,7 +4180,8 @@ public final class DotNetComponentsUpdateSamples { DotNetComponent resource = manager.dotNetComponents() .getWithResponse("examplerg", "myenvironment", "mydotnetcomponent", com.azure.core.util.Context.NONE) .getValue(); - resource.update().withComponentType(DotNetComponentType.ASPIRE_DASHBOARD) + resource.update() + .withComponentType(DotNetComponentType.ASPIRE_DASHBOARD) .withConfigurations(Arrays.asList( new DotNetComponentConfigurationProperty().withPropertyName("dashboard-theme").withValue("dark"))) .apply(); @@ -3345,12 +4189,37 @@ public final class DotNetComponentsUpdateSamples { } ``` +### FunctionsExtension_InvokeFunctionsHost + +```java +/** + * Samples for FunctionsExtension InvokeFunctionsHost. + */ +public final class FunctionsExtensionInvokeFunctionsHostSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/FunctionsExtension_Post.json + */ + /** + * Sample code: Invoke Functions host using Functions Extension API. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void invokeFunctionsHostUsingFunctionsExtensionAPI( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.functionsExtensions() + .invokeFunctionsHostWithResponse("rg", "testcontainerApp0", "testcontainerApp0-pjxhsye", + "testcontainerApp0", com.azure.core.util.Context.NONE); + } +} +``` + ### JavaComponents_CreateOrUpdate ```java import com.azure.resourcemanager.appcontainers.models.JavaComponentConfigurationProperty; import com.azure.resourcemanager.appcontainers.models.JavaComponentServiceBind; -import com.azure.resourcemanager.appcontainers.models.JavaComponentType; +import com.azure.resourcemanager.appcontainers.models.SpringBootAdminComponent; import java.util.Arrays; /** @@ -3358,7 +4227,7 @@ import java.util.Arrays; */ public final class JavaComponentsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * JavaComponents_CreateOrUpdate_ServiceBind.json */ /** @@ -3368,20 +4237,22 @@ public final class JavaComponentsCreateOrUpdateSamples { */ public static void createOrUpdateJavaComponentWithServiceBinds( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.javaComponents().define("myjavacomponent").withExistingManagedEnvironment("examplerg", "myenvironment") - .withComponentType(JavaComponentType.SPRING_BOOT_ADMIN) - .withConfigurations(Arrays.asList( + manager.javaComponents() + .define("myjavacomponent") + .withExistingManagedEnvironment("examplerg", "myenvironment") + .withProperties(new SpringBootAdminComponent().withConfigurations(Arrays.asList( new JavaComponentConfigurationProperty().withPropertyName("spring.boot.admin.ui.enable-toasts") .withValue("true"), new JavaComponentConfigurationProperty().withPropertyName("spring.boot.admin.monitor.status-interval") .withValue("10000ms"))) - .withServiceBinds(Arrays.asList(new JavaComponentServiceBind().withName("yellowcat").withServiceId( - "/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/javaComponents/yellowcat"))) + .withServiceBinds(Arrays.asList(new JavaComponentServiceBind().withName("yellowcat") + .withServiceId( + "/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/javaComponents/yellowcat")))) .create(); } /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * JavaComponents_CreateOrUpdate.json */ /** @@ -3391,13 +4262,14 @@ public final class JavaComponentsCreateOrUpdateSamples { */ public static void createOrUpdateJavaComponent(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.javaComponents().define("myjavacomponent").withExistingManagedEnvironment("examplerg", "myenvironment") - .withComponentType(JavaComponentType.SPRING_BOOT_ADMIN) - .withConfigurations(Arrays.asList( + manager.javaComponents() + .define("myjavacomponent") + .withExistingManagedEnvironment("examplerg", "myenvironment") + .withProperties(new SpringBootAdminComponent().withConfigurations(Arrays.asList( new JavaComponentConfigurationProperty().withPropertyName("spring.boot.admin.ui.enable-toasts") .withValue("true"), new JavaComponentConfigurationProperty().withPropertyName("spring.boot.admin.monitor.status-interval") - .withValue("10000ms"))) + .withValue("10000ms")))) .create(); } } @@ -3412,7 +4284,7 @@ public final class JavaComponentsCreateOrUpdateSamples { public final class JavaComponentsDeleteSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/JavaComponents_Delete.json + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/JavaComponents_Delete.json */ /** * Sample code: Delete Java Component. @@ -3420,8 +4292,8 @@ public final class JavaComponentsDeleteSamples { * @param manager Entry point to ContainerAppsApiManager. */ public static void deleteJavaComponent(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.javaComponents().delete("examplerg", "myenvironment", "myjavacomponent", - com.azure.core.util.Context.NONE); + manager.javaComponents() + .delete("examplerg", "myenvironment", "myjavacomponent", com.azure.core.util.Context.NONE); } } ``` @@ -3435,7 +4307,7 @@ public final class JavaComponentsDeleteSamples { public final class JavaComponentsGetSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/JavaComponents_Get.json + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/JavaComponents_Get.json */ /** * Sample code: Get Java Component. @@ -3443,12 +4315,12 @@ public final class JavaComponentsGetSamples { * @param manager Entry point to ContainerAppsApiManager. */ public static void getJavaComponent(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.javaComponents().getWithResponse("examplerg", "myenvironment", "myjavacomponent", - com.azure.core.util.Context.NONE); + manager.javaComponents() + .getWithResponse("examplerg", "myenvironment", "myjavacomponent", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * JavaComponents_Get_ServiceBind.json */ /** @@ -3458,8 +4330,8 @@ public final class JavaComponentsGetSamples { */ public static void getJavaComponentWithServiceBinds(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.javaComponents().getWithResponse("examplerg", "myenvironment", "myjavacomponent", - com.azure.core.util.Context.NONE); + manager.javaComponents() + .getWithResponse("examplerg", "myenvironment", "myjavacomponent", com.azure.core.util.Context.NONE); } } ``` @@ -3473,7 +4345,7 @@ public final class JavaComponentsGetSamples { public final class JavaComponentsListSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/JavaComponents_List.json + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/JavaComponents_List.json */ /** * Sample code: List Java Components. @@ -3485,7 +4357,7 @@ public final class JavaComponentsListSamples { } /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * JavaComponents_List_ServiceBind.json */ /** @@ -3506,7 +4378,7 @@ public final class JavaComponentsListSamples { import com.azure.resourcemanager.appcontainers.models.JavaComponent; import com.azure.resourcemanager.appcontainers.models.JavaComponentConfigurationProperty; import com.azure.resourcemanager.appcontainers.models.JavaComponentServiceBind; -import com.azure.resourcemanager.appcontainers.models.JavaComponentType; +import com.azure.resourcemanager.appcontainers.models.SpringBootAdminComponent; import java.util.Arrays; /** @@ -3515,7 +4387,7 @@ import java.util.Arrays; public final class JavaComponentsUpdateSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/JavaComponents_Patch.json + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/JavaComponents_Patch.json */ /** * Sample code: Patch Java Component. @@ -3526,17 +4398,17 @@ public final class JavaComponentsUpdateSamples { JavaComponent resource = manager.javaComponents() .getWithResponse("examplerg", "myenvironment", "myjavacomponent", com.azure.core.util.Context.NONE) .getValue(); - resource.update().withComponentType(JavaComponentType.SPRING_BOOT_ADMIN) - .withConfigurations(Arrays.asList( + resource.update() + .withProperties(new SpringBootAdminComponent().withConfigurations(Arrays.asList( new JavaComponentConfigurationProperty().withPropertyName("spring.boot.admin.ui.enable-toasts") .withValue("true"), new JavaComponentConfigurationProperty().withPropertyName("spring.boot.admin.monitor.status-interval") - .withValue("10000ms"))) + .withValue("10000ms")))) .apply(); } /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * JavaComponents_Patch_ServiceBind.json */ /** @@ -3549,14 +4421,15 @@ public final class JavaComponentsUpdateSamples { JavaComponent resource = manager.javaComponents() .getWithResponse("examplerg", "myenvironment", "myjavacomponent", com.azure.core.util.Context.NONE) .getValue(); - resource.update().withComponentType(JavaComponentType.SPRING_BOOT_ADMIN) - .withConfigurations(Arrays.asList( + resource.update() + .withProperties(new SpringBootAdminComponent().withConfigurations(Arrays.asList( new JavaComponentConfigurationProperty().withPropertyName("spring.boot.admin.ui.enable-toasts") .withValue("true"), new JavaComponentConfigurationProperty().withPropertyName("spring.boot.admin.monitor.status-interval") .withValue("10000ms"))) - .withServiceBinds(Arrays.asList(new JavaComponentServiceBind().withName("yellowcat").withServiceId( - "/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/javaComponents/yellowcat"))) + .withServiceBinds(Arrays.asList(new JavaComponentServiceBind().withName("yellowcat") + .withServiceId( + "/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/javaComponents/yellowcat")))) .apply(); } } @@ -3574,6 +4447,8 @@ import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeHttpGetHt import com.azure.resourcemanager.appcontainers.models.ContainerResources; import com.azure.resourcemanager.appcontainers.models.ExtendedLocation; import com.azure.resourcemanager.appcontainers.models.ExtendedLocationTypes; +import com.azure.resourcemanager.appcontainers.models.IdentitySettings; +import com.azure.resourcemanager.appcontainers.models.IdentitySettingsLifeCycle; import com.azure.resourcemanager.appcontainers.models.InitContainer; import com.azure.resourcemanager.appcontainers.models.JobConfiguration; import com.azure.resourcemanager.appcontainers.models.JobConfigurationEventTriggerConfig; @@ -3581,18 +4456,23 @@ import com.azure.resourcemanager.appcontainers.models.JobConfigurationManualTrig import com.azure.resourcemanager.appcontainers.models.JobScale; import com.azure.resourcemanager.appcontainers.models.JobScaleRule; import com.azure.resourcemanager.appcontainers.models.JobTemplate; +import com.azure.resourcemanager.appcontainers.models.ManagedServiceIdentity; +import com.azure.resourcemanager.appcontainers.models.ManagedServiceIdentityType; import com.azure.resourcemanager.appcontainers.models.TriggerType; import com.azure.resourcemanager.appcontainers.models.Type; +import com.azure.resourcemanager.appcontainers.models.UserAssignedIdentity; import com.azure.resourcemanager.appcontainers.models.VolumeMount; import java.io.IOException; import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; /** * Samples for Jobs CreateOrUpdate. */ public final class JobsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * Job_CreateorUpdate_ConnectedEnvironment.json */ /** @@ -3602,33 +4482,43 @@ public final class JobsCreateOrUpdateSamples { */ public static void createOrUpdateContainerAppsJobOnAConnectedEnvironment( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.jobs().define("testcontainerAppsJob0").withRegion("East US").withExistingResourceGroup("rg") + manager.jobs() + .define("testcontainerAppsJob0") + .withRegion("East US") + .withExistingResourceGroup("rg") .withExtendedLocation(new ExtendedLocation().withName( "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.ExtendedLocation/customLocations/testcustomlocation") .withType(ExtendedLocationTypes.CUSTOM_LOCATION)) .withEnvironmentId( "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/connectedEnvironments/demokube") - .withConfiguration(new JobConfiguration().withTriggerType(TriggerType.MANUAL).withReplicaTimeout(10) - .withReplicaRetryLimit(10).withManualTriggerConfig( + .withConfiguration(new JobConfiguration().withTriggerType(TriggerType.MANUAL) + .withReplicaTimeout(10) + .withReplicaRetryLimit(10) + .withManualTriggerConfig( new JobConfigurationManualTriggerConfig().withReplicaCompletionCount(1).withParallelism(4))) .withTemplate(new JobTemplate() .withInitContainers(Arrays.asList(new InitContainer().withImage("repo/testcontainerAppsJob0:v4") - .withName("testinitcontainerAppsJob0").withCommand(Arrays.asList("/bin/sh")) + .withName("testinitcontainerAppsJob0") + .withCommand(Arrays.asList("/bin/sh")) .withArgs(Arrays.asList("-c", "while true; do echo hello; sleep 10;done")) .withResources(new ContainerResources().withCpu(0.2D).withMemory("100Mi")))) - .withContainers(Arrays - .asList(new Container().withImage("repo/testcontainerAppsJob0:v1").withName("testcontainerAppsJob0") - .withProbes(Arrays.asList(new ContainerAppProbe() - .withHttpGet(new ContainerAppProbeHttpGet() - .withHttpHeaders(Arrays.asList(new ContainerAppProbeHttpGetHttpHeadersItem() - .withName("Custom-Header").withValue("Awesome"))) - .withPath("/health").withPort(8080)) - .withInitialDelaySeconds(5).withPeriodSeconds(3).withType(Type.LIVENESS)))))) + .withContainers(Arrays.asList(new Container().withImage("repo/testcontainerAppsJob0:v1") + .withName("testcontainerAppsJob0") + .withProbes(Arrays.asList(new ContainerAppProbe() + .withHttpGet(new ContainerAppProbeHttpGet() + .withHttpHeaders( + Arrays.asList(new ContainerAppProbeHttpGetHttpHeadersItem().withName("Custom-Header") + .withValue("Awesome"))) + .withPath("/health") + .withPort(8080)) + .withInitialDelaySeconds(5) + .withPeriodSeconds(3) + .withType(Type.LIVENESS)))))) .create(); } /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * Job_CreateorUpdate_EventTrigger.json */ /** @@ -3638,20 +4528,34 @@ public final class JobsCreateOrUpdateSamples { */ public static void createOrUpdateContainerAppsJobWithEventDrivenTrigger( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) throws IOException { - manager.jobs().define("testcontainerAppsJob0").withRegion("East US").withExistingResourceGroup("rg") + manager.jobs() + .define("testcontainerAppsJob0") + .withRegion("East US") + .withExistingResourceGroup("rg") + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity", + new UserAssignedIdentity()))) .withEnvironmentId( "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube") - .withConfiguration(new JobConfiguration().withTriggerType(TriggerType.EVENT).withReplicaTimeout(10) - .withReplicaRetryLimit(10).withEventTriggerConfig( - new JobConfigurationEventTriggerConfig().withReplicaCompletionCount(1).withParallelism(4) - .withScale(new JobScale().withPollingInterval(40).withMinExecutions(1).withMaxExecutions(5) - .withRules(Arrays.asList(new JobScaleRule().withName("servicebuscalingrule") - .withType("azure-servicebus") - .withMetadata(SerializerFactory.createDefaultManagementSerializerAdapter().deserialize( - "{\"topicName\":\"my-topic\"}", Object.class, SerializerEncoding.JSON))))))) + .withConfiguration(new JobConfiguration().withTriggerType(TriggerType.EVENT) + .withReplicaTimeout(10) + .withReplicaRetryLimit(10) + .withEventTriggerConfig(new JobConfigurationEventTriggerConfig().withReplicaCompletionCount(1) + .withParallelism(4) + .withScale(new JobScale().withPollingInterval(40) + .withMinExecutions(1) + .withMaxExecutions(5) + .withRules(Arrays.asList(new JobScaleRule().withName("servicebuscalingrule") + .withType("azure-servicebus") + .withMetadata(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{\"topicName\":\"my-topic\"}", Object.class, SerializerEncoding.JSON)) + .withIdentity( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity")))))) .withTemplate(new JobTemplate() .withInitContainers(Arrays.asList(new InitContainer().withImage("repo/testcontainerAppsJob0:v4") - .withName("testinitcontainerAppsJob0").withCommand(Arrays.asList("/bin/sh")) + .withName("testinitcontainerAppsJob0") + .withCommand(Arrays.asList("/bin/sh")) .withArgs(Arrays.asList("-c", "while true; do echo hello; sleep 10;done")) .withResources(new ContainerResources().withCpu(0.2D).withMemory("100Mi")))) .withContainers(Arrays.asList( @@ -3661,7 +4565,7 @@ public final class JobsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Job_CreateorUpdate.json + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/Job_CreateorUpdate.json */ /** * Sample code: Create or Update Container Apps Job. @@ -3670,33 +4574,65 @@ public final class JobsCreateOrUpdateSamples { */ public static void createOrUpdateContainerAppsJob(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.jobs().define("testcontainerAppsJob0").withRegion("East US").withExistingResourceGroup("rg") + manager.jobs() + .define("testcontainerAppsJob0") + .withRegion("East US") + .withExistingResourceGroup("rg") + .withIdentity(new ManagedServiceIdentity() + .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity", + new UserAssignedIdentity()))) .withEnvironmentId( "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube") - .withConfiguration(new JobConfiguration().withTriggerType(TriggerType.MANUAL).withReplicaTimeout(10) - .withReplicaRetryLimit(10).withManualTriggerConfig( - new JobConfigurationManualTriggerConfig().withReplicaCompletionCount(1).withParallelism(4))) - .withTemplate( - new JobTemplate() - .withInitContainers(Arrays.asList(new InitContainer().withImage("repo/testcontainerAppsJob0:v4") - .withName("testinitcontainerAppsJob0").withCommand(Arrays.asList("/bin/sh")) - .withArgs(Arrays.asList("-c", "while true; do echo hello; sleep 10;done")) - .withResources(new ContainerResources().withCpu(0.2D).withMemory("100Mi")))) - .withContainers(Arrays.asList( - new Container().withImage("repo/testcontainerAppsJob0:v1").withName("testcontainerAppsJob0") - .withVolumeMounts(Arrays.asList( - new VolumeMount().withVolumeName("azurefile").withMountPath("/mnt/path1") - .withSubPath("subPath1"), - new VolumeMount().withVolumeName("nfsazurefile").withMountPath("/mnt/path2") - .withSubPath("subPath2"))) - .withProbes(Arrays.asList(new ContainerAppProbe() - .withHttpGet(new ContainerAppProbeHttpGet() - .withHttpHeaders(Arrays.asList(new ContainerAppProbeHttpGetHttpHeadersItem() - .withName("Custom-Header").withValue("Awesome"))) - .withPath("/health").withPort(8080)) - .withInitialDelaySeconds(5).withPeriodSeconds(3).withType(Type.LIVENESS)))))) + .withConfiguration(new JobConfiguration().withTriggerType(TriggerType.MANUAL) + .withReplicaTimeout(10) + .withReplicaRetryLimit(10) + .withManualTriggerConfig( + new JobConfigurationManualTriggerConfig().withReplicaCompletionCount(1).withParallelism(4)) + .withIdentitySettings(Arrays.asList(new IdentitySettings().withIdentity( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity") + .withLifecycle(IdentitySettingsLifeCycle.ALL), + new IdentitySettings().withIdentity("system").withLifecycle(IdentitySettingsLifeCycle.INIT)))) + .withTemplate(new JobTemplate() + .withInitContainers(Arrays.asList(new InitContainer().withImage("repo/testcontainerAppsJob0:v4") + .withName("testinitcontainerAppsJob0") + .withCommand(Arrays.asList("/bin/sh")) + .withArgs(Arrays.asList("-c", "while true; do echo hello; sleep 10;done")) + .withResources(new ContainerResources().withCpu(0.2D).withMemory("100Mi")))) + .withContainers(Arrays.asList(new Container().withImage("repo/testcontainerAppsJob0:v1") + .withName("testcontainerAppsJob0") + .withVolumeMounts(Arrays.asList( + new VolumeMount().withVolumeName("azurefile") + .withMountPath("/mnt/path1") + .withSubPath("subPath1"), + new VolumeMount().withVolumeName("nfsazurefile") + .withMountPath("/mnt/path2") + .withSubPath("subPath2"))) + .withProbes(Arrays.asList(new ContainerAppProbe() + .withHttpGet(new ContainerAppProbeHttpGet() + .withHttpHeaders( + Arrays.asList(new ContainerAppProbeHttpGetHttpHeadersItem().withName("Custom-Header") + .withValue("Awesome"))) + .withPath("/health") + .withPort(8080)) + .withInitialDelaySeconds(5) + .withPeriodSeconds(3) + .withType(Type.LIVENESS)))))) .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; + } } ``` @@ -3709,7 +4645,7 @@ public final class JobsCreateOrUpdateSamples { public final class JobsDeleteSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Job_Delete.json + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/Job_Delete.json */ /** * Sample code: Delete Container Apps Job. @@ -3731,7 +4667,7 @@ public final class JobsDeleteSamples { public final class JobsGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Job_Get.json + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/Job_Get.json */ /** * Sample code: Get Container Apps Job. @@ -3753,7 +4689,7 @@ public final class JobsGetByResourceGroupSamples { public final class JobsGetDetectorSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Job_GetDetector.json + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/Job_GetDetector.json */ /** * Sample code: Get diagnostic data for a Container App Job. @@ -3762,8 +4698,9 @@ public final class JobsGetDetectorSamples { */ public static void getDiagnosticDataForAContainerAppJob(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.jobs().getDetectorWithResponse("mikono-workerapp-test-rg", "mikonojob1", "containerappjobnetworkIO", - com.azure.core.util.Context.NONE); + manager.jobs() + .getDetectorWithResponse("mikono-workerapp-test-rg", "mikonojob1", "containerappjobnetworkIO", + com.azure.core.util.Context.NONE); } } ``` @@ -3777,7 +4714,7 @@ public final class JobsGetDetectorSamples { public final class JobsListSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Jobs_ListBySubscription.json + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/Jobs_ListBySubscription.json */ /** * Sample code: List Container Apps Jobs by subscription. @@ -3800,7 +4737,7 @@ public final class JobsListSamples { public final class JobsListByResourceGroupSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Jobs_ListByResourceGroup. + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/Jobs_ListByResourceGroup. * json */ /** @@ -3824,7 +4761,7 @@ public final class JobsListByResourceGroupSamples { public final class JobsListDetectorsSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Job_ListDetectors.json + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/Job_ListDetectors.json */ /** * Sample code: Get the list of available diagnostic data for a Container App Job. @@ -3833,8 +4770,7 @@ public final class JobsListDetectorsSamples { */ public static void getTheListOfAvailableDiagnosticDataForAContainerAppJob( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.jobs().listDetectorsWithResponse("mikono-workerapp-test-rg", "mikonojob1", - com.azure.core.util.Context.NONE); + manager.jobs().listDetectors("mikono-workerapp-test-rg", "mikonojob1", com.azure.core.util.Context.NONE); } } ``` @@ -3848,7 +4784,7 @@ public final class JobsListDetectorsSamples { public final class JobsListSecretsSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Job_ListSecrets.json + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/Job_ListSecrets.json */ /** * Sample code: List Container Apps Job Secrets. @@ -3871,7 +4807,7 @@ public final class JobsListSecretsSamples { public final class JobsProxyGetSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Job_ProxyGet.json + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/Job_ProxyGet.json */ /** * Sample code: Get Container App Job by name. @@ -3899,7 +4835,7 @@ import java.util.Arrays; public final class JobsStartSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Job_Start.json + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/Job_Start.json */ /** * Sample code: Run a Container Apps Job. @@ -3907,16 +4843,17 @@ public final class JobsStartSamples { * @param manager Entry point to ContainerAppsApiManager. */ public static void runAContainerAppsJob(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.jobs().start("rg", "testcontainerAppsJob0", - new JobExecutionTemplate() + manager.jobs() + .start("rg", "testcontainerAppsJob0", new JobExecutionTemplate() .withContainers(Arrays.asList(new JobExecutionContainer().withImage("repo/testcontainerAppsJob0:v4") .withName("testcontainerAppsJob0") .withResources(new ContainerResources().withCpu(0.2D).withMemory("100Mi")))) .withInitContainers(Arrays.asList(new JobExecutionContainer().withImage("repo/testcontainerAppsJob0:v4") - .withName("testinitcontainerAppsJob0").withCommand(Arrays.asList("/bin/sh")) + .withName("testinitcontainerAppsJob0") + .withCommand(Arrays.asList("/bin/sh")) .withArgs(Arrays.asList("-c", "while true; do echo hello; sleep 10;done")) .withResources(new ContainerResources().withCpu(0.2D).withMemory("100Mi")))), - com.azure.core.util.Context.NONE); + com.azure.core.util.Context.NONE); } } ``` @@ -3930,7 +4867,7 @@ public final class JobsStartSamples { public final class JobsStopExecutionSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Job_Stop_Execution.json + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/Job_Stop_Execution.json */ /** * Sample code: Terminate a Container Apps Job. @@ -3953,7 +4890,7 @@ public final class JobsStopExecutionSamples { public final class JobsStopMultipleExecutionsSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Job_Stop_Multiple.json + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/Job_Stop_Multiple.json */ /** * Sample code: Terminate Multiple Container Apps Job. @@ -3991,7 +4928,7 @@ import java.util.Arrays; public final class JobsUpdateSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Job_Patch.json + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/Job_Patch.json */ /** * Sample code: Patch Container Apps Job. @@ -4000,28 +4937,33 @@ public final class JobsUpdateSamples { */ public static void patchContainerAppsJob(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { Job resource = manager.jobs() - .getByResourceGroupWithResponse("rg", "testcontainerAppsJob0", com.azure.core.util.Context.NONE).getValue(); + .getByResourceGroupWithResponse("rg", "testcontainerAppsJob0", com.azure.core.util.Context.NONE) + .getValue(); resource.update() - .withProperties( - new JobPatchPropertiesProperties() - .withConfiguration( - new JobConfiguration().withTriggerType(TriggerType.MANUAL).withReplicaTimeout(10) - .withReplicaRetryLimit(10) - .withManualTriggerConfig(new JobConfigurationManualTriggerConfig() - .withReplicaCompletionCount(1).withParallelism(4))) - .withTemplate(new JobTemplate() - .withInitContainers(Arrays.asList(new InitContainer().withImage("repo/testcontainerAppsJob0:v4") - .withName("testinitcontainerAppsJob0").withCommand(Arrays.asList("/bin/sh")) - .withArgs(Arrays.asList("-c", "while true; do echo hello; sleep 10;done")) - .withResources(new ContainerResources().withCpu(0.2D).withMemory("100Mi")))) - .withContainers(Arrays.asList( - new Container().withImage("repo/testcontainerAppsJob0:v1").withName("testcontainerAppsJob0") - .withProbes(Arrays.asList(new ContainerAppProbe() - .withHttpGet(new ContainerAppProbeHttpGet() - .withHttpHeaders(Arrays.asList(new ContainerAppProbeHttpGetHttpHeadersItem() - .withName("Custom-Header").withValue("Awesome"))) - .withPath("/health").withPort(8080)) - .withInitialDelaySeconds(3).withPeriodSeconds(3).withType(Type.LIVENESS))))))) + .withProperties(new JobPatchPropertiesProperties() + .withConfiguration(new JobConfiguration().withTriggerType(TriggerType.MANUAL) + .withReplicaTimeout(10) + .withReplicaRetryLimit(10) + .withManualTriggerConfig( + new JobConfigurationManualTriggerConfig().withReplicaCompletionCount(1).withParallelism(4))) + .withTemplate(new JobTemplate() + .withInitContainers(Arrays.asList(new InitContainer().withImage("repo/testcontainerAppsJob0:v4") + .withName("testinitcontainerAppsJob0") + .withCommand(Arrays.asList("/bin/sh")) + .withArgs(Arrays.asList("-c", "while true; do echo hello; sleep 10;done")) + .withResources(new ContainerResources().withCpu(0.2D).withMemory("100Mi")))) + .withContainers(Arrays.asList(new Container().withImage("repo/testcontainerAppsJob0:v1") + .withName("testcontainerAppsJob0") + .withProbes(Arrays.asList(new ContainerAppProbe() + .withHttpGet(new ContainerAppProbeHttpGet() + .withHttpHeaders(Arrays + .asList(new ContainerAppProbeHttpGetHttpHeadersItem().withName("Custom-Header") + .withValue("Awesome"))) + .withPath("/health") + .withPort(8080)) + .withInitialDelaySeconds(3) + .withPeriodSeconds(3) + .withType(Type.LIVENESS))))))) .apply(); } } @@ -4036,7 +4978,7 @@ public final class JobsUpdateSamples { public final class JobsExecutionsListSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Job_Executions_Get.json + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/Job_Executions_Get.json */ /** * Sample code: Get a Container Apps Job Executions. @@ -4050,6 +4992,245 @@ public final class JobsExecutionsListSamples { } ``` +### LogicApps_CreateOrUpdate + +```java +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import java.io.IOException; + +/** + * Samples for LogicApps CreateOrUpdate. + */ +public final class LogicAppsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/LogicApps_Create.json + */ + /** + * Sample code: Create logic app extension. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void createLogicAppExtension(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) + throws IOException { + manager.logicApps() + .define("testcontainerApp0") + .withExistingContainerApp("examplerg", "testcontainerApp0") + .withProperties(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .create(); + } +} +``` + +### LogicApps_Delete + +```java +/** + * Samples for LogicApps Delete. + */ +public final class LogicAppsDeleteSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/LogicApps_Delete.json + */ + /** + * Sample code: Create logic app extension. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + createLogicAppExtension(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.logicApps() + .deleteWithResponse("examplerg", "testcontainerApp0", "testcontainerApp0", + com.azure.core.util.Context.NONE); + } +} +``` + +### LogicApps_DeployWorkflowArtifacts + +```java +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.appcontainers.models.WorkflowArtifacts; +import java.io.IOException; +import java.util.Arrays; + +/** + * Samples for LogicApps DeployWorkflowArtifacts. + */ +public final class LogicAppsDeployWorkflowArtifactsSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ + * LogicApps_PostDeployWorkflowArtifacts.json + */ + /** + * Sample code: Deploys workflow artifacts. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void deploysWorkflowArtifacts(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) + throws IOException { + manager.logicApps() + .deployWorkflowArtifactsWithResponse("testrg123", "testapp2", "testapp2", new WorkflowArtifacts() + .withAppSettings(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize( + "{\"eventHub_connectionString\":\"Endpoint=sb://example.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=EXAMPLE1a2b3c4d5e6fEXAMPLE=\"}", + Object.class, SerializerEncoding.JSON)) + .withFiles(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize( + "{\"connections.json\":{\"managedApiConnections\":{},\"serviceProviderConnections\":{\"eventHub\":{\"displayName\":\"example1\",\"parameterValues\":{\"connectionString\":\"@appsetting('eventHub_connectionString')\"},\"serviceProvider\":{\"id\":\"/serviceProviders/eventHub\"}}}},\"test1/workflow.json\":{\"definition\":{\"$schema\":\"https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#\",\"actions\":{},\"contentVersion\":\"1.0.0.0\",\"outputs\":{},\"triggers\":{\"When_events_are_available_in_Event_hub\":{\"type\":\"ServiceProvider\",\"inputs\":{\"parameters\":{\"eventHubName\":\"test123\"},\"serviceProviderConfiguration\":{\"operationId\":\"receiveEvents\",\"connectionName\":\"eventHub\",\"serviceProviderId\":\"/serviceProviders/eventHub\"}},\"splitOn\":\"@triggerOutputs()?['body']\"}}},\"kind\":\"Stateful\"}}", + Object.class, SerializerEncoding.JSON)), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ + * LogicApps_DeleteDeployWorkflowArtifacts.json + */ + /** + * Sample code: Delete workflow artifacts. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + deleteWorkflowArtifacts(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.logicApps() + .deployWorkflowArtifactsWithResponse("testrg123", "testapp2", "testapp2", + new WorkflowArtifacts().withFilesToDelete(Arrays.asList("test/workflow.json", "test/")), + com.azure.core.util.Context.NONE); + } +} +``` + +### LogicApps_Get + +```java +/** + * Samples for LogicApps Get. + */ +public final class LogicAppsGetSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/LogicApps_Get.json + */ + /** + * Sample code: Get logic app extension by name. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + getLogicAppExtensionByName(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.logicApps() + .getWithResponse("examplerg", "testcontainerApp0", "testcontainerApp0", com.azure.core.util.Context.NONE); + } +} +``` + +### LogicApps_GetWorkflow + +```java +/** + * Samples for LogicApps GetWorkflow. + */ +public final class LogicAppsGetWorkflowSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/LogicApps_GetWorkflow.json + */ + /** + * Sample code: GET a workflow. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void gETAWorkflow(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.logicApps() + .getWorkflowWithResponse("examplerg", "testcontainerApp0", "testcontainerApp0", "stateful1", + com.azure.core.util.Context.NONE); + } +} +``` + +### LogicApps_Invoke + +```java +import com.azure.resourcemanager.appcontainers.models.LogicAppsProxyMethod; + +/** + * Samples for LogicApps Invoke. + */ +public final class LogicAppsInvokeSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/LogicApps_ListCallbackURL. + * json + */ + /** + * Sample code: Get workflow list call back URL. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + getWorkflowListCallBackURL(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.logicApps() + .invokeWithResponse("testrg123", "testapp2", "testapp2", + "/runtime/webhooks/workflow/api/management/workflows/Stateful1/triggers/When_a_HTTP_request_is_received/listCallbackUrl", + LogicAppsProxyMethod.POST, com.azure.core.util.Context.NONE); + } +} +``` + +### LogicApps_ListWorkflows + +```java +/** + * Samples for LogicApps ListWorkflows. + */ +public final class LogicAppsListWorkflowsSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/LogicApps_ListWorkflows.json + */ + /** + * Sample code: List the workflows. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listTheWorkflows(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.logicApps() + .listWorkflows("examplerg", "testcontainerApp0", "testcontainerApp0", com.azure.core.util.Context.NONE); + } +} +``` + +### LogicApps_ListWorkflowsConnections + +```java +/** + * Samples for LogicApps ListWorkflowsConnections. + */ +public final class LogicAppsListWorkflowsConnectionsSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/LogicApps_ListConnections. + * json + */ + /** + * Sample code: List the Workflows Configuration Connections. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listTheWorkflowsConfigurationConnections( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.logicApps() + .listWorkflowsConnectionsWithResponse("testrg123", "testapp2", "testapp2", + com.azure.core.util.Context.NONE); + } +} +``` + ### ManagedCertificates_CreateOrUpdate ```java @@ -4061,7 +5242,7 @@ import com.azure.resourcemanager.appcontainers.models.ManagedCertificateProperti */ public final class ManagedCertificatesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * ManagedCertificate_CreateOrUpdate.json */ /** @@ -4071,7 +5252,9 @@ public final class ManagedCertificatesCreateOrUpdateSamples { */ public static void createOrUpdateCertificate(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.managedCertificates().define("certificate-firendly-name").withRegion("East US") + manager.managedCertificates() + .define("certificate-firendly-name") + .withRegion("East US") .withExistingManagedEnvironment("examplerg", "testcontainerenv") .withProperties(new ManagedCertificateProperties().withSubjectName("my-subject-name.company.country.net") .withDomainControlValidation(ManagedCertificateDomainControlValidation.CNAME)) @@ -4089,7 +5272,7 @@ public final class ManagedCertificatesCreateOrUpdateSamples { public final class ManagedCertificatesDeleteSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ManagedCertificate_Delete. + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ManagedCertificate_Delete. * json */ /** @@ -4098,8 +5281,9 @@ public final class ManagedCertificatesDeleteSamples { * @param manager Entry point to ContainerAppsApiManager. */ public static void deleteCertificate(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.managedCertificates().deleteWithResponse("examplerg", "testcontainerenv", "certificate-firendly-name", - com.azure.core.util.Context.NONE); + manager.managedCertificates() + .deleteWithResponse("examplerg", "testcontainerenv", "certificate-firendly-name", + com.azure.core.util.Context.NONE); } } ``` @@ -4113,7 +5297,7 @@ public final class ManagedCertificatesDeleteSamples { public final class ManagedCertificatesGetSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ManagedCertificate_Get.json + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ManagedCertificate_Get.json */ /** * Sample code: Get Certificate. @@ -4121,8 +5305,9 @@ public final class ManagedCertificatesGetSamples { * @param manager Entry point to ContainerAppsApiManager. */ public static void getCertificate(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.managedCertificates().getWithResponse("examplerg", "testcontainerenv", "certificate-firendly-name", - com.azure.core.util.Context.NONE); + manager.managedCertificates() + .getWithResponse("examplerg", "testcontainerenv", "certificate-firendly-name", + com.azure.core.util.Context.NONE); } } ``` @@ -4135,7 +5320,7 @@ public final class ManagedCertificatesGetSamples { */ public final class ManagedCertificatesListSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * ManagedCertificates_ListByManagedEnvironment.json */ /** @@ -4163,7 +5348,7 @@ import java.util.Map; public final class ManagedCertificatesUpdateSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ManagedCertificates_Patch. + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ManagedCertificates_Patch. * json */ /** @@ -4173,8 +5358,10 @@ public final class ManagedCertificatesUpdateSamples { */ public static void patchManagedCertificate(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - ManagedCertificate resource = manager.managedCertificates().getWithResponse("examplerg", "testcontainerenv", - "certificate-firendly-name", com.azure.core.util.Context.NONE).getValue(); + ManagedCertificate resource = manager.managedCertificates() + .getWithResponse("examplerg", "testcontainerenv", "certificate-firendly-name", + com.azure.core.util.Context.NONE) + .getValue(); resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); } @@ -4200,7 +5387,7 @@ public final class ManagedCertificatesUpdateSamples { */ public final class ManagedEnvironmentDiagnosticsGetDetectorSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * ManagedEnvironmentDiagnostics_Get.json */ /** @@ -4210,8 +5397,9 @@ public final class ManagedEnvironmentDiagnosticsGetDetectorSamples { */ public static void getDiagnosticDataForAManagedEnvironments( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.managedEnvironmentDiagnostics().getDetectorWithResponse("mikono-workerapp-test-rg", "mikonokubeenv", - "ManagedEnvAvailabilityMetrics", com.azure.core.util.Context.NONE); + manager.managedEnvironmentDiagnostics() + .getDetectorWithResponse("mikono-workerapp-test-rg", "mikonokubeenv", "ManagedEnvAvailabilityMetrics", + com.azure.core.util.Context.NONE); } } ``` @@ -4224,7 +5412,7 @@ public final class ManagedEnvironmentDiagnosticsGetDetectorSamples { */ public final class ManagedEnvironmentDiagnosticsListDetectorsSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * ManagedEnvironmentDiagnostics_List.json */ /** @@ -4234,8 +5422,138 @@ public final class ManagedEnvironmentDiagnosticsListDetectorsSamples { */ public static void getTheListOfAvailableDiagnosticDataForAManagedEnvironments( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.managedEnvironmentDiagnostics().listDetectorsWithResponse("mikono-workerapp-test-rg", "mikonokubeenv", - com.azure.core.util.Context.NONE); + manager.managedEnvironmentDiagnostics() + .listDetectorsWithResponse("mikono-workerapp-test-rg", "mikonokubeenv", com.azure.core.util.Context.NONE); + } +} +``` + +### ManagedEnvironmentPrivateEndpointConnections_CreateOrUpdate + +```java +import com.azure.resourcemanager.appcontainers.models.PrivateEndpointConnection; +import com.azure.resourcemanager.appcontainers.models.PrivateEndpointServiceConnectionStatus; +import com.azure.resourcemanager.appcontainers.models.PrivateLinkServiceConnectionState; + +/** + * Samples for ManagedEnvironmentPrivateEndpointConnections CreateOrUpdate. + */ +public final class ManagedEnvironmentPrivateEndpointConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ + * ManagedEnvironmentPrivateEndpointConnections_CreateOrUpdate.json + */ + /** + * Sample code: Update a Private Endpoint Connection by Managed Environment. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void updateAPrivateEndpointConnectionByManagedEnvironment( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + PrivateEndpointConnection resource = manager.managedEnvironmentPrivateEndpointConnections() + .getWithResponse("examplerg", "managedEnv", "jlaw-demo1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withActionsRequired("None")) + .apply(); + } +} +``` + +### ManagedEnvironmentPrivateEndpointConnections_Delete + +```java +/** + * Samples for ManagedEnvironmentPrivateEndpointConnections Delete. + */ +public final class ManagedEnvironmentPrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ + * ManagedEnvironmentPrivateEndpointConnections_Delete.json + */ + /** + * Sample code: Delete a Private Endpoint Connection by Managed Environment. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void deleteAPrivateEndpointConnectionByManagedEnvironment( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.managedEnvironmentPrivateEndpointConnections() + .delete("examplerg", "managedEnv", "jlaw-demo1", com.azure.core.util.Context.NONE); + } +} +``` + +### ManagedEnvironmentPrivateEndpointConnections_Get + +```java +/** + * Samples for ManagedEnvironmentPrivateEndpointConnections Get. + */ +public final class ManagedEnvironmentPrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ + * ManagedEnvironmentPrivateEndpointConnections_Get.json + */ + /** + * Sample code: Get a Private Endpoint Connection by Managed Environment. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void getAPrivateEndpointConnectionByManagedEnvironment( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.managedEnvironmentPrivateEndpointConnections() + .getWithResponse("examplerg", "managedEnv", "jlaw-demo1", com.azure.core.util.Context.NONE); + } +} +``` + +### ManagedEnvironmentPrivateEndpointConnections_List + +```java +/** + * Samples for ManagedEnvironmentPrivateEndpointConnections List. + */ +public final class ManagedEnvironmentPrivateEndpointConnectionsListSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ + * ManagedEnvironmentPrivateEndpointConnections_List.json + */ + /** + * Sample code: List Private Endpoint Connections by Managed Environment. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listPrivateEndpointConnectionsByManagedEnvironment( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.managedEnvironmentPrivateEndpointConnections() + .list("examplerg", "managedEnv", com.azure.core.util.Context.NONE); + } +} +``` + +### ManagedEnvironmentPrivateLinkResources_List + +```java +/** + * Samples for ManagedEnvironmentPrivateLinkResources List. + */ +public final class ManagedEnvironmentPrivateLinkResourcesListSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ + * ManagedEnvironmentPrivateLinkResources_List.json + */ + /** + * Sample code: List Private Link Resources by Managed Environment. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listPrivateLinkResourcesByManagedEnvironment( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.managedEnvironmentPrivateLinkResources() + .list("examplerg", "managedEnv", com.azure.core.util.Context.NONE); } } ``` @@ -4248,7 +5566,7 @@ public final class ManagedEnvironmentDiagnosticsListDetectorsSamples { */ public final class ManagedEnvironmentUsagesListSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * ManagedEnvironmentUsages_List.json */ /** @@ -4275,6 +5593,8 @@ import com.azure.resourcemanager.appcontainers.models.Header; import com.azure.resourcemanager.appcontainers.models.LogAnalyticsConfiguration; import com.azure.resourcemanager.appcontainers.models.LogsConfiguration; import com.azure.resourcemanager.appcontainers.models.ManagedEnvironmentPropertiesPeerAuthentication; +import com.azure.resourcemanager.appcontainers.models.ManagedEnvironmentPropertiesPeerTrafficConfiguration; +import com.azure.resourcemanager.appcontainers.models.ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption; import com.azure.resourcemanager.appcontainers.models.ManagedServiceIdentity; import com.azure.resourcemanager.appcontainers.models.ManagedServiceIdentityType; import com.azure.resourcemanager.appcontainers.models.MetricsConfiguration; @@ -4294,7 +5614,7 @@ import java.util.Map; */ public final class ManagedEnvironmentsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * ManagedEnvironments_CustomInfrastructureResourceGroup_Create.json */ /** @@ -4304,7 +5624,9 @@ public final class ManagedEnvironmentsCreateOrUpdateSamples { */ public static void createEnvironmentWithCustomInfrastructureResourceGroup( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.managedEnvironments().define("testcontainerenv").withRegion("East US") + manager.managedEnvironments() + .define("testcontainerenv") + .withRegion("East US") .withExistingResourceGroup("examplerg") .withDaprAIConnectionString( "InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://northcentralus-0.in.applicationinsights.azure.com/") @@ -4314,20 +5636,28 @@ public final class ManagedEnvironmentsCreateOrUpdateSamples { new LogAnalyticsConfiguration().withCustomerId("string").withSharedKey("fakeTokenPlaceholder"))) .withZoneRedundant(true) .withCustomDomainConfiguration(new CustomDomainConfiguration().withDnsSuffix("www.my-name.com") - .withCertificateValue("Y2VydA==".getBytes()).withCertificatePassword("fakeTokenPlaceholder")) + .withCertificateValue("Y2VydA==".getBytes()) + .withCertificatePassword("fakeTokenPlaceholder")) .withWorkloadProfiles(Arrays.asList( - new WorkloadProfile().withName("My-GP-01").withWorkloadProfileType("GeneralPurpose").withMinimumCount(3) + new WorkloadProfile().withName("My-GP-01") + .withWorkloadProfileType("GeneralPurpose") + .withMinimumCount(3) .withMaximumCount(12), - new WorkloadProfile().withName("My-MO-01").withWorkloadProfileType("MemoryOptimized") - .withMinimumCount(3).withMaximumCount(6), - new WorkloadProfile().withName("My-CO-01").withWorkloadProfileType("ComputeOptimized") - .withMinimumCount(3).withMaximumCount(6), + new WorkloadProfile().withName("My-MO-01") + .withWorkloadProfileType("MemoryOptimized") + .withMinimumCount(3) + .withMaximumCount(6), + new WorkloadProfile().withName("My-CO-01") + .withWorkloadProfileType("ComputeOptimized") + .withMinimumCount(3) + .withMaximumCount(6), new WorkloadProfile().withName("My-consumption-01").withWorkloadProfileType("Consumption"))) - .withInfrastructureResourceGroup("myInfrastructureRgName").create(); + .withInfrastructureResourceGroup("myInfrastructureRgName") + .create(); } /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * ManagedEnvironments_CreateOrUpdate.json */ /** @@ -4336,7 +5666,9 @@ public final class ManagedEnvironmentsCreateOrUpdateSamples { * @param manager Entry point to ContainerAppsApiManager. */ public static void createEnvironments(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.managedEnvironments().define("testcontainerenv").withRegion("East US") + manager.managedEnvironments() + .define("testcontainerenv") + .withRegion("East US") .withExistingResourceGroup("examplerg") .withIdentity(new ManagedServiceIdentity() .withType(ManagedServiceIdentityType.fromString("SystemAssigned, UserAssigned")) @@ -4347,9 +5679,10 @@ public final class ManagedEnvironmentsCreateOrUpdateSamples { "InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://northcentralus-0.in.applicationinsights.azure.com/") .withVnetConfiguration(new VnetConfiguration().withInfrastructureSubnetId( "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/RGName/providers/Microsoft.Network/virtualNetworks/VNetName/subnets/subnetName1")) - .withAppLogsConfiguration( - new AppLogsConfiguration().withLogAnalyticsConfiguration(new LogAnalyticsConfiguration() - .withCustomerId("string").withSharedKey("fakeTokenPlaceholder").withDynamicJsonColumns(true))) + .withAppLogsConfiguration(new AppLogsConfiguration() + .withLogAnalyticsConfiguration(new LogAnalyticsConfiguration().withCustomerId("string") + .withSharedKey("fakeTokenPlaceholder") + .withDynamicJsonColumns(true))) .withAppInsightsConfiguration(new AppInsightsConfiguration().withConnectionString( "InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://eastus-8.in.applicationinsights.azure.com/;LiveEndpoint=https://eastus.livediagnostics.monitor.azure.com/")) .withOpenTelemetryConfiguration( @@ -4359,7 +5692,8 @@ public final class ManagedEnvironmentsCreateOrUpdateSamples { .withDataDogConfiguration( new DataDogConfiguration().withSite("string").withKey("fakeTokenPlaceholder")) .withOtlpConfigurations(Arrays.asList(new OtlpConfiguration().withName("dashboard") - .withEndpoint("dashboard.k8s.region.azurecontainerapps.io:80").withInsecure(true) + .withEndpoint("dashboard.k8s.region.azurecontainerapps.io:80") + .withInsecure(true) .withHeaders(Arrays .asList(new Header().withKey("fakeTokenPlaceholder").withValue("xxxxxxxxxxx")))))) .withTracesConfiguration(new TracesConfiguration().withDestinations(Arrays.asList("appInsights"))) @@ -4367,17 +5701,26 @@ public final class ManagedEnvironmentsCreateOrUpdateSamples { .withMetricsConfiguration(new MetricsConfiguration().withDestinations(Arrays.asList("dataDog")))) .withZoneRedundant(true) .withCustomDomainConfiguration(new CustomDomainConfiguration().withDnsSuffix("www.my-name.com") - .withCertificateValue("Y2VydA==".getBytes()).withCertificatePassword("fakeTokenPlaceholder")) + .withCertificateValue("Y2VydA==".getBytes()) + .withCertificatePassword("fakeTokenPlaceholder")) .withWorkloadProfiles(Arrays.asList( - new WorkloadProfile().withName("My-GP-01").withWorkloadProfileType("GeneralPurpose").withMinimumCount(3) + new WorkloadProfile().withName("My-GP-01") + .withWorkloadProfileType("GeneralPurpose") + .withMinimumCount(3) .withMaximumCount(12), - new WorkloadProfile().withName("My-MO-01").withWorkloadProfileType("MemoryOptimized") - .withMinimumCount(3).withMaximumCount(6), - new WorkloadProfile().withName("My-CO-01").withWorkloadProfileType("ComputeOptimized") - .withMinimumCount(3).withMaximumCount(6), + new WorkloadProfile().withName("My-MO-01") + .withWorkloadProfileType("MemoryOptimized") + .withMinimumCount(3) + .withMaximumCount(6), + new WorkloadProfile().withName("My-CO-01") + .withWorkloadProfileType("ComputeOptimized") + .withMinimumCount(3) + .withMaximumCount(6), new WorkloadProfile().withName("My-consumption-01").withWorkloadProfileType("Consumption"))) .withPeerAuthentication( new ManagedEnvironmentPropertiesPeerAuthentication().withMtls(new Mtls().withEnabled(true))) + .withPeerTrafficConfiguration(new ManagedEnvironmentPropertiesPeerTrafficConfiguration() + .withEncryption(new ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption().withEnabled(true))) .create(); } @@ -4404,7 +5747,7 @@ public final class ManagedEnvironmentsCreateOrUpdateSamples { public final class ManagedEnvironmentsDeleteSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ManagedEnvironments_Delete. + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ManagedEnvironments_Delete. * json */ /** @@ -4427,7 +5770,7 @@ public final class ManagedEnvironmentsDeleteSamples { */ public final class ManagedEnvironmentsGetAuthTokenSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * ManagedEnvironments_GetAuthToken.json */ /** @@ -4451,7 +5794,7 @@ public final class ManagedEnvironmentsGetAuthTokenSamples { public final class ManagedEnvironmentsGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ManagedEnvironments_Get.json + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ManagedEnvironments_Get.json */ /** * Sample code: Get environments by name. @@ -4459,8 +5802,8 @@ public final class ManagedEnvironmentsGetByResourceGroupSamples { * @param manager Entry point to ContainerAppsApiManager. */ public static void getEnvironmentsByName(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.managedEnvironments().getByResourceGroupWithResponse("examplerg", "jlaw-demo1", - com.azure.core.util.Context.NONE); + manager.managedEnvironments() + .getByResourceGroupWithResponse("examplerg", "jlaw-demo1", com.azure.core.util.Context.NONE); } } ``` @@ -4473,7 +5816,7 @@ public final class ManagedEnvironmentsGetByResourceGroupSamples { */ public final class ManagedEnvironmentsListSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * ManagedEnvironments_ListBySubscription.json */ /** @@ -4496,7 +5839,7 @@ public final class ManagedEnvironmentsListSamples { */ public final class ManagedEnvironmentsListByResourceGroupSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * ManagedEnvironments_ListByResourceGroup.json */ /** @@ -4519,7 +5862,7 @@ public final class ManagedEnvironmentsListByResourceGroupSamples { */ public final class ManagedEnvironmentsListWorkloadProfileStatesSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * ManagedEnvironments_ListWorkloadProfileStates.json */ /** @@ -4529,8 +5872,8 @@ public final class ManagedEnvironmentsListWorkloadProfileStatesSamples { */ public static void listEnvironmentsBySubscription(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.managedEnvironments().listWorkloadProfileStates("examplerg", "jlaw-demo1", - com.azure.core.util.Context.NONE); + manager.managedEnvironments() + .listWorkloadProfileStates("examplerg", "jlaw-demo1", com.azure.core.util.Context.NONE); } } ``` @@ -4548,7 +5891,7 @@ import java.util.Map; public final class ManagedEnvironmentsUpdateSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ManagedEnvironments_Patch. + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ManagedEnvironments_Patch. * json */ /** @@ -4587,7 +5930,7 @@ public final class ManagedEnvironmentsUpdateSamples { public final class ManagedEnvironmentsDiagnosticsGetRootSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ManagedEnvironments_Get.json + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ManagedEnvironments_Get.json */ /** * Sample code: Get environments by name. @@ -4595,8 +5938,8 @@ public final class ManagedEnvironmentsDiagnosticsGetRootSamples { * @param manager Entry point to ContainerAppsApiManager. */ public static void getEnvironmentsByName(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.managedEnvironmentsDiagnostics().getRootWithResponse("examplerg", "jlaw-demo1", - com.azure.core.util.Context.NONE); + manager.managedEnvironmentsDiagnostics() + .getRootWithResponse("examplerg", "jlaw-demo1", com.azure.core.util.Context.NONE); } } ``` @@ -4614,7 +5957,7 @@ import com.azure.resourcemanager.appcontainers.models.NfsAzureFileProperties; */ public final class ManagedEnvironmentsStoragesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * ManagedEnvironmentsStorages_CreateOrUpdate_NfsAzureFile.json */ /** @@ -4624,15 +5967,18 @@ public final class ManagedEnvironmentsStoragesCreateOrUpdateSamples { */ public static void createOrUpdateEnvironmentsStorageForNFSAzureFile( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.managedEnvironmentsStorages().define("jlaw-demo1") + manager.managedEnvironmentsStorages() + .define("jlaw-demo1") .withExistingManagedEnvironment("examplerg", "managedEnv") - .withProperties(new ManagedEnvironmentStorageProperties().withNfsAzureFile(new NfsAzureFileProperties() - .withServer("server1").withAccessMode(AccessMode.READ_ONLY).withShareName("share1"))) + .withProperties(new ManagedEnvironmentStorageProperties() + .withNfsAzureFile(new NfsAzureFileProperties().withServer("server1") + .withAccessMode(AccessMode.READ_ONLY) + .withShareName("share1"))) .create(); } /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * ManagedEnvironmentsStorages_CreateOrUpdate.json */ /** @@ -4642,11 +5988,14 @@ public final class ManagedEnvironmentsStoragesCreateOrUpdateSamples { */ public static void createOrUpdateEnvironmentsStorage(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.managedEnvironmentsStorages().define("jlaw-demo1") + manager.managedEnvironmentsStorages() + .define("jlaw-demo1") .withExistingManagedEnvironment("examplerg", "managedEnv") - .withProperties(new ManagedEnvironmentStorageProperties().withAzureFile( - new AzureFileProperties().withAccountName("account1").withAccountKey("fakeTokenPlaceholder") - .withAccessMode(AccessMode.READ_ONLY).withShareName("share1"))) + .withProperties(new ManagedEnvironmentStorageProperties() + .withAzureFile(new AzureFileProperties().withAccountName("account1") + .withAccountKey("fakeTokenPlaceholder") + .withAccessMode(AccessMode.READ_ONLY) + .withShareName("share1"))) .create(); } } @@ -4660,7 +6009,7 @@ public final class ManagedEnvironmentsStoragesCreateOrUpdateSamples { */ public final class ManagedEnvironmentsStoragesDeleteSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * ManagedEnvironmentsStorages_Delete.json */ /** @@ -4670,8 +6019,8 @@ public final class ManagedEnvironmentsStoragesDeleteSamples { */ public static void listEnvironmentsStoragesBySubscription( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.managedEnvironmentsStorages().deleteWithResponse("examplerg", "managedEnv", "jlaw-demo1", - com.azure.core.util.Context.NONE); + manager.managedEnvironmentsStorages() + .deleteWithResponse("examplerg", "managedEnv", "jlaw-demo1", com.azure.core.util.Context.NONE); } } ``` @@ -4684,7 +6033,7 @@ public final class ManagedEnvironmentsStoragesDeleteSamples { */ public final class ManagedEnvironmentsStoragesGetSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * ManagedEnvironmentsStorages_Get.json */ /** @@ -4694,12 +6043,12 @@ public final class ManagedEnvironmentsStoragesGetSamples { */ public static void getAEnvironmentsStorage(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.managedEnvironmentsStorages().getWithResponse("examplerg", "managedEnv", "jlaw-demo1", - com.azure.core.util.Context.NONE); + manager.managedEnvironmentsStorages() + .getWithResponse("examplerg", "managedEnv", "jlaw-demo1", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * ManagedEnvironmentsStorages_Get_NfsAzureFile.json */ /** @@ -4709,8 +6058,8 @@ public final class ManagedEnvironmentsStoragesGetSamples { */ public static void getAEnvironmentsStorageForNFSAzureFile( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.managedEnvironmentsStorages().getWithResponse("examplerg", "managedEnv", "jlaw-demo1", - com.azure.core.util.Context.NONE); + manager.managedEnvironmentsStorages() + .getWithResponse("examplerg", "managedEnv", "jlaw-demo1", com.azure.core.util.Context.NONE); } } ``` @@ -4723,7 +6072,7 @@ public final class ManagedEnvironmentsStoragesGetSamples { */ public final class ManagedEnvironmentsStoragesListSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * ManagedEnvironmentsStorages_List.json */ /** @@ -4733,8 +6082,8 @@ public final class ManagedEnvironmentsStoragesListSamples { */ public static void listEnvironmentsStoragesBySubscription( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.managedEnvironmentsStorages().listWithResponse("examplerg", "managedEnv", - com.azure.core.util.Context.NONE); + manager.managedEnvironmentsStorages() + .listWithResponse("examplerg", "managedEnv", com.azure.core.util.Context.NONE); } } ``` @@ -4749,7 +6098,7 @@ import com.azure.resourcemanager.appcontainers.models.CheckNameAvailabilityReque */ public final class NamespacesCheckNameAvailabilitySamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * Certificates_CheckNameAvailability.json */ /** @@ -4760,13 +6109,14 @@ public final class NamespacesCheckNameAvailabilitySamples { public static void certificatesCheckNameAvailability(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { manager.namespaces() - .checkNameAvailabilityWithResponse("examplerg", "testcontainerenv", new CheckNameAvailabilityRequest() - .withName("testcertificatename").withType("Microsoft.App/managedEnvironments/certificates"), + .checkNameAvailabilityWithResponse("examplerg", "testcontainerenv", + new CheckNameAvailabilityRequest().withName("testcertificatename") + .withType("Microsoft.App/managedEnvironments/certificates"), com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * ContainerApps_CheckNameAvailability.json */ /** @@ -4776,9 +6126,10 @@ public final class NamespacesCheckNameAvailabilitySamples { */ public static void containerAppsCheckNameAvailability(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.namespaces().checkNameAvailabilityWithResponse("examplerg", "testcontainerenv", - new CheckNameAvailabilityRequest().withName("testcappname").withType("Microsoft.App/containerApps"), - com.azure.core.util.Context.NONE); + manager.namespaces() + .checkNameAvailabilityWithResponse("examplerg", "testcontainerenv", + new CheckNameAvailabilityRequest().withName("testcappname").withType("Microsoft.App/containerApps"), + com.azure.core.util.Context.NONE); } } ``` @@ -4792,7 +6143,7 @@ public final class NamespacesCheckNameAvailabilitySamples { public final class OperationsListSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Operations_List.json + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/Operations_List.json */ /** * Sample code: List all operations. @@ -4813,7 +6164,7 @@ public final class OperationsListSamples { */ public final class ResourceProviderGetCustomDomainVerificationIdSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/ * Subscriptions_GetCustomDomainVerificationId.json */ /** @@ -4836,7 +6187,7 @@ public final class ResourceProviderGetCustomDomainVerificationIdSamples { public final class ResourceProviderJobExecutionSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Job_Execution_Get.json + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/Job_Execution_Get.json */ /** * Sample code: Get a single Job Execution. @@ -4844,8 +6195,8 @@ public final class ResourceProviderJobExecutionSamples { * @param manager Entry point to ContainerAppsApiManager. */ public static void getASingleJobExecution(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.resourceProviders().jobExecutionWithResponse("rg", "testcontainerAppsJob0", "jobExecution1", - com.azure.core.util.Context.NONE); + manager.resourceProviders() + .jobExecutionWithResponse("rg", "testcontainerAppsJob0", "jobExecution1", com.azure.core.util.Context.NONE); } } ``` @@ -4859,7 +6210,7 @@ public final class ResourceProviderJobExecutionSamples { public final class UsagesListSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Usages_List.json + * specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/Usages_List.json */ /** * Sample code: List usages. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/pom.xml b/sdk/appcontainers/azure-resourcemanager-appcontainers/pom.xml index 72be1ed94c61..a8c03faa6551 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/pom.xml +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/pom.xml @@ -14,11 +14,11 @@ com.azure.resourcemanager azure-resourcemanager-appcontainers - 1.0.0-beta.8 + 1.0.0-beta.9 jar Microsoft Azure SDK for ContainerAppsApi Management - This package contains Microsoft Azure SDK for ContainerAppsApi Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package tag package-preview-2023-11. + This package contains Microsoft Azure SDK for ContainerAppsApi Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Functions is an extension resource to revisions and the api listed is used to proxy the call from Web RP to the function app's host process, this api is not exposed to users and only Web RP is allowed to invoke functions extension resource. Package tag package-preview-2024-02. https://github.com/Azure/azure-sdk-for-java @@ -48,26 +48,31 @@ true + + com.azure + azure-json + 1.1.0 + com.azure azure-core - 1.49.1 + 1.50.0 com.azure azure-core-management - 1.15.0 + 1.15.1 com.azure azure-core-test - 1.26.0 + 1.26.1 test com.azure azure-identity - 1.13.0 + 1.13.1 test @@ -82,6 +87,12 @@ 5.9.3 test + + org.slf4j + slf4j-simple + 1.7.36 + test + org.mockito mockito-core @@ -100,11 +111,5 @@ 1.14.12 test - - org.slf4j - slf4j-simple - 1.7.36 - test - diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/ContainerAppsApiManager.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/ContainerAppsApiManager.java index 087cc2b9ecae..cb996f743289 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/ContainerAppsApiManager.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/ContainerAppsApiManager.java @@ -11,8 +11,8 @@ 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.HttpLogOptions; import com.azure.core.http.policy.HttpPipelinePolicy; import com.azure.core.http.policy.HttpPolicyProviders; import com.azure.core.http.policy.RequestIdPolicy; @@ -38,24 +38,32 @@ import com.azure.resourcemanager.appcontainers.implementation.ConnectedEnvironmentsStoragesImpl; import com.azure.resourcemanager.appcontainers.implementation.ContainerAppsApiClientBuilder; import com.azure.resourcemanager.appcontainers.implementation.ContainerAppsAuthConfigsImpl; +import com.azure.resourcemanager.appcontainers.implementation.ContainerAppsBuildsByContainerAppsImpl; +import com.azure.resourcemanager.appcontainers.implementation.ContainerAppsBuildsImpl; import com.azure.resourcemanager.appcontainers.implementation.ContainerAppsDiagnosticsImpl; import com.azure.resourcemanager.appcontainers.implementation.ContainerAppsImpl; +import com.azure.resourcemanager.appcontainers.implementation.ContainerAppsPatchesImpl; import com.azure.resourcemanager.appcontainers.implementation.ContainerAppsRevisionReplicasImpl; import com.azure.resourcemanager.appcontainers.implementation.ContainerAppsRevisionsImpl; +import com.azure.resourcemanager.appcontainers.implementation.ContainerAppsSessionPoolsImpl; import com.azure.resourcemanager.appcontainers.implementation.ContainerAppsSourceControlsImpl; import com.azure.resourcemanager.appcontainers.implementation.DaprComponentResiliencyPoliciesImpl; import com.azure.resourcemanager.appcontainers.implementation.DaprComponentsImpl; import com.azure.resourcemanager.appcontainers.implementation.DaprSubscriptionsImpl; import com.azure.resourcemanager.appcontainers.implementation.DotNetComponentsImpl; +import com.azure.resourcemanager.appcontainers.implementation.FunctionsExtensionsImpl; import com.azure.resourcemanager.appcontainers.implementation.JavaComponentsImpl; import com.azure.resourcemanager.appcontainers.implementation.JobsExecutionsImpl; import com.azure.resourcemanager.appcontainers.implementation.JobsImpl; +import com.azure.resourcemanager.appcontainers.implementation.LogicAppsImpl; import com.azure.resourcemanager.appcontainers.implementation.ManagedCertificatesImpl; import com.azure.resourcemanager.appcontainers.implementation.ManagedEnvironmentDiagnosticsImpl; -import com.azure.resourcemanager.appcontainers.implementation.ManagedEnvironmentUsagesImpl; +import com.azure.resourcemanager.appcontainers.implementation.ManagedEnvironmentPrivateEndpointConnectionsImpl; +import com.azure.resourcemanager.appcontainers.implementation.ManagedEnvironmentPrivateLinkResourcesImpl; import com.azure.resourcemanager.appcontainers.implementation.ManagedEnvironmentsDiagnosticsImpl; import com.azure.resourcemanager.appcontainers.implementation.ManagedEnvironmentsImpl; import com.azure.resourcemanager.appcontainers.implementation.ManagedEnvironmentsStoragesImpl; +import com.azure.resourcemanager.appcontainers.implementation.ManagedEnvironmentUsagesImpl; import com.azure.resourcemanager.appcontainers.implementation.NamespacesImpl; import com.azure.resourcemanager.appcontainers.implementation.OperationsImpl; import com.azure.resourcemanager.appcontainers.implementation.ResourceProvidersImpl; @@ -74,23 +82,31 @@ import com.azure.resourcemanager.appcontainers.models.ConnectedEnvironmentsStorages; import com.azure.resourcemanager.appcontainers.models.ContainerApps; import com.azure.resourcemanager.appcontainers.models.ContainerAppsAuthConfigs; +import com.azure.resourcemanager.appcontainers.models.ContainerAppsBuilds; +import com.azure.resourcemanager.appcontainers.models.ContainerAppsBuildsByContainerApps; import com.azure.resourcemanager.appcontainers.models.ContainerAppsDiagnostics; +import com.azure.resourcemanager.appcontainers.models.ContainerAppsPatches; import com.azure.resourcemanager.appcontainers.models.ContainerAppsRevisionReplicas; import com.azure.resourcemanager.appcontainers.models.ContainerAppsRevisions; +import com.azure.resourcemanager.appcontainers.models.ContainerAppsSessionPools; import com.azure.resourcemanager.appcontainers.models.ContainerAppsSourceControls; import com.azure.resourcemanager.appcontainers.models.DaprComponentResiliencyPolicies; import com.azure.resourcemanager.appcontainers.models.DaprComponents; import com.azure.resourcemanager.appcontainers.models.DaprSubscriptions; import com.azure.resourcemanager.appcontainers.models.DotNetComponents; +import com.azure.resourcemanager.appcontainers.models.FunctionsExtensions; import com.azure.resourcemanager.appcontainers.models.JavaComponents; import com.azure.resourcemanager.appcontainers.models.Jobs; import com.azure.resourcemanager.appcontainers.models.JobsExecutions; +import com.azure.resourcemanager.appcontainers.models.LogicApps; import com.azure.resourcemanager.appcontainers.models.ManagedCertificates; import com.azure.resourcemanager.appcontainers.models.ManagedEnvironmentDiagnostics; -import com.azure.resourcemanager.appcontainers.models.ManagedEnvironmentUsages; +import com.azure.resourcemanager.appcontainers.models.ManagedEnvironmentPrivateEndpointConnections; +import com.azure.resourcemanager.appcontainers.models.ManagedEnvironmentPrivateLinkResources; import com.azure.resourcemanager.appcontainers.models.ManagedEnvironments; import com.azure.resourcemanager.appcontainers.models.ManagedEnvironmentsDiagnostics; import com.azure.resourcemanager.appcontainers.models.ManagedEnvironmentsStorages; +import com.azure.resourcemanager.appcontainers.models.ManagedEnvironmentUsages; import com.azure.resourcemanager.appcontainers.models.Namespaces; import com.azure.resourcemanager.appcontainers.models.Operations; import com.azure.resourcemanager.appcontainers.models.ResourceProviders; @@ -104,6 +120,9 @@ /** * Entry point to ContainerAppsApiManager. + * Functions is an extension resource to revisions and the api listed is used to proxy the call from Web RP to the + * function app's host process, this api is not exposed to users and only Web RP is allowed to invoke functions + * extension resource. */ public final class ContainerAppsApiManager { private AppResiliencies appResiliencies; @@ -136,6 +155,12 @@ public final class ContainerAppsApiManager { private ContainerAppsRevisionReplicas containerAppsRevisionReplicas; + private ContainerAppsBuildsByContainerApps containerAppsBuildsByContainerApps; + + private ContainerAppsBuilds containerAppsBuilds; + + private ContainerAppsPatches containerAppsPatches; + private ContainerAppsDiagnostics containerAppsDiagnostics; private ManagedEnvironmentDiagnostics managedEnvironmentDiagnostics; @@ -144,8 +169,12 @@ public final class ContainerAppsApiManager { private Jobs jobs; + private DotNetComponents dotNetComponents; + private Operations operations; + private JavaComponents javaComponents; + private JobsExecutions jobsExecutions; private ResourceProviders resourceProviders; @@ -158,6 +187,10 @@ public final class ContainerAppsApiManager { private Namespaces namespaces; + private ManagedEnvironmentPrivateEndpointConnections managedEnvironmentPrivateEndpointConnections; + + private ManagedEnvironmentPrivateLinkResources managedEnvironmentPrivateLinkResources; + private DaprComponentResiliencyPolicies daprComponentResiliencyPolicies; private DaprComponents daprComponents; @@ -172,9 +205,11 @@ public final class ContainerAppsApiManager { private ManagedEnvironmentUsages managedEnvironmentUsages; - private JavaComponents javaComponents; + private FunctionsExtensions functionsExtensions; - private DotNetComponents dotNetComponents; + private LogicApps logicApps; + + private ContainerAppsSessionPools containerAppsSessionPools; private final ContainerAppsApiClient clientObject; @@ -182,8 +217,10 @@ private ContainerAppsApiManager(HttpPipeline httpPipeline, AzureProfile profile, Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); this.clientObject = new ContainerAppsApiClientBuilder().pipeline(httpPipeline) - .endpoint(profile.getEnvironment().getResourceManagerEndpoint()).subscriptionId(profile.getSubscriptionId()) - .defaultPollInterval(defaultPollInterval).buildClient(); + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); } /** @@ -334,12 +371,19 @@ public ContainerAppsApiManager authenticate(TokenCredential credential, AzurePro Objects.requireNonNull(profile, "'profile' cannot be null."); StringBuilder userAgentBuilder = new StringBuilder(); - userAgentBuilder.append("azsdk-java").append("-").append("com.azure.resourcemanager.appcontainers") - .append("/").append("1.0.0-beta.7"); + userAgentBuilder.append("azsdk-java") + .append("-") + .append("com.azure.resourcemanager.appcontainers") + .append("/") + .append("1.0.0-beta.8"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { - userAgentBuilder.append(" (").append(Configuration.getGlobalConfiguration().get("java.version")) - .append("; ").append(Configuration.getGlobalConfiguration().get("os.name")).append("; ") - .append(Configuration.getGlobalConfiguration().get("os.version")).append("; auto-generated)"); + userAgentBuilder.append(" (") + .append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.name")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")) + .append("; auto-generated)"); } else { userAgentBuilder.append(" (auto-generated)"); } @@ -358,18 +402,21 @@ public ContainerAppsApiManager authenticate(TokenCredential credential, AzurePro 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) + 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())); + .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(); + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); return new ContainerAppsApiManager(httpPipeline, profile, defaultPollInterval); } } @@ -562,6 +609,43 @@ public ContainerAppsRevisionReplicas containerAppsRevisionReplicas() { return containerAppsRevisionReplicas; } + /** + * Gets the resource collection API of ContainerAppsBuildsByContainerApps. + * + * @return Resource collection API of ContainerAppsBuildsByContainerApps. + */ + public ContainerAppsBuildsByContainerApps containerAppsBuildsByContainerApps() { + if (this.containerAppsBuildsByContainerApps == null) { + this.containerAppsBuildsByContainerApps = new ContainerAppsBuildsByContainerAppsImpl( + clientObject.getContainerAppsBuildsByContainerApps(), this); + } + return containerAppsBuildsByContainerApps; + } + + /** + * Gets the resource collection API of ContainerAppsBuilds. + * + * @return Resource collection API of ContainerAppsBuilds. + */ + public ContainerAppsBuilds containerAppsBuilds() { + if (this.containerAppsBuilds == null) { + this.containerAppsBuilds = new ContainerAppsBuildsImpl(clientObject.getContainerAppsBuilds(), this); + } + return containerAppsBuilds; + } + + /** + * Gets the resource collection API of ContainerAppsPatches. + * + * @return Resource collection API of ContainerAppsPatches. + */ + public ContainerAppsPatches containerAppsPatches() { + if (this.containerAppsPatches == null) { + this.containerAppsPatches = new ContainerAppsPatchesImpl(clientObject.getContainerAppsPatches(), this); + } + return containerAppsPatches; + } + /** * Gets the resource collection API of ContainerAppsDiagnostics. * @@ -613,6 +697,18 @@ public Jobs jobs() { return jobs; } + /** + * Gets the resource collection API of DotNetComponents. It manages DotNetComponent. + * + * @return Resource collection API of DotNetComponents. + */ + public DotNetComponents dotNetComponents() { + if (this.dotNetComponents == null) { + this.dotNetComponents = new DotNetComponentsImpl(clientObject.getDotNetComponents(), this); + } + return dotNetComponents; + } + /** * Gets the resource collection API of Operations. * @@ -625,6 +721,18 @@ public Operations operations() { return operations; } + /** + * Gets the resource collection API of JavaComponents. It manages JavaComponent. + * + * @return Resource collection API of JavaComponents. + */ + public JavaComponents javaComponents() { + if (this.javaComponents == null) { + this.javaComponents = new JavaComponentsImpl(clientObject.getJavaComponents(), this); + } + return javaComponents; + } + /** * Gets the resource collection API of JobsExecutions. * @@ -697,6 +805,33 @@ public Namespaces namespaces() { return namespaces; } + /** + * Gets the resource collection API of ManagedEnvironmentPrivateEndpointConnections. It manages + * PrivateEndpointConnection. + * + * @return Resource collection API of ManagedEnvironmentPrivateEndpointConnections. + */ + public ManagedEnvironmentPrivateEndpointConnections managedEnvironmentPrivateEndpointConnections() { + if (this.managedEnvironmentPrivateEndpointConnections == null) { + this.managedEnvironmentPrivateEndpointConnections = new ManagedEnvironmentPrivateEndpointConnectionsImpl( + clientObject.getManagedEnvironmentPrivateEndpointConnections(), this); + } + return managedEnvironmentPrivateEndpointConnections; + } + + /** + * Gets the resource collection API of ManagedEnvironmentPrivateLinkResources. + * + * @return Resource collection API of ManagedEnvironmentPrivateLinkResources. + */ + public ManagedEnvironmentPrivateLinkResources managedEnvironmentPrivateLinkResources() { + if (this.managedEnvironmentPrivateLinkResources == null) { + this.managedEnvironmentPrivateLinkResources = new ManagedEnvironmentPrivateLinkResourcesImpl( + clientObject.getManagedEnvironmentPrivateLinkResources(), this); + } + return managedEnvironmentPrivateLinkResources; + } + /** * Gets the resource collection API of DaprComponentResiliencyPolicies. It manages DaprComponentResiliencyPolicy. * @@ -786,27 +921,40 @@ public ManagedEnvironmentUsages managedEnvironmentUsages() { } /** - * Gets the resource collection API of JavaComponents. It manages JavaComponent. + * Gets the resource collection API of FunctionsExtensions. * - * @return Resource collection API of JavaComponents. + * @return Resource collection API of FunctionsExtensions. */ - public JavaComponents javaComponents() { - if (this.javaComponents == null) { - this.javaComponents = new JavaComponentsImpl(clientObject.getJavaComponents(), this); + public FunctionsExtensions functionsExtensions() { + if (this.functionsExtensions == null) { + this.functionsExtensions = new FunctionsExtensionsImpl(clientObject.getFunctionsExtensions(), this); } - return javaComponents; + return functionsExtensions; } /** - * Gets the resource collection API of DotNetComponents. It manages DotNetComponent. + * Gets the resource collection API of LogicApps. It manages LogicApp. * - * @return Resource collection API of DotNetComponents. + * @return Resource collection API of LogicApps. */ - public DotNetComponents dotNetComponents() { - if (this.dotNetComponents == null) { - this.dotNetComponents = new DotNetComponentsImpl(clientObject.getDotNetComponents(), this); + public LogicApps logicApps() { + if (this.logicApps == null) { + this.logicApps = new LogicAppsImpl(clientObject.getLogicApps(), this); } - return dotNetComponents; + return logicApps; + } + + /** + * Gets the resource collection API of ContainerAppsSessionPools. It manages SessionPool. + * + * @return Resource collection API of ContainerAppsSessionPools. + */ + public ContainerAppsSessionPools containerAppsSessionPools() { + if (this.containerAppsSessionPools == null) { + this.containerAppsSessionPools + = new ContainerAppsSessionPoolsImpl(clientObject.getContainerAppsSessionPools(), this); + } + return containerAppsSessionPools; } /** diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ConnectedEnvironmentsDaprComponentsClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ConnectedEnvironmentsDaprComponentsClient.java index b0839ec31463..f0d390ee1103 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ConnectedEnvironmentsDaprComponentsClient.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ConnectedEnvironmentsDaprComponentsClient.java @@ -13,8 +13,7 @@ import com.azure.resourcemanager.appcontainers.fluent.models.DaprSecretsCollectionInner; /** - * An instance of this class provides access to all the operations defined in - * ConnectedEnvironmentsDaprComponentsClient. + * An instance of this class provides access to all the operations defined in ConnectedEnvironmentsDaprComponentsClient. */ public interface ConnectedEnvironmentsDaprComponentsClient { /** diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsApiClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsApiClient.java index 51855da3e2ff..dffef6529c70 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsApiClient.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsApiClient.java @@ -151,6 +151,27 @@ public interface ContainerAppsApiClient { */ ContainerAppsRevisionReplicasClient getContainerAppsRevisionReplicas(); + /** + * Gets the ContainerAppsBuildsByContainerAppsClient object to access its operations. + * + * @return the ContainerAppsBuildsByContainerAppsClient object. + */ + ContainerAppsBuildsByContainerAppsClient getContainerAppsBuildsByContainerApps(); + + /** + * Gets the ContainerAppsBuildsClient object to access its operations. + * + * @return the ContainerAppsBuildsClient object. + */ + ContainerAppsBuildsClient getContainerAppsBuilds(); + + /** + * Gets the ContainerAppsPatchesClient object to access its operations. + * + * @return the ContainerAppsPatchesClient object. + */ + ContainerAppsPatchesClient getContainerAppsPatches(); + /** * Gets the ContainerAppsDiagnosticsClient object to access its operations. * @@ -179,6 +200,13 @@ public interface ContainerAppsApiClient { */ JobsClient getJobs(); + /** + * Gets the DotNetComponentsClient object to access its operations. + * + * @return the DotNetComponentsClient object. + */ + DotNetComponentsClient getDotNetComponents(); + /** * Gets the OperationsClient object to access its operations. * @@ -186,6 +214,13 @@ public interface ContainerAppsApiClient { */ OperationsClient getOperations(); + /** + * Gets the JavaComponentsClient object to access its operations. + * + * @return the JavaComponentsClient object. + */ + JavaComponentsClient getJavaComponents(); + /** * Gets the JobsExecutionsClient object to access its operations. * @@ -228,6 +263,20 @@ public interface ContainerAppsApiClient { */ NamespacesClient getNamespaces(); + /** + * Gets the ManagedEnvironmentPrivateEndpointConnectionsClient object to access its operations. + * + * @return the ManagedEnvironmentPrivateEndpointConnectionsClient object. + */ + ManagedEnvironmentPrivateEndpointConnectionsClient getManagedEnvironmentPrivateEndpointConnections(); + + /** + * Gets the ManagedEnvironmentPrivateLinkResourcesClient object to access its operations. + * + * @return the ManagedEnvironmentPrivateLinkResourcesClient object. + */ + ManagedEnvironmentPrivateLinkResourcesClient getManagedEnvironmentPrivateLinkResources(); + /** * Gets the DaprComponentResiliencyPoliciesClient object to access its operations. * @@ -278,16 +327,23 @@ public interface ContainerAppsApiClient { ManagedEnvironmentUsagesClient getManagedEnvironmentUsages(); /** - * Gets the JavaComponentsClient object to access its operations. + * Gets the FunctionsExtensionsClient object to access its operations. * - * @return the JavaComponentsClient object. + * @return the FunctionsExtensionsClient object. */ - JavaComponentsClient getJavaComponents(); + FunctionsExtensionsClient getFunctionsExtensions(); /** - * Gets the DotNetComponentsClient object to access its operations. + * Gets the LogicAppsClient object to access its operations. * - * @return the DotNetComponentsClient object. + * @return the LogicAppsClient object. */ - DotNetComponentsClient getDotNetComponents(); + LogicAppsClient getLogicApps(); + + /** + * Gets the ContainerAppsSessionPoolsClient object to access its operations. + * + * @return the ContainerAppsSessionPoolsClient object. + */ + ContainerAppsSessionPoolsClient getContainerAppsSessionPools(); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsBuildsByContainerAppsClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsBuildsByContainerAppsClient.java new file mode 100644 index 000000000000..258e621ecb99 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsBuildsByContainerAppsClient.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.appcontainers.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.appcontainers.fluent.models.ContainerAppsBuildResourceInner; + +/** + * An instance of this class provides access to all the operations defined in ContainerAppsBuildsByContainerAppsClient. + */ +public interface ContainerAppsBuildsByContainerAppsClient { + /** + * List Container Apps Build resources by Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Build is associated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Container Apps Build Resource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String containerAppName); + + /** + * List Container Apps Build resources by Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Build is associated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Container Apps Build Resource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String containerAppName, + Context context); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsBuildsClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsBuildsClient.java new file mode 100644 index 000000000000..7d3c288df126 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsBuildsClient.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.appcontainers.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +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.appcontainers.fluent.models.ContainerAppsBuildResourceInner; + +/** + * An instance of this class provides access to all the operations defined in ContainerAppsBuildsClient. + */ +public interface ContainerAppsBuildsClient { + /** + * Get a Container Apps Build resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Build is associated. + * @param buildName The name of a build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Container Apps Build resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String containerAppName, + String buildName, Context context); + + /** + * Get a Container Apps Build resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Build is associated. + * @param buildName The name of a build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Container Apps Build resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ContainerAppsBuildResourceInner get(String resourceGroupName, String containerAppName, String buildName); + + /** + * Delete a Container Apps Build resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Build is associated. + * @param buildName The name of a build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked 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 containerAppName, String buildName); + + /** + * Delete a Container Apps Build resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Build is associated. + * @param buildName The name of a build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked 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 containerAppName, String buildName, + Context context); + + /** + * Delete a Container Apps Build resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Build is associated. + * @param buildName The name of a build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 containerAppName, String buildName); + + /** + * Delete a Container Apps Build resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Build is associated. + * @param buildName The name of a build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 containerAppName, String buildName, Context context); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsPatchesClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsPatchesClient.java new file mode 100644 index 000000000000..12ce9706f0b7 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsPatchesClient.java @@ -0,0 +1,263 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.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.appcontainers.fluent.models.ContainerAppsPatchResourceInner; +import com.azure.resourcemanager.appcontainers.models.PatchSkipConfig; + +/** + * An instance of this class provides access to all the operations defined in ContainerAppsPatchesClient. + */ +public interface ContainerAppsPatchesClient { + /** + * List Container Apps Patch resources by ContainerApp. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App patch collection as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByContainerApp(String resourceGroupName, + String containerAppName); + + /** + * List Container Apps Patch resources by ContainerApp. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param filter The filter to apply on the operation. For example, $filter=properties/patchApplyStatus eq + * 'Succeeded'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App patch collection as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByContainerApp(String resourceGroupName, String containerAppName, + String filter, Context context); + + /** + * Get details for specific Container Apps Patch by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details for specific Container Apps Patch by patch name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String containerAppName, + String patchName, Context context); + + /** + * Get details for specific Container Apps Patch by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details for specific Container Apps Patch by patch name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ContainerAppsPatchResourceInner get(String resourceGroupName, String containerAppName, String patchName); + + /** + * Delete specific Container Apps Patch by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked 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 containerAppName, String patchName); + + /** + * Delete specific Container Apps Patch by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked 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 containerAppName, String patchName, + Context context); + + /** + * Delete specific Container Apps Patch by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 containerAppName, String patchName); + + /** + * Delete specific Container Apps Patch by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 containerAppName, String patchName, Context context); + + /** + * Configure the Container Apps Patch skip option by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param patchSkipConfig Configure patcher to skip a patch or not. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked 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> beginSkipConfigure(String resourceGroupName, String containerAppName, + String patchName, PatchSkipConfig patchSkipConfig); + + /** + * Configure the Container Apps Patch skip option by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param patchSkipConfig Configure patcher to skip a patch or not. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked 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> beginSkipConfigure(String resourceGroupName, String containerAppName, + String patchName, PatchSkipConfig patchSkipConfig, Context context); + + /** + * Configure the Container Apps Patch skip option by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param patchSkipConfig Configure patcher to skip a patch or not. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 skipConfigure(String resourceGroupName, String containerAppName, String patchName, + PatchSkipConfig patchSkipConfig); + + /** + * Configure the Container Apps Patch skip option by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param patchSkipConfig Configure patcher to skip a patch or not. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 skipConfigure(String resourceGroupName, String containerAppName, String patchName, + PatchSkipConfig patchSkipConfig, Context context); + + /** + * Apply a Container Apps Patch resource with patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of container App Patch. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ContainerAppsPatchResourceInner> + beginApply(String resourceGroupName, String containerAppName, String patchName); + + /** + * Apply a Container Apps Patch resource with patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of container App Patch. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ContainerAppsPatchResourceInner> + beginApply(String resourceGroupName, String containerAppName, String patchName, Context context); + + /** + * Apply a Container Apps Patch resource with patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App Patch. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ContainerAppsPatchResourceInner apply(String resourceGroupName, String containerAppName, String patchName); + + /** + * Apply a Container Apps Patch resource with patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App Patch. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ContainerAppsPatchResourceInner apply(String resourceGroupName, String containerAppName, String patchName, + Context context); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsSessionPoolsClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsSessionPoolsClient.java new file mode 100644 index 000000000000..78e691488e7d --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsSessionPoolsClient.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.appcontainers.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.appcontainers.fluent.models.SessionPoolInner; +import com.azure.resourcemanager.appcontainers.models.SessionPoolUpdatableProperties; + +/** + * An instance of this class provides access to all the operations defined in ContainerAppsSessionPoolsClient. + */ +public interface ContainerAppsSessionPoolsClient { + /** + * Get the session pools in a given subscription. + * + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the session pools in a given subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Get the session pools in a given subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the session pools in a given subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Get the session pools in a given resource group of a subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the session pools in a given resource group of a subscription as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Get the session pools in a given resource group of a subscription. + * + * @param resourceGroupName The name of the resource 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.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the session pools in a given resource group of a subscription as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get the properties of a session pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a session pool along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String sessionPoolName, + Context context); + + /** + * Get the properties of a session pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a session pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SessionPoolInner getByResourceGroup(String resourceGroupName, String sessionPoolName); + + /** + * Create or update a session pool. + * + * Create or update a session pool with the given properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param sessionPoolEnvelope Properties used to create a session pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of container App session pool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SessionPoolInner> beginCreateOrUpdate(String resourceGroupName, + String sessionPoolName, SessionPoolInner sessionPoolEnvelope); + + /** + * Create or update a session pool. + * + * Create or update a session pool with the given properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param sessionPoolEnvelope Properties used to create a session pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of container App session pool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SessionPoolInner> beginCreateOrUpdate(String resourceGroupName, + String sessionPoolName, SessionPoolInner sessionPoolEnvelope, Context context); + + /** + * Create or update a session pool. + * + * Create or update a session pool with the given properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param sessionPoolEnvelope Properties used to create a session pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App session pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SessionPoolInner createOrUpdate(String resourceGroupName, String sessionPoolName, + SessionPoolInner sessionPoolEnvelope); + + /** + * Create or update a session pool. + * + * Create or update a session pool with the given properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param sessionPoolEnvelope Properties used to create a session pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App session pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SessionPoolInner createOrUpdate(String resourceGroupName, String sessionPoolName, + SessionPoolInner sessionPoolEnvelope, Context context); + + /** + * Update properties of a session pool + * + * Patches a session pool using JSON merge patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param sessionPoolEnvelope Properties used to create a session pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of container App session pool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SessionPoolInner> beginUpdate(String resourceGroupName, + String sessionPoolName, SessionPoolUpdatableProperties sessionPoolEnvelope); + + /** + * Update properties of a session pool + * + * Patches a session pool using JSON merge patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param sessionPoolEnvelope Properties used to create a session pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of container App session pool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SessionPoolInner> beginUpdate(String resourceGroupName, + String sessionPoolName, SessionPoolUpdatableProperties sessionPoolEnvelope, Context context); + + /** + * Update properties of a session pool + * + * Patches a session pool using JSON merge patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param sessionPoolEnvelope Properties used to create a session pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App session pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SessionPoolInner update(String resourceGroupName, String sessionPoolName, + SessionPoolUpdatableProperties sessionPoolEnvelope); + + /** + * Update properties of a session pool + * + * Patches a session pool using JSON merge patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param sessionPoolEnvelope Properties used to create a session pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App session pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SessionPoolInner update(String resourceGroupName, String sessionPoolName, + SessionPoolUpdatableProperties sessionPoolEnvelope, Context context); + + /** + * Delete a session pool. + * + * Delete the session pool with the given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked 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 sessionPoolName); + + /** + * Delete a session pool. + * + * Delete the session pool with the given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked 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 sessionPoolName, Context context); + + /** + * Delete a session pool. + * + * Delete the session pool with the given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if 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 sessionPoolName); + + /** + * Delete a session pool. + * + * Delete the session pool with the given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if 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 sessionPoolName, Context context); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/FunctionsExtensionsClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/FunctionsExtensionsClient.java new file mode 100644 index 000000000000..45732c3aac77 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/FunctionsExtensionsClient.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.appcontainers.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * An instance of this class provides access to all the operations defined in FunctionsExtensionsClient. + */ +public interface FunctionsExtensionsClient { + /** + * Proxies a Functions host call to the function app backed by the container app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param revisionName Name of the Container App Revision, the parent resource. + * @param functionAppName Name of the Function App, the extension resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response invokeFunctionsHostWithResponse(String resourceGroupName, String containerAppName, + String revisionName, String functionAppName, Context context); + + /** + * Proxies a Functions host call to the function app backed by the container app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param revisionName Name of the Container App Revision, the parent resource. + * @param functionAppName Name of the Function App, the extension resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + String invokeFunctionsHost(String resourceGroupName, String containerAppName, String revisionName, + String functionAppName); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/JobsClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/JobsClient.java index a0b37059995f..ea43c27efd1a 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/JobsClient.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/JobsClient.java @@ -12,7 +12,6 @@ import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.appcontainers.fluent.models.ContainerAppJobExecutionsInner; -import com.azure.resourcemanager.appcontainers.fluent.models.DiagnosticsCollectionInner; import com.azure.resourcemanager.appcontainers.fluent.models.DiagnosticsInner; import com.azure.resourcemanager.appcontainers.fluent.models.JobExecutionBaseInner; import com.azure.resourcemanager.appcontainers.fluent.models.JobInner; @@ -31,16 +30,14 @@ public interface JobsClient { * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of diagnostics for a Container App Job along with {@link Response}. + * @return the list of diagnostics for a Container App Job as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listDetectorsWithResponse(String resourceGroupName, String jobName, - Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listDetectors(String resourceGroupName, String jobName); /** * Get the list of diagnostics for a given Container App Job. @@ -49,14 +46,15 @@ Response listDetectorsWithResponse(String resourceGr * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of diagnostics for a Container App Job. + * @return the list of diagnostics for a Container App Job as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - DiagnosticsCollectionInner listDetectors(String resourceGroupName, String jobName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listDetectors(String resourceGroupName, String jobName, Context context); /** * Get the diagnostics data for a given Container App Job. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/LogicAppsClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/LogicAppsClient.java new file mode 100644 index 000000000000..1ee60bcd1b3c --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/LogicAppsClient.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.appcontainers.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.util.Context; +import com.azure.resourcemanager.appcontainers.fluent.models.LogicAppInner; +import com.azure.resourcemanager.appcontainers.fluent.models.WorkflowEnvelopeInner; +import com.azure.resourcemanager.appcontainers.models.LogicAppsProxyMethod; +import com.azure.resourcemanager.appcontainers.models.WorkflowArtifacts; + +/** + * An instance of this class provides access to all the operations defined in LogicAppsClient. + */ +public interface LogicAppsClient { + /** + * Gets a logic app extension resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a logic app extension resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String containerAppName, String logicAppName, + Context context); + + /** + * Gets a logic app extension resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a logic app extension resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LogicAppInner get(String resourceGroupName, String containerAppName, String logicAppName); + + /** + * Create or update a Logic App extension resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param resource Logic app resource properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a logic app extension resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse(String resourceGroupName, String containerAppName, + String logicAppName, LogicAppInner resource, Context context); + + /** + * Create or update a Logic App extension resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param resource Logic app resource properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a logic app extension resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LogicAppInner createOrUpdate(String resourceGroupName, String containerAppName, String logicAppName, + LogicAppInner resource); + + /** + * Deletes a Logic App extension resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String containerAppName, String logicAppName, + Context context); + + /** + * Deletes a Logic App extension resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if 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 containerAppName, String logicAppName); + + /** + * List the workflows for a logic app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of workflow information elements as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listWorkflows(String resourceGroupName, String containerAppName, + String logicAppName); + + /** + * List the workflows for a logic app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of workflow information elements as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listWorkflows(String resourceGroupName, String containerAppName, + String logicAppName, Context context); + + /** + * Get workflow information by its name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param workflowName Workflow name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workflow information by its name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWorkflowWithResponse(String resourceGroupName, String containerAppName, + String logicAppName, String workflowName, Context context); + + /** + * Get workflow information by its name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param workflowName Workflow name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workflow information by its name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkflowEnvelopeInner getWorkflow(String resourceGroupName, String containerAppName, String logicAppName, + String workflowName); + + /** + * Creates or updates the artifacts for the logic app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param workflowArtifacts Application settings and files of the workflow. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deployWorkflowArtifactsWithResponse(String resourceGroupName, String containerAppName, + String logicAppName, WorkflowArtifacts workflowArtifacts, Context context); + + /** + * Creates or updates the artifacts for the logic app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if 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 deployWorkflowArtifacts(String resourceGroupName, String containerAppName, String logicAppName); + + /** + * Gets logic app's connections. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return logic app's connections along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWorkflowsConnectionsWithResponse(String resourceGroupName, + String containerAppName, String logicAppName, Context context); + + /** + * Gets logic app's connections. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return logic app's connections. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkflowEnvelopeInner listWorkflowsConnections(String resourceGroupName, String containerAppName, + String logicAppName); + + /** + * Proxies a the API call to the logic app backed by the container app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the LogicApp App, the extension resource. + * @param xMsLogicAppsProxyPath The proxy path for the API call. + * @param xMsLogicAppsProxyMethod The proxy method for the API call. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response invokeWithResponse(String resourceGroupName, String containerAppName, String logicAppName, + String xMsLogicAppsProxyPath, LogicAppsProxyMethod xMsLogicAppsProxyMethod, Context context); + + /** + * Proxies a the API call to the logic app backed by the container app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the LogicApp App, the extension resource. + * @param xMsLogicAppsProxyPath The proxy path for the API call. + * @param xMsLogicAppsProxyMethod The proxy method for the API call. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Object invoke(String resourceGroupName, String containerAppName, String logicAppName, String xMsLogicAppsProxyPath, + LogicAppsProxyMethod xMsLogicAppsProxyMethod); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ManagedEnvironmentPrivateEndpointConnectionsClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ManagedEnvironmentPrivateEndpointConnectionsClient.java new file mode 100644 index 000000000000..37a4ed33fe03 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ManagedEnvironmentPrivateEndpointConnectionsClient.java @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.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.appcontainers.fluent.models.PrivateEndpointConnectionInner; + +/** + * An instance of this class provides access to all the operations defined in + * ManagedEnvironmentPrivateEndpointConnectionsClient. + */ +public interface ManagedEnvironmentPrivateEndpointConnectionsClient { + /** + * List private endpoint connections for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connection associated with the specified resource as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String environmentName); + + /** + * List private endpoint connections for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connection associated with the specified resource as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String environmentName, + Context context); + + /** + * Get a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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 private endpoint connection for a given managed environment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String environmentName, + String privateEndpointConnectionName, Context context); + + /** + * Get a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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 private endpoint connection for a given managed environment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner get(String resourceGroupName, String environmentName, + String privateEndpointConnectionName); + + /** + * Update the state of a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param privateEndpointConnectionEnvelope The resource of private endpoint and its properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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 Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( + String resourceGroupName, String environmentName, String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnectionEnvelope); + + /** + * Update the state of a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param privateEndpointConnectionEnvelope The resource of private endpoint and its properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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 Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( + String resourceGroupName, String environmentName, String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnectionEnvelope, Context context); + + /** + * Update the state of a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param privateEndpointConnectionEnvelope The resource of private endpoint and its properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner createOrUpdate(String resourceGroupName, String environmentName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnectionEnvelope); + + /** + * Update the state of a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param privateEndpointConnectionEnvelope The resource of private endpoint and its properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner createOrUpdate(String resourceGroupName, String environmentName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnectionEnvelope, + Context context); + + /** + * Delete a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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 resourceGroupName, String environmentName, + String privateEndpointConnectionName); + + /** + * Delete a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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 resourceGroupName, String environmentName, + String privateEndpointConnectionName, Context context); + + /** + * Delete a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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 resourceGroupName, String environmentName, String privateEndpointConnectionName); + + /** + * Delete a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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 resourceGroupName, String environmentName, String privateEndpointConnectionName, + Context context); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ManagedEnvironmentPrivateLinkResourcesClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ManagedEnvironmentPrivateLinkResourcesClient.java new file mode 100644 index 000000000000..7235c21740e7 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ManagedEnvironmentPrivateLinkResourcesClient.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.appcontainers.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.appcontainers.fluent.models.PrivateLinkResourceInner; + +/** + * An instance of this class provides access to all the operations defined in + * ManagedEnvironmentPrivateLinkResourcesClient. + */ +public interface ManagedEnvironmentPrivateLinkResourcesClient { + /** + * List private link resources for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 private link resources as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String environmentName); + + /** + * List private link resources for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 private link resources as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String environmentName, Context context); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/AppResiliencyInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/AppResiliencyInner.java index 8c8854f07d7f..653f9716712c 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/AppResiliencyInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/AppResiliencyInner.java @@ -7,13 +7,16 @@ 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.appcontainers.models.CircuitBreakerPolicy; import com.azure.resourcemanager.appcontainers.models.HttpConnectionPool; import com.azure.resourcemanager.appcontainers.models.HttpRetryPolicy; import com.azure.resourcemanager.appcontainers.models.TcpConnectionPool; import com.azure.resourcemanager.appcontainers.models.TcpRetryPolicy; import com.azure.resourcemanager.appcontainers.models.TimeoutPolicy; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * Configuration to setup App Resiliency. @@ -23,15 +26,28 @@ public final class AppResiliencyInner extends ProxyResource { /* * App Resiliency resource specific properties */ - @JsonProperty(value = "properties") private AppResiliencyProperties innerProperties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + /** * Creates an instance of AppResiliencyInner class. */ @@ -56,6 +72,36 @@ public SystemData systemData() { return this.systemData; } + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + /** * Get the timeoutPolicy property: Policy to set request timeouts. * @@ -204,4 +250,49 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AppResiliencyInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AppResiliencyInner 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 AppResiliencyInner. + */ + public static AppResiliencyInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AppResiliencyInner deserializedAppResiliencyInner = new AppResiliencyInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAppResiliencyInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAppResiliencyInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAppResiliencyInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedAppResiliencyInner.innerProperties = AppResiliencyProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedAppResiliencyInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAppResiliencyInner; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/AppResiliencyProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/AppResiliencyProperties.java index aa0dd302ad09..83da18920e65 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/AppResiliencyProperties.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/AppResiliencyProperties.java @@ -5,53 +5,51 @@ package com.azure.resourcemanager.appcontainers.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.appcontainers.models.CircuitBreakerPolicy; import com.azure.resourcemanager.appcontainers.models.HttpConnectionPool; import com.azure.resourcemanager.appcontainers.models.HttpRetryPolicy; import com.azure.resourcemanager.appcontainers.models.TcpConnectionPool; import com.azure.resourcemanager.appcontainers.models.TcpRetryPolicy; import com.azure.resourcemanager.appcontainers.models.TimeoutPolicy; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * App Resiliency resource specific properties. */ @Fluent -public final class AppResiliencyProperties { +public final class AppResiliencyProperties implements JsonSerializable { /* * Policy to set request timeouts */ - @JsonProperty(value = "timeoutPolicy") private TimeoutPolicy timeoutPolicy; /* * Policy that defines http request retry conditions */ - @JsonProperty(value = "httpRetryPolicy") private HttpRetryPolicy httpRetryPolicy; /* * Policy that defines tcp request retry conditions */ - @JsonProperty(value = "tcpRetryPolicy") private TcpRetryPolicy tcpRetryPolicy; /* * Policy that defines circuit breaker conditions */ - @JsonProperty(value = "circuitBreakerPolicy") private CircuitBreakerPolicy circuitBreakerPolicy; /* * Defines parameters for http connection pooling */ - @JsonProperty(value = "httpConnectionPool") private HttpConnectionPool httpConnectionPool; /* * Defines parameters for tcp connection pooling */ - @JsonProperty(value = "tcpConnectionPool") private TcpConnectionPool tcpConnectionPool; /** @@ -205,4 +203,55 @@ public void validate() { tcpConnectionPool().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("timeoutPolicy", this.timeoutPolicy); + jsonWriter.writeJsonField("httpRetryPolicy", this.httpRetryPolicy); + jsonWriter.writeJsonField("tcpRetryPolicy", this.tcpRetryPolicy); + jsonWriter.writeJsonField("circuitBreakerPolicy", this.circuitBreakerPolicy); + jsonWriter.writeJsonField("httpConnectionPool", this.httpConnectionPool); + jsonWriter.writeJsonField("tcpConnectionPool", this.tcpConnectionPool); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AppResiliencyProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AppResiliencyProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AppResiliencyProperties. + */ + public static AppResiliencyProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AppResiliencyProperties deserializedAppResiliencyProperties = new AppResiliencyProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("timeoutPolicy".equals(fieldName)) { + deserializedAppResiliencyProperties.timeoutPolicy = TimeoutPolicy.fromJson(reader); + } else if ("httpRetryPolicy".equals(fieldName)) { + deserializedAppResiliencyProperties.httpRetryPolicy = HttpRetryPolicy.fromJson(reader); + } else if ("tcpRetryPolicy".equals(fieldName)) { + deserializedAppResiliencyProperties.tcpRetryPolicy = TcpRetryPolicy.fromJson(reader); + } else if ("circuitBreakerPolicy".equals(fieldName)) { + deserializedAppResiliencyProperties.circuitBreakerPolicy = CircuitBreakerPolicy.fromJson(reader); + } else if ("httpConnectionPool".equals(fieldName)) { + deserializedAppResiliencyProperties.httpConnectionPool = HttpConnectionPool.fromJson(reader); + } else if ("tcpConnectionPool".equals(fieldName)) { + deserializedAppResiliencyProperties.tcpConnectionPool = TcpConnectionPool.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAppResiliencyProperties; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/AuthConfigInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/AuthConfigInner.java index 0d159392fafb..b16686e6a0ba 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/AuthConfigInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/AuthConfigInner.java @@ -7,13 +7,16 @@ 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.appcontainers.models.AuthPlatform; import com.azure.resourcemanager.appcontainers.models.EncryptionSettings; import com.azure.resourcemanager.appcontainers.models.GlobalValidation; import com.azure.resourcemanager.appcontainers.models.HttpSettings; import com.azure.resourcemanager.appcontainers.models.IdentityProviders; import com.azure.resourcemanager.appcontainers.models.Login; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * Configuration settings for the Azure ContainerApp Service Authentication / Authorization feature. @@ -23,15 +26,28 @@ public final class AuthConfigInner extends ProxyResource { /* * AuthConfig resource specific properties */ - @JsonProperty(value = "properties") private AuthConfigProperties innerProperties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + /** * Creates an instance of AuthConfigInner class. */ @@ -56,6 +72,36 @@ public SystemData systemData() { return this.systemData; } + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + /** * Get the platform property: The configuration settings of the platform of ContainerApp Service * Authentication/Authorization. @@ -216,4 +262,49 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AuthConfigInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AuthConfigInner 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 AuthConfigInner. + */ + public static AuthConfigInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AuthConfigInner deserializedAuthConfigInner = new AuthConfigInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAuthConfigInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAuthConfigInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAuthConfigInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedAuthConfigInner.innerProperties = AuthConfigProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedAuthConfigInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAuthConfigInner; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/AuthConfigProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/AuthConfigProperties.java index 2dd5af9254bd..8cf1dcb0353c 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/AuthConfigProperties.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/AuthConfigProperties.java @@ -5,57 +5,55 @@ package com.azure.resourcemanager.appcontainers.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.appcontainers.models.AuthPlatform; import com.azure.resourcemanager.appcontainers.models.EncryptionSettings; import com.azure.resourcemanager.appcontainers.models.GlobalValidation; import com.azure.resourcemanager.appcontainers.models.HttpSettings; import com.azure.resourcemanager.appcontainers.models.IdentityProviders; import com.azure.resourcemanager.appcontainers.models.Login; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * AuthConfig resource specific properties. */ @Fluent -public final class AuthConfigProperties { +public final class AuthConfigProperties implements JsonSerializable { /* * The configuration settings of the platform of ContainerApp Service Authentication/Authorization. */ - @JsonProperty(value = "platform") private AuthPlatform platform; /* * The configuration settings that determines the validation flow of users using Service * Authentication/Authorization. */ - @JsonProperty(value = "globalValidation") private GlobalValidation globalValidation; /* * The configuration settings of each of the identity providers used to configure ContainerApp Service * Authentication/Authorization. */ - @JsonProperty(value = "identityProviders") private IdentityProviders identityProviders; /* * The configuration settings of the login flow of users using ContainerApp Service Authentication/Authorization. */ - @JsonProperty(value = "login") private Login login; /* * The configuration settings of the HTTP requests for authentication and authorization requests made against * ContainerApp Service Authentication/Authorization. */ - @JsonProperty(value = "httpSettings") private HttpSettings httpSettings; /* * The configuration settings of the secrets references of encryption key and signing key for ContainerApp Service * Authentication/Authorization. */ - @JsonProperty(value = "encryptionSettings") private EncryptionSettings encryptionSettings; /** @@ -221,4 +219,55 @@ public void validate() { encryptionSettings().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("platform", this.platform); + jsonWriter.writeJsonField("globalValidation", this.globalValidation); + jsonWriter.writeJsonField("identityProviders", this.identityProviders); + jsonWriter.writeJsonField("login", this.login); + jsonWriter.writeJsonField("httpSettings", this.httpSettings); + jsonWriter.writeJsonField("encryptionSettings", this.encryptionSettings); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AuthConfigProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AuthConfigProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AuthConfigProperties. + */ + public static AuthConfigProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AuthConfigProperties deserializedAuthConfigProperties = new AuthConfigProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("platform".equals(fieldName)) { + deserializedAuthConfigProperties.platform = AuthPlatform.fromJson(reader); + } else if ("globalValidation".equals(fieldName)) { + deserializedAuthConfigProperties.globalValidation = GlobalValidation.fromJson(reader); + } else if ("identityProviders".equals(fieldName)) { + deserializedAuthConfigProperties.identityProviders = IdentityProviders.fromJson(reader); + } else if ("login".equals(fieldName)) { + deserializedAuthConfigProperties.login = Login.fromJson(reader); + } else if ("httpSettings".equals(fieldName)) { + deserializedAuthConfigProperties.httpSettings = HttpSettings.fromJson(reader); + } else if ("encryptionSettings".equals(fieldName)) { + deserializedAuthConfigProperties.encryptionSettings = EncryptionSettings.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAuthConfigProperties; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/AvailableWorkloadProfileInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/AvailableWorkloadProfileInner.java index 6128ac450991..f9310eeee842 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/AvailableWorkloadProfileInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/AvailableWorkloadProfileInner.java @@ -7,8 +7,11 @@ 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.appcontainers.models.AvailableWorkloadProfileProperties; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * A workload profile with specific hardware configure to run container apps. @@ -18,21 +21,33 @@ public final class AvailableWorkloadProfileInner extends ProxyResource { /* * Region of the workload profile. */ - @JsonProperty(value = "location") private String location; /* * Revision resource specific properties */ - @JsonProperty(value = "properties") private AvailableWorkloadProfileProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + /** * Creates an instance of AvailableWorkloadProfileInner class. */ @@ -88,6 +103,36 @@ public SystemData systemData() { return this.systemData; } + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + /** * Validates the instance. * @@ -98,4 +143,54 @@ public void validate() { properties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AvailableWorkloadProfileInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AvailableWorkloadProfileInner 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 AvailableWorkloadProfileInner. + */ + public static AvailableWorkloadProfileInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AvailableWorkloadProfileInner deserializedAvailableWorkloadProfileInner + = new AvailableWorkloadProfileInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAvailableWorkloadProfileInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAvailableWorkloadProfileInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAvailableWorkloadProfileInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedAvailableWorkloadProfileInner.location = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedAvailableWorkloadProfileInner.properties + = AvailableWorkloadProfileProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedAvailableWorkloadProfileInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAvailableWorkloadProfileInner; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/BillingMeterCollectionInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/BillingMeterCollectionInner.java index 9508a6498f6e..b6befebdd3fa 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/BillingMeterCollectionInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/BillingMeterCollectionInner.java @@ -6,19 +6,22 @@ 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.appcontainers.models.BillingMeter; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * Collection of billing meters. */ @Fluent -public final class BillingMeterCollectionInner { +public final class BillingMeterCollectionInner implements JsonSerializable { /* * Collection of billing meters. */ - @JsonProperty(value = "value", required = true) private List value; /** @@ -54,12 +57,51 @@ public BillingMeterCollectionInner withValue(List value) { */ public void validate() { if (value() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property value in model BillingMeterCollectionInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model BillingMeterCollectionInner")); } else { value().forEach(e -> e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(BillingMeterCollectionInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BillingMeterCollectionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BillingMeterCollectionInner 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 BillingMeterCollectionInner. + */ + public static BillingMeterCollectionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BillingMeterCollectionInner deserializedBillingMeterCollectionInner = new BillingMeterCollectionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> BillingMeter.fromJson(reader1)); + deserializedBillingMeterCollectionInner.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedBillingMeterCollectionInner; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/BuildProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/BuildProperties.java index 3c9bb1a04b35..64c39b9e155d 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/BuildProperties.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/BuildProperties.java @@ -5,57 +5,54 @@ package com.azure.resourcemanager.appcontainers.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.appcontainers.models.BuildConfiguration; import com.azure.resourcemanager.appcontainers.models.BuildProvisioningState; import com.azure.resourcemanager.appcontainers.models.BuildStatus; import com.azure.resourcemanager.appcontainers.models.ContainerRegistryWithCustomImage; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * The build properties. */ @Fluent -public final class BuildProperties { +public final class BuildProperties implements JsonSerializable { /* * Build provisioning state. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private BuildProvisioningState provisioningState; /* * Status of the build once it has been provisioned. */ - @JsonProperty(value = "buildStatus", access = JsonProperty.Access.WRITE_ONLY) private BuildStatus buildStatus; /* * Container registry that the final image will be uploaded to. */ - @JsonProperty(value = "destinationContainerRegistry") private ContainerRegistryWithCustomImage destinationContainerRegistry; /* * Configuration of the build. */ - @JsonProperty(value = "configuration") private BuildConfiguration configuration; /* * Endpoint to which the source code should be uploaded. */ - @JsonProperty(value = "uploadEndpoint", access = JsonProperty.Access.WRITE_ONLY) private String uploadEndpoint; /* * Endpoint from which the build logs can be streamed. */ - @JsonProperty(value = "logStreamEndpoint", access = JsonProperty.Access.WRITE_ONLY) private String logStreamEndpoint; /* * Endpoint to use to retrieve an authentication token for log streaming and uploading source code. */ - @JsonProperty(value = "tokenEndpoint", access = JsonProperty.Access.WRITE_ONLY) private String tokenEndpoint; /** @@ -164,4 +161,55 @@ public void validate() { configuration().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("destinationContainerRegistry", this.destinationContainerRegistry); + jsonWriter.writeJsonField("configuration", this.configuration); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BuildProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BuildProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the BuildProperties. + */ + public static BuildProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BuildProperties deserializedBuildProperties = new BuildProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedBuildProperties.provisioningState + = BuildProvisioningState.fromString(reader.getString()); + } else if ("buildStatus".equals(fieldName)) { + deserializedBuildProperties.buildStatus = BuildStatus.fromString(reader.getString()); + } else if ("destinationContainerRegistry".equals(fieldName)) { + deserializedBuildProperties.destinationContainerRegistry + = ContainerRegistryWithCustomImage.fromJson(reader); + } else if ("configuration".equals(fieldName)) { + deserializedBuildProperties.configuration = BuildConfiguration.fromJson(reader); + } else if ("uploadEndpoint".equals(fieldName)) { + deserializedBuildProperties.uploadEndpoint = reader.getString(); + } else if ("logStreamEndpoint".equals(fieldName)) { + deserializedBuildProperties.logStreamEndpoint = reader.getString(); + } else if ("tokenEndpoint".equals(fieldName)) { + deserializedBuildProperties.tokenEndpoint = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedBuildProperties; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/BuildResourceInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/BuildResourceInner.java index 8ce6df5eb20d..fa0fd7d6977e 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/BuildResourceInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/BuildResourceInner.java @@ -7,11 +7,14 @@ 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.appcontainers.models.BuildConfiguration; import com.azure.resourcemanager.appcontainers.models.BuildProvisioningState; import com.azure.resourcemanager.appcontainers.models.BuildStatus; import com.azure.resourcemanager.appcontainers.models.ContainerRegistryWithCustomImage; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * Information pertaining to an individual build. @@ -21,15 +24,28 @@ public final class BuildResourceInner extends ProxyResource { /* * The resource-specific properties for this resource. */ - @JsonProperty(value = "properties") private BuildProperties innerProperties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + /** * Creates an instance of BuildResourceInner class. */ @@ -54,6 +70,36 @@ public SystemData systemData() { return this.systemData; } + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + /** * Get the provisioningState property: Build provisioning state. * @@ -157,4 +203,49 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BuildResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BuildResourceInner 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 BuildResourceInner. + */ + public static BuildResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BuildResourceInner deserializedBuildResourceInner = new BuildResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedBuildResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedBuildResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedBuildResourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedBuildResourceInner.innerProperties = BuildProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedBuildResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedBuildResourceInner; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/BuildTokenInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/BuildTokenInner.java index 8596ee973061..d3488fefeb98 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/BuildTokenInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/BuildTokenInner.java @@ -5,24 +5,27 @@ package com.azure.resourcemanager.appcontainers.fluent.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +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; /** * Build Auth Token. */ @Immutable -public final class BuildTokenInner { +public final class BuildTokenInner implements JsonSerializable { /* * Authentication token. */ - @JsonProperty(value = "token", access = JsonProperty.Access.WRITE_ONLY) private String token; /* * Token expiration date. */ - @JsonProperty(value = "expires", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime expires; /** @@ -56,4 +59,42 @@ public OffsetDateTime expires() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BuildTokenInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BuildTokenInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the BuildTokenInner. + */ + public static BuildTokenInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BuildTokenInner deserializedBuildTokenInner = new BuildTokenInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("token".equals(fieldName)) { + deserializedBuildTokenInner.token = reader.getString(); + } else if ("expires".equals(fieldName)) { + deserializedBuildTokenInner.expires = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedBuildTokenInner; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/BuilderProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/BuilderProperties.java index 4004bc345160..b1e954cd7a76 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/BuilderProperties.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/BuilderProperties.java @@ -6,32 +6,33 @@ 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.appcontainers.models.BuilderProvisioningState; import com.azure.resourcemanager.appcontainers.models.ContainerRegistry; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * The builder properties. */ @Fluent -public final class BuilderProperties { +public final class BuilderProperties implements JsonSerializable { /* * Provisioning state of a builder resource. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private BuilderProvisioningState provisioningState; /* * Resource ID of the container apps environment that the builder is associated with. */ - @JsonProperty(value = "environmentId", required = true) private String environmentId; /* * List of mappings of container registries and the managed identity used to connect to it. */ - @JsonProperty(value = "containerRegistries") private List containerRegistries; /** @@ -100,8 +101,9 @@ public BuilderProperties withContainerRegistries(List contain */ public void validate() { if (environmentId() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property environmentId in model BuilderProperties")); + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property environmentId in model BuilderProperties")); } if (containerRegistries() != null) { containerRegistries().forEach(e -> e.validate()); @@ -109,4 +111,50 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(BuilderProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("environmentId", this.environmentId); + jsonWriter.writeArrayField("containerRegistries", this.containerRegistries, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BuilderProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BuilderProperties 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 BuilderProperties. + */ + public static BuilderProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BuilderProperties deserializedBuilderProperties = new BuilderProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("environmentId".equals(fieldName)) { + deserializedBuilderProperties.environmentId = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedBuilderProperties.provisioningState + = BuilderProvisioningState.fromString(reader.getString()); + } else if ("containerRegistries".equals(fieldName)) { + List containerRegistries + = reader.readArray(reader1 -> ContainerRegistry.fromJson(reader1)); + deserializedBuilderProperties.containerRegistries = containerRegistries; + } else { + reader.skipChildren(); + } + } + + return deserializedBuilderProperties; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/BuilderResourceInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/BuilderResourceInner.java index 2d0f6e77c3e0..4b6e2997a102 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/BuilderResourceInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/BuilderResourceInner.java @@ -7,10 +7,13 @@ 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.appcontainers.models.BuilderProvisioningState; import com.azure.resourcemanager.appcontainers.models.ContainerRegistry; import com.azure.resourcemanager.appcontainers.models.ManagedServiceIdentity; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; import java.util.Map; @@ -22,21 +25,33 @@ public final class BuilderResourceInner extends Resource { /* * The resource-specific properties for this resource. */ - @JsonProperty(value = "properties") private BuilderProperties innerProperties; /* * The managed service identities assigned to this resource. */ - @JsonProperty(value = "identity") private ManagedServiceIdentity identity; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + /** * Creates an instance of BuilderResourceInner class. */ @@ -81,6 +96,36 @@ public SystemData systemData() { return this.systemData; } + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + /** * {@inheritDoc} */ @@ -171,4 +216,59 @@ public void validate() { identity().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.innerProperties); + jsonWriter.writeJsonField("identity", this.identity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BuilderResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BuilderResourceInner 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 BuilderResourceInner. + */ + public static BuilderResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BuilderResourceInner deserializedBuilderResourceInner = new BuilderResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedBuilderResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedBuilderResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedBuilderResourceInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedBuilderResourceInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedBuilderResourceInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedBuilderResourceInner.innerProperties = BuilderProperties.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedBuilderResourceInner.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedBuilderResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedBuilderResourceInner; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/BuilderResourceUpdateProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/BuilderResourceUpdateProperties.java index 8c94193aa04f..6e9a2c27bee2 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/BuilderResourceUpdateProperties.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/BuilderResourceUpdateProperties.java @@ -5,17 +5,20 @@ package com.azure.resourcemanager.appcontainers.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The updatable properties of the BuilderResource. */ @Fluent -public final class BuilderResourceUpdateProperties { +public final class BuilderResourceUpdateProperties implements JsonSerializable { /* * Resource ID of the container apps environment that the builder is associated with. */ - @JsonProperty(value = "environmentId") private String environmentId; /** @@ -53,4 +56,41 @@ public BuilderResourceUpdateProperties withEnvironmentId(String environmentId) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("environmentId", this.environmentId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BuilderResourceUpdateProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BuilderResourceUpdateProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the BuilderResourceUpdateProperties. + */ + public static BuilderResourceUpdateProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BuilderResourceUpdateProperties deserializedBuilderResourceUpdateProperties + = new BuilderResourceUpdateProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("environmentId".equals(fieldName)) { + deserializedBuilderResourceUpdateProperties.environmentId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedBuilderResourceUpdateProperties; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/CertificateInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/CertificateInner.java index 99659aa96409..01cf61b4834d 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/CertificateInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/CertificateInner.java @@ -7,8 +7,11 @@ 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.appcontainers.models.CertificateProperties; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.Map; /** @@ -19,15 +22,28 @@ public final class CertificateInner extends Resource { /* * Certificate resource specific properties */ - @JsonProperty(value = "properties") private CertificateProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + /** * Creates an instance of CertificateInner class. */ @@ -63,6 +79,36 @@ public SystemData systemData() { return this.systemData; } + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + /** * {@inheritDoc} */ @@ -91,4 +137,56 @@ public void validate() { 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 CertificateInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CertificateInner 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 CertificateInner. + */ + public static CertificateInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CertificateInner deserializedCertificateInner = new CertificateInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedCertificateInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedCertificateInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedCertificateInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedCertificateInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedCertificateInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedCertificateInner.properties = CertificateProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedCertificateInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCertificateInner; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/CheckNameAvailabilityResponseInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/CheckNameAvailabilityResponseInner.java index 6e67b71c3fc5..56fc0492ebf6 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/CheckNameAvailabilityResponseInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/CheckNameAvailabilityResponseInner.java @@ -5,30 +5,31 @@ package com.azure.resourcemanager.appcontainers.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.appcontainers.models.CheckNameAvailabilityReason; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * The check availability result. */ @Fluent -public final class CheckNameAvailabilityResponseInner { +public final class CheckNameAvailabilityResponseInner implements JsonSerializable { /* * Indicates if the resource name is available. */ - @JsonProperty(value = "nameAvailable") private Boolean nameAvailable; /* * The reason why the given name is not available. */ - @JsonProperty(value = "reason") private CheckNameAvailabilityReason reason; /* * Detailed reason why the given name is available. */ - @JsonProperty(value = "message") private String message; /** @@ -104,4 +105,49 @@ public CheckNameAvailabilityResponseInner withMessage(String message) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("nameAvailable", this.nameAvailable); + jsonWriter.writeStringField("reason", this.reason == null ? null : this.reason.toString()); + jsonWriter.writeStringField("message", this.message); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CheckNameAvailabilityResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CheckNameAvailabilityResponseInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CheckNameAvailabilityResponseInner. + */ + public static CheckNameAvailabilityResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CheckNameAvailabilityResponseInner deserializedCheckNameAvailabilityResponseInner + = new CheckNameAvailabilityResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nameAvailable".equals(fieldName)) { + deserializedCheckNameAvailabilityResponseInner.nameAvailable + = reader.getNullable(JsonReader::getBoolean); + } else if ("reason".equals(fieldName)) { + deserializedCheckNameAvailabilityResponseInner.reason + = CheckNameAvailabilityReason.fromString(reader.getString()); + } else if ("message".equals(fieldName)) { + deserializedCheckNameAvailabilityResponseInner.message = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCheckNameAvailabilityResponseInner; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ConnectedEnvironmentInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ConnectedEnvironmentInner.java index 79a0b8bbeb9d..bc953e917c09 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ConnectedEnvironmentInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ConnectedEnvironmentInner.java @@ -7,10 +7,13 @@ 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.appcontainers.models.ConnectedEnvironmentProvisioningState; import com.azure.resourcemanager.appcontainers.models.CustomDomainConfiguration; import com.azure.resourcemanager.appcontainers.models.ExtendedLocation; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.Map; /** @@ -21,21 +24,33 @@ public final class ConnectedEnvironmentInner extends Resource { /* * The complex type of the extended location. */ - @JsonProperty(value = "extendedLocation") private ExtendedLocation extendedLocation; /* * ConnectedEnvironment resource specific properties */ - @JsonProperty(value = "properties") private ConnectedEnvironmentProperties innerProperties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + /** * Creates an instance of ConnectedEnvironmentInner class. */ @@ -80,6 +95,36 @@ public SystemData systemData() { return this.systemData; } + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + /** * {@inheritDoc} */ @@ -149,8 +194,8 @@ public ConnectedEnvironmentInner withStaticIp(String staticIp) { } /** - * Get the daprAIConnectionString property: Application Insights connection string used by Dapr to export Service - * to Service communication telemetry. + * Get the daprAIConnectionString property: Application Insights connection string used by Dapr to export Service to + * Service communication telemetry. * * @return the daprAIConnectionString value. */ @@ -159,8 +204,8 @@ public String daprAIConnectionString() { } /** - * Set the daprAIConnectionString property: Application Insights connection string used by Dapr to export Service - * to Service communication telemetry. + * Set the daprAIConnectionString property: Application Insights connection string used by Dapr to export Service to + * Service communication telemetry. * * @param daprAIConnectionString the daprAIConnectionString value to set. * @return the ConnectedEnvironmentInner object itself. @@ -210,4 +255,60 @@ public void validate() { innerProperties().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("extendedLocation", this.extendedLocation); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectedEnvironmentInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectedEnvironmentInner 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 ConnectedEnvironmentInner. + */ + public static ConnectedEnvironmentInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectedEnvironmentInner deserializedConnectedEnvironmentInner = new ConnectedEnvironmentInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedConnectedEnvironmentInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedConnectedEnvironmentInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedConnectedEnvironmentInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedConnectedEnvironmentInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedConnectedEnvironmentInner.withTags(tags); + } else if ("extendedLocation".equals(fieldName)) { + deserializedConnectedEnvironmentInner.extendedLocation = ExtendedLocation.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedConnectedEnvironmentInner.innerProperties + = ConnectedEnvironmentProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedConnectedEnvironmentInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedConnectedEnvironmentInner; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ConnectedEnvironmentProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ConnectedEnvironmentProperties.java index f9eb45032dfc..b05be5ed6c4a 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ConnectedEnvironmentProperties.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ConnectedEnvironmentProperties.java @@ -5,49 +5,47 @@ package com.azure.resourcemanager.appcontainers.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.appcontainers.models.ConnectedEnvironmentProvisioningState; import com.azure.resourcemanager.appcontainers.models.CustomDomainConfiguration; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * ConnectedEnvironment resource specific properties. */ @Fluent -public final class ConnectedEnvironmentProperties { +public final class ConnectedEnvironmentProperties implements JsonSerializable { /* * Provisioning state of the Kubernetes Environment. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private ConnectedEnvironmentProvisioningState provisioningState; /* * Any errors that occurred during deployment or deployment validation */ - @JsonProperty(value = "deploymentErrors", access = JsonProperty.Access.WRITE_ONLY) private String deploymentErrors; /* * Default Domain Name for the cluster */ - @JsonProperty(value = "defaultDomain", access = JsonProperty.Access.WRITE_ONLY) private String defaultDomain; /* * Static IP of the connectedEnvironment */ - @JsonProperty(value = "staticIp") private String staticIp; /* * Application Insights connection string used by Dapr to export Service to Service communication telemetry */ - @JsonProperty(value = "daprAIConnectionString") private String daprAIConnectionString; /* * Custom domain configuration for the environment */ - @JsonProperty(value = "customDomainConfiguration") private CustomDomainConfiguration customDomainConfiguration; /** @@ -104,8 +102,8 @@ public ConnectedEnvironmentProperties withStaticIp(String staticIp) { } /** - * Get the daprAIConnectionString property: Application Insights connection string used by Dapr to export Service - * to Service communication telemetry. + * Get the daprAIConnectionString property: Application Insights connection string used by Dapr to export Service to + * Service communication telemetry. * * @return the daprAIConnectionString value. */ @@ -114,8 +112,8 @@ public String daprAIConnectionString() { } /** - * Set the daprAIConnectionString property: Application Insights connection string used by Dapr to export Service - * to Service communication telemetry. + * Set the daprAIConnectionString property: Application Insights connection string used by Dapr to export Service to + * Service communication telemetry. * * @param daprAIConnectionString the daprAIConnectionString value to set. * @return the ConnectedEnvironmentProperties object itself. @@ -156,4 +154,55 @@ public void validate() { customDomainConfiguration().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("staticIp", this.staticIp); + jsonWriter.writeStringField("daprAIConnectionString", this.daprAIConnectionString); + jsonWriter.writeJsonField("customDomainConfiguration", this.customDomainConfiguration); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectedEnvironmentProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectedEnvironmentProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ConnectedEnvironmentProperties. + */ + public static ConnectedEnvironmentProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectedEnvironmentProperties deserializedConnectedEnvironmentProperties + = new ConnectedEnvironmentProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedConnectedEnvironmentProperties.provisioningState + = ConnectedEnvironmentProvisioningState.fromString(reader.getString()); + } else if ("deploymentErrors".equals(fieldName)) { + deserializedConnectedEnvironmentProperties.deploymentErrors = reader.getString(); + } else if ("defaultDomain".equals(fieldName)) { + deserializedConnectedEnvironmentProperties.defaultDomain = reader.getString(); + } else if ("staticIp".equals(fieldName)) { + deserializedConnectedEnvironmentProperties.staticIp = reader.getString(); + } else if ("daprAIConnectionString".equals(fieldName)) { + deserializedConnectedEnvironmentProperties.daprAIConnectionString = reader.getString(); + } else if ("customDomainConfiguration".equals(fieldName)) { + deserializedConnectedEnvironmentProperties.customDomainConfiguration + = CustomDomainConfiguration.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedConnectedEnvironmentProperties; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ConnectedEnvironmentStorageInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ConnectedEnvironmentStorageInner.java index 0e97178c9c54..f943b169576b 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ConnectedEnvironmentStorageInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ConnectedEnvironmentStorageInner.java @@ -7,8 +7,11 @@ 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.appcontainers.models.ConnectedEnvironmentStorageProperties; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * Storage resource for connectedEnvironment. @@ -18,15 +21,28 @@ public final class ConnectedEnvironmentStorageInner extends ProxyResource { /* * Storage properties */ - @JsonProperty(value = "properties") private ConnectedEnvironmentStorageProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + /** * Creates an instance of ConnectedEnvironmentStorageInner class. */ @@ -62,6 +78,36 @@ public SystemData systemData() { return this.systemData; } + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + /** * Validates the instance. * @@ -72,4 +118,51 @@ public void validate() { 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 ConnectedEnvironmentStorageInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectedEnvironmentStorageInner 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 ConnectedEnvironmentStorageInner. + */ + public static ConnectedEnvironmentStorageInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectedEnvironmentStorageInner deserializedConnectedEnvironmentStorageInner + = new ConnectedEnvironmentStorageInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedConnectedEnvironmentStorageInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedConnectedEnvironmentStorageInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedConnectedEnvironmentStorageInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedConnectedEnvironmentStorageInner.properties + = ConnectedEnvironmentStorageProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedConnectedEnvironmentStorageInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedConnectedEnvironmentStorageInner; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ConnectedEnvironmentStoragesCollectionInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ConnectedEnvironmentStoragesCollectionInner.java index 53bca84c6d61..167013bff41c 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ConnectedEnvironmentStoragesCollectionInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ConnectedEnvironmentStoragesCollectionInner.java @@ -6,18 +6,22 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.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; /** * Collection of Storage for Environments. */ @Fluent -public final class ConnectedEnvironmentStoragesCollectionInner { +public final class ConnectedEnvironmentStoragesCollectionInner + implements JsonSerializable { /* * Collection of storage resources. */ - @JsonProperty(value = "value", required = true) private List value; /** @@ -53,12 +57,53 @@ public ConnectedEnvironmentStoragesCollectionInner withValue(List e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(ConnectedEnvironmentStoragesCollectionInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectedEnvironmentStoragesCollectionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectedEnvironmentStoragesCollectionInner 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 ConnectedEnvironmentStoragesCollectionInner. + */ + public static ConnectedEnvironmentStoragesCollectionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectedEnvironmentStoragesCollectionInner deserializedConnectedEnvironmentStoragesCollectionInner + = new ConnectedEnvironmentStoragesCollectionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ConnectedEnvironmentStorageInner.fromJson(reader1)); + deserializedConnectedEnvironmentStoragesCollectionInner.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedConnectedEnvironmentStoragesCollectionInner; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ContainerAppAuthTokenInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ContainerAppAuthTokenInner.java index e2661b263dd2..8a7c302a3104 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ContainerAppAuthTokenInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ContainerAppAuthTokenInner.java @@ -7,7 +7,10 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; import com.azure.core.management.SystemData; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; import java.util.Map; @@ -19,15 +22,28 @@ public final class ContainerAppAuthTokenInner extends Resource { /* * Container App auth token resource specific properties */ - @JsonProperty(value = "properties") private ContainerAppAuthTokenProperties innerProperties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + /** * Creates an instance of ContainerAppAuthTokenInner class. */ @@ -52,6 +68,36 @@ public SystemData systemData() { return this.systemData; } + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + /** * {@inheritDoc} */ @@ -98,4 +144,57 @@ public void validate() { innerProperties().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.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerAppAuthTokenInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerAppAuthTokenInner 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 ContainerAppAuthTokenInner. + */ + public static ContainerAppAuthTokenInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerAppAuthTokenInner deserializedContainerAppAuthTokenInner = new ContainerAppAuthTokenInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedContainerAppAuthTokenInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedContainerAppAuthTokenInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedContainerAppAuthTokenInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedContainerAppAuthTokenInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedContainerAppAuthTokenInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedContainerAppAuthTokenInner.innerProperties + = ContainerAppAuthTokenProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedContainerAppAuthTokenInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedContainerAppAuthTokenInner; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ContainerAppAuthTokenProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ContainerAppAuthTokenProperties.java index d37fd5424101..bdd867f58da3 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ContainerAppAuthTokenProperties.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ContainerAppAuthTokenProperties.java @@ -5,24 +5,27 @@ package com.azure.resourcemanager.appcontainers.fluent.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +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; /** * Container App auth token resource specific properties. */ @Immutable -public final class ContainerAppAuthTokenProperties { +public final class ContainerAppAuthTokenProperties implements JsonSerializable { /* * Auth token value. */ - @JsonProperty(value = "token", access = JsonProperty.Access.WRITE_ONLY) private String token; /* * Token expiration date. */ - @JsonProperty(value = "expires", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime expires; /** @@ -56,4 +59,43 @@ public OffsetDateTime expires() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerAppAuthTokenProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerAppAuthTokenProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ContainerAppAuthTokenProperties. + */ + public static ContainerAppAuthTokenProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerAppAuthTokenProperties deserializedContainerAppAuthTokenProperties + = new ContainerAppAuthTokenProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("token".equals(fieldName)) { + deserializedContainerAppAuthTokenProperties.token = reader.getString(); + } else if ("expires".equals(fieldName)) { + deserializedContainerAppAuthTokenProperties.expires = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedContainerAppAuthTokenProperties; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ContainerAppInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ContainerAppInner.java index a51478dfb1d9..2c54bd67db6d 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ContainerAppInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ContainerAppInner.java @@ -7,12 +7,17 @@ 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.appcontainers.models.Configuration; +import com.azure.resourcemanager.appcontainers.models.ContainerAppPropertiesPatchingConfiguration; import com.azure.resourcemanager.appcontainers.models.ContainerAppProvisioningState; import com.azure.resourcemanager.appcontainers.models.ExtendedLocation; +import com.azure.resourcemanager.appcontainers.models.Kind; import com.azure.resourcemanager.appcontainers.models.ManagedServiceIdentity; import com.azure.resourcemanager.appcontainers.models.Template; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; import java.util.Map; @@ -24,36 +29,52 @@ public final class ContainerAppInner extends Resource { /* * The complex type of the extended location. */ - @JsonProperty(value = "extendedLocation") private ExtendedLocation extendedLocation; /* - * managed identities for the Container App to interact with other Azure services without maintaining any secrets - * or credentials in code. + * managed identities for the Container App to interact with other Azure services without maintaining any secrets or + * credentials in code. */ - @JsonProperty(value = "identity") private ManagedServiceIdentity identity; /* - * The fully qualified resource ID of the resource that manages this resource. Indicates if this resource is - * managed by another Azure resource. If this is present, complete mode deployment will not delete the resource if - * it is removed from the template since it is managed by another resource. + * The fully qualified resource ID of the resource that manages this resource. Indicates if this resource is managed + * by another Azure resource. If this is present, complete mode deployment will not delete the resource if it is + * removed from the template since it is managed by another resource. */ - @JsonProperty(value = "managedBy") private String managedBy; + /* + * Metadata used to render different experiences for resources of the same type; e.g. WorkflowApp is a kind of + * Microsoft.App/ContainerApps type. If supported, the resource provider must validate and persist this value. + */ + private Kind kind; + /* * ContainerApp resource specific properties */ - @JsonProperty(value = "properties") private ContainerAppProperties innerProperties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + /** * Creates an instance of ContainerAppInner class. */ @@ -81,8 +102,8 @@ public ContainerAppInner withExtendedLocation(ExtendedLocation extendedLocation) } /** - * Get the identity property: managed identities for the Container App to interact with other Azure services - * without maintaining any secrets or credentials in code. + * Get the identity property: managed identities for the Container App to interact with other Azure services without + * maintaining any secrets or credentials in code. * * @return the identity value. */ @@ -91,8 +112,8 @@ public ManagedServiceIdentity identity() { } /** - * Set the identity property: managed identities for the Container App to interact with other Azure services - * without maintaining any secrets or credentials in code. + * Set the identity property: managed identities for the Container App to interact with other Azure services without + * maintaining any secrets or credentials in code. * * @param identity the identity value to set. * @return the ContainerAppInner object itself. @@ -103,9 +124,9 @@ public ContainerAppInner withIdentity(ManagedServiceIdentity identity) { } /** - * Get the managedBy property: The fully qualified resource ID of the resource that manages this resource. - * Indicates if this resource is managed by another Azure resource. If this is present, complete mode deployment - * will not delete the resource if it is removed from the template since it is managed by another resource. + * Get the managedBy property: The fully qualified resource ID of the resource that manages this resource. Indicates + * if this resource is managed by another Azure resource. If this is present, complete mode deployment will not + * delete the resource if it is removed from the template since it is managed by another resource. * * @return the managedBy value. */ @@ -114,9 +135,9 @@ public String managedBy() { } /** - * Set the managedBy property: The fully qualified resource ID of the resource that manages this resource. - * Indicates if this resource is managed by another Azure resource. If this is present, complete mode deployment - * will not delete the resource if it is removed from the template since it is managed by another resource. + * Set the managedBy property: The fully qualified resource ID of the resource that manages this resource. Indicates + * if this resource is managed by another Azure resource. If this is present, complete mode deployment will not + * delete the resource if it is removed from the template since it is managed by another resource. * * @param managedBy the managedBy value to set. * @return the ContainerAppInner object itself. @@ -126,6 +147,30 @@ public ContainerAppInner withManagedBy(String managedBy) { return this; } + /** + * Get the kind property: Metadata used to render different experiences for resources of the same type; e.g. + * WorkflowApp is a kind of Microsoft.App/ContainerApps type. If supported, the resource provider must validate and + * persist this value. + * + * @return the kind value. + */ + public Kind kind() { + return this.kind; + } + + /** + * Set the kind property: Metadata used to render different experiences for resources of the same type; e.g. + * WorkflowApp is a kind of Microsoft.App/ContainerApps type. If supported, the resource provider must validate and + * persist this value. + * + * @param kind the kind value to set. + * @return the ContainerAppInner object itself. + */ + public ContainerAppInner withKind(Kind kind) { + this.kind = kind; + return this; + } + /** * Get the innerProperties property: ContainerApp resource specific properties. * @@ -144,6 +189,36 @@ public SystemData systemData() { return this.systemData; } + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + /** * {@inheritDoc} */ @@ -240,6 +315,30 @@ public ContainerAppInner withWorkloadProfileName(String workloadProfileName) { return this; } + /** + * Get the patchingConfiguration property: Container App auto patch configuration. + * + * @return the patchingConfiguration value. + */ + public ContainerAppPropertiesPatchingConfiguration patchingConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().patchingConfiguration(); + } + + /** + * Set the patchingConfiguration property: Container App auto patch configuration. + * + * @param patchingConfiguration the patchingConfiguration value to set. + * @return the ContainerAppInner object itself. + */ + public ContainerAppInner + withPatchingConfiguration(ContainerAppPropertiesPatchingConfiguration patchingConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerAppProperties(); + } + this.innerProperties().withPatchingConfiguration(patchingConfiguration); + return this; + } + /** * Get the latestRevisionName property: Name of the latest revision of the Container App. * @@ -356,4 +455,68 @@ public void validate() { innerProperties().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("extendedLocation", this.extendedLocation); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeStringField("managedBy", this.managedBy); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerAppInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerAppInner 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 ContainerAppInner. + */ + public static ContainerAppInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerAppInner deserializedContainerAppInner = new ContainerAppInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedContainerAppInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedContainerAppInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedContainerAppInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedContainerAppInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedContainerAppInner.withTags(tags); + } else if ("extendedLocation".equals(fieldName)) { + deserializedContainerAppInner.extendedLocation = ExtendedLocation.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedContainerAppInner.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("managedBy".equals(fieldName)) { + deserializedContainerAppInner.managedBy = reader.getString(); + } else if ("kind".equals(fieldName)) { + deserializedContainerAppInner.kind = Kind.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedContainerAppInner.innerProperties = ContainerAppProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedContainerAppInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedContainerAppInner; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ContainerAppJobExecutionsInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ContainerAppJobExecutionsInner.java index be02df97a4b8..3b6331fec40d 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ContainerAppJobExecutionsInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ContainerAppJobExecutionsInner.java @@ -6,24 +6,26 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.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; /** * Container App executions collection ARM resource. */ @Fluent -public final class ContainerAppJobExecutionsInner { +public final class ContainerAppJobExecutionsInner implements JsonSerializable { /* * Collection of resources. */ - @JsonProperty(value = "value", required = true) private List value; /* * Link to next page of resources. */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; /** @@ -68,12 +70,54 @@ public String nextLink() { */ public void validate() { if (value() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property value in model ContainerAppJobExecutionsInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model ContainerAppJobExecutionsInner")); } else { value().forEach(e -> e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(ContainerAppJobExecutionsInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerAppJobExecutionsInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerAppJobExecutionsInner 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 ContainerAppJobExecutionsInner. + */ + public static ContainerAppJobExecutionsInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerAppJobExecutionsInner deserializedContainerAppJobExecutionsInner + = new ContainerAppJobExecutionsInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> JobExecutionInner.fromJson(reader1)); + deserializedContainerAppJobExecutionsInner.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedContainerAppJobExecutionsInner.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedContainerAppJobExecutionsInner; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ContainerAppProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ContainerAppProperties.java index 312d98bd745c..3276e75041e8 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ContainerAppProperties.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ContainerAppProperties.java @@ -5,87 +5,85 @@ package com.azure.resourcemanager.appcontainers.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.appcontainers.models.Configuration; +import com.azure.resourcemanager.appcontainers.models.ContainerAppPropertiesPatchingConfiguration; import com.azure.resourcemanager.appcontainers.models.ContainerAppProvisioningState; import com.azure.resourcemanager.appcontainers.models.Template; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * ContainerApp resource specific properties. */ @Fluent -public final class ContainerAppProperties { +public final class ContainerAppProperties implements JsonSerializable { /* * Provisioning state of the Container App. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private ContainerAppProvisioningState provisioningState; /* * Deprecated. Resource ID of the Container App's environment. */ - @JsonProperty(value = "managedEnvironmentId") private String managedEnvironmentId; /* * Resource ID of environment. */ - @JsonProperty(value = "environmentId") private String environmentId; /* * Workload profile name to pin for container app execution. */ - @JsonProperty(value = "workloadProfileName") private String workloadProfileName; + /* + * Container App auto patch configuration. + */ + private ContainerAppPropertiesPatchingConfiguration patchingConfiguration; + /* * Name of the latest revision of the Container App. */ - @JsonProperty(value = "latestRevisionName", access = JsonProperty.Access.WRITE_ONLY) private String latestRevisionName; /* * Name of the latest ready revision of the Container App. */ - @JsonProperty(value = "latestReadyRevisionName", access = JsonProperty.Access.WRITE_ONLY) private String latestReadyRevisionName; /* * Fully Qualified Domain Name of the latest revision of the Container App. */ - @JsonProperty(value = "latestRevisionFqdn", access = JsonProperty.Access.WRITE_ONLY) private String latestRevisionFqdn; /* * Id used to verify domain name ownership */ - @JsonProperty(value = "customDomainVerificationId", access = JsonProperty.Access.WRITE_ONLY) private String customDomainVerificationId; /* * Non versioned Container App configuration properties. */ - @JsonProperty(value = "configuration") private Configuration configuration; /* * Container App versioned application definition. */ - @JsonProperty(value = "template") private Template template; /* * Outbound IP Addresses for container app. */ - @JsonProperty(value = "outboundIpAddresses", access = JsonProperty.Access.WRITE_ONLY) private List outboundIpAddresses; /* * The endpoint of the eventstream of the container app. */ - @JsonProperty(value = "eventStreamEndpoint", access = JsonProperty.Access.WRITE_ONLY) private String eventStreamEndpoint; /** @@ -163,6 +161,27 @@ public ContainerAppProperties withWorkloadProfileName(String workloadProfileName return this; } + /** + * Get the patchingConfiguration property: Container App auto patch configuration. + * + * @return the patchingConfiguration value. + */ + public ContainerAppPropertiesPatchingConfiguration patchingConfiguration() { + return this.patchingConfiguration; + } + + /** + * Set the patchingConfiguration property: Container App auto patch configuration. + * + * @param patchingConfiguration the patchingConfiguration value to set. + * @return the ContainerAppProperties object itself. + */ + public ContainerAppProperties + withPatchingConfiguration(ContainerAppPropertiesPatchingConfiguration patchingConfiguration) { + this.patchingConfiguration = patchingConfiguration; + return this; + } + /** * Get the latestRevisionName property: Name of the latest revision of the Container App. * @@ -263,6 +282,9 @@ public String eventStreamEndpoint() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (patchingConfiguration() != null) { + patchingConfiguration().validate(); + } if (configuration() != null) { configuration().validate(); } @@ -270,4 +292,72 @@ public void validate() { template().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("managedEnvironmentId", this.managedEnvironmentId); + jsonWriter.writeStringField("environmentId", this.environmentId); + jsonWriter.writeStringField("workloadProfileName", this.workloadProfileName); + jsonWriter.writeJsonField("patchingConfiguration", this.patchingConfiguration); + jsonWriter.writeJsonField("configuration", this.configuration); + jsonWriter.writeJsonField("template", this.template); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerAppProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerAppProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ContainerAppProperties. + */ + public static ContainerAppProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerAppProperties deserializedContainerAppProperties = new ContainerAppProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedContainerAppProperties.provisioningState + = ContainerAppProvisioningState.fromString(reader.getString()); + } else if ("managedEnvironmentId".equals(fieldName)) { + deserializedContainerAppProperties.managedEnvironmentId = reader.getString(); + } else if ("environmentId".equals(fieldName)) { + deserializedContainerAppProperties.environmentId = reader.getString(); + } else if ("workloadProfileName".equals(fieldName)) { + deserializedContainerAppProperties.workloadProfileName = reader.getString(); + } else if ("patchingConfiguration".equals(fieldName)) { + deserializedContainerAppProperties.patchingConfiguration + = ContainerAppPropertiesPatchingConfiguration.fromJson(reader); + } else if ("latestRevisionName".equals(fieldName)) { + deserializedContainerAppProperties.latestRevisionName = reader.getString(); + } else if ("latestReadyRevisionName".equals(fieldName)) { + deserializedContainerAppProperties.latestReadyRevisionName = reader.getString(); + } else if ("latestRevisionFqdn".equals(fieldName)) { + deserializedContainerAppProperties.latestRevisionFqdn = reader.getString(); + } else if ("customDomainVerificationId".equals(fieldName)) { + deserializedContainerAppProperties.customDomainVerificationId = reader.getString(); + } else if ("configuration".equals(fieldName)) { + deserializedContainerAppProperties.configuration = Configuration.fromJson(reader); + } else if ("template".equals(fieldName)) { + deserializedContainerAppProperties.template = Template.fromJson(reader); + } else if ("outboundIpAddresses".equals(fieldName)) { + List outboundIpAddresses = reader.readArray(reader1 -> reader1.getString()); + deserializedContainerAppProperties.outboundIpAddresses = outboundIpAddresses; + } else if ("eventStreamEndpoint".equals(fieldName)) { + deserializedContainerAppProperties.eventStreamEndpoint = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedContainerAppProperties; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ContainerAppsBuildProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ContainerAppsBuildProperties.java new file mode 100644 index 000000000000..1c0f62c68141 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ContainerAppsBuildProperties.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.appcontainers.fluent.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.appcontainers.models.BuildProvisioningState; +import com.azure.resourcemanager.appcontainers.models.BuildStatus; +import com.azure.resourcemanager.appcontainers.models.ContainerAppsBuildConfiguration; +import com.azure.resourcemanager.appcontainers.models.ContainerRegistryWithCustomImage; +import java.io.IOException; + +/** + * The ContainerAppBuild properties. + */ +@Immutable +public final class ContainerAppsBuildProperties implements JsonSerializable { + /* + * Build provisioning state. + */ + private BuildProvisioningState provisioningState; + + /* + * Status of the build once it has been provisioned. + */ + private BuildStatus buildStatus; + + /* + * Container registry that the final image will be uploaded to. + */ + private ContainerRegistryWithCustomImage destinationContainerRegistry; + + /* + * Configuration of the build. + */ + private ContainerAppsBuildConfiguration configuration; + + /* + * Endpoint from which the build logs can be streamed. + */ + private String logStreamEndpoint; + + /** + * Creates an instance of ContainerAppsBuildProperties class. + */ + public ContainerAppsBuildProperties() { + } + + /** + * Get the provisioningState property: Build provisioning state. + * + * @return the provisioningState value. + */ + public BuildProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the buildStatus property: Status of the build once it has been provisioned. + * + * @return the buildStatus value. + */ + public BuildStatus buildStatus() { + return this.buildStatus; + } + + /** + * Get the destinationContainerRegistry property: Container registry that the final image will be uploaded to. + * + * @return the destinationContainerRegistry value. + */ + public ContainerRegistryWithCustomImage destinationContainerRegistry() { + return this.destinationContainerRegistry; + } + + /** + * Get the configuration property: Configuration of the build. + * + * @return the configuration value. + */ + public ContainerAppsBuildConfiguration configuration() { + return this.configuration; + } + + /** + * Get the logStreamEndpoint property: Endpoint from which the build logs can be streamed. + * + * @return the logStreamEndpoint value. + */ + public String logStreamEndpoint() { + return this.logStreamEndpoint; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (destinationContainerRegistry() != null) { + destinationContainerRegistry().validate(); + } + if (configuration() != null) { + configuration().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerAppsBuildProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerAppsBuildProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ContainerAppsBuildProperties. + */ + public static ContainerAppsBuildProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerAppsBuildProperties deserializedContainerAppsBuildProperties = new ContainerAppsBuildProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedContainerAppsBuildProperties.provisioningState + = BuildProvisioningState.fromString(reader.getString()); + } else if ("buildStatus".equals(fieldName)) { + deserializedContainerAppsBuildProperties.buildStatus = BuildStatus.fromString(reader.getString()); + } else if ("destinationContainerRegistry".equals(fieldName)) { + deserializedContainerAppsBuildProperties.destinationContainerRegistry + = ContainerRegistryWithCustomImage.fromJson(reader); + } else if ("configuration".equals(fieldName)) { + deserializedContainerAppsBuildProperties.configuration + = ContainerAppsBuildConfiguration.fromJson(reader); + } else if ("logStreamEndpoint".equals(fieldName)) { + deserializedContainerAppsBuildProperties.logStreamEndpoint = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedContainerAppsBuildProperties; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ContainerAppsBuildResourceInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ContainerAppsBuildResourceInner.java new file mode 100644 index 000000000000..4dc76fdf6e30 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ContainerAppsBuildResourceInner.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.appcontainers.fluent.models; + +import com.azure.core.annotation.Immutable; +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.appcontainers.models.BuildProvisioningState; +import com.azure.resourcemanager.appcontainers.models.BuildStatus; +import com.azure.resourcemanager.appcontainers.models.ContainerAppsBuildConfiguration; +import com.azure.resourcemanager.appcontainers.models.ContainerRegistryWithCustomImage; +import java.io.IOException; + +/** + * Information pertaining to an individual build. + */ +@Immutable +public final class ContainerAppsBuildResourceInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private ContainerAppsBuildProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + + /** + * Creates an instance of ContainerAppsBuildResourceInner class. + */ + public ContainerAppsBuildResourceInner() { + } + + /** + * Get the innerProperties property: The resource-specific properties for this resource. + * + * @return the innerProperties value. + */ + private ContainerAppsBuildProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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 id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the provisioningState property: Build provisioning state. + * + * @return the provisioningState value. + */ + public BuildProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the buildStatus property: Status of the build once it has been provisioned. + * + * @return the buildStatus value. + */ + public BuildStatus buildStatus() { + return this.innerProperties() == null ? null : this.innerProperties().buildStatus(); + } + + /** + * Get the destinationContainerRegistry property: Container registry that the final image will be uploaded to. + * + * @return the destinationContainerRegistry value. + */ + public ContainerRegistryWithCustomImage destinationContainerRegistry() { + return this.innerProperties() == null ? null : this.innerProperties().destinationContainerRegistry(); + } + + /** + * Get the configuration property: Configuration of the build. + * + * @return the configuration value. + */ + public ContainerAppsBuildConfiguration configuration() { + return this.innerProperties() == null ? null : this.innerProperties().configuration(); + } + + /** + * Get the logStreamEndpoint property: Endpoint from which the build logs can be streamed. + * + * @return the logStreamEndpoint value. + */ + public String logStreamEndpoint() { + return this.innerProperties() == null ? null : this.innerProperties().logStreamEndpoint(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerAppsBuildResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerAppsBuildResourceInner 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 ContainerAppsBuildResourceInner. + */ + public static ContainerAppsBuildResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerAppsBuildResourceInner deserializedContainerAppsBuildResourceInner + = new ContainerAppsBuildResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedContainerAppsBuildResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedContainerAppsBuildResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedContainerAppsBuildResourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedContainerAppsBuildResourceInner.innerProperties + = ContainerAppsBuildProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedContainerAppsBuildResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedContainerAppsBuildResourceInner; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ContainerAppsPatchResourceInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ContainerAppsPatchResourceInner.java new file mode 100644 index 000000000000..fbf172cebec6 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ContainerAppsPatchResourceInner.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.appcontainers.fluent.models; + +import com.azure.core.annotation.Immutable; +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.appcontainers.models.PatchProperties; +import java.io.IOException; + +/** + * Container App Patch. + */ +@Immutable +public final class ContainerAppsPatchResourceInner extends ProxyResource { + /* + * Properties that describes current states of the patch resource. + */ + private PatchProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + + /** + * Creates an instance of ContainerAppsPatchResourceInner class. + */ + public ContainerAppsPatchResourceInner() { + } + + /** + * Get the properties property: Properties that describes current states of the patch resource. + * + * @return the properties value. + */ + public PatchProperties properties() { + return this.properties; + } + + /** + * 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 id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * 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(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerAppsPatchResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerAppsPatchResourceInner 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 ContainerAppsPatchResourceInner. + */ + public static ContainerAppsPatchResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerAppsPatchResourceInner deserializedContainerAppsPatchResourceInner + = new ContainerAppsPatchResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedContainerAppsPatchResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedContainerAppsPatchResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedContainerAppsPatchResourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedContainerAppsPatchResourceInner.properties = PatchProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedContainerAppsPatchResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedContainerAppsPatchResourceInner; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/CustomHostnameAnalysisResultInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/CustomHostnameAnalysisResultInner.java index 4f00be750b53..823e86dc321e 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/CustomHostnameAnalysisResultInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/CustomHostnameAnalysisResultInner.java @@ -5,88 +5,80 @@ package com.azure.resourcemanager.appcontainers.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.appcontainers.models.CustomHostnameAnalysisResultCustomDomainVerificationFailureInfo; import com.azure.resourcemanager.appcontainers.models.DnsVerificationTestResult; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * Custom domain analysis. */ @Fluent -public final class CustomHostnameAnalysisResultInner { +public final class CustomHostnameAnalysisResultInner implements JsonSerializable { /* * Host name that was analyzed */ - @JsonProperty(value = "hostName", access = JsonProperty.Access.WRITE_ONLY) private String hostname; /* * true if hostname is already verified; otherwise, false. */ - @JsonProperty(value = "isHostnameAlreadyVerified", access = JsonProperty.Access.WRITE_ONLY) private Boolean isHostnameAlreadyVerified; /* * DNS verification test result. */ - @JsonProperty(value = "customDomainVerificationTest", access = JsonProperty.Access.WRITE_ONLY) private DnsVerificationTestResult customDomainVerificationTest; /* * Raw failure information if DNS verification fails. */ - @JsonProperty(value = "customDomainVerificationFailureInfo", access = JsonProperty.Access.WRITE_ONLY) private CustomHostnameAnalysisResultCustomDomainVerificationFailureInfo customDomainVerificationFailureInfo; /* * true if there is a conflict on the Container App's managed environment; otherwise, * false. */ - @JsonProperty(value = "hasConflictOnManagedEnvironment", access = JsonProperty.Access.WRITE_ONLY) private Boolean hasConflictOnManagedEnvironment; /* * true if there is a conflict on the Container App's managed environment level custom domain; * otherwise, false. */ - @JsonProperty(value = "conflictWithEnvironmentCustomDomain", access = JsonProperty.Access.WRITE_ONLY) private Boolean conflictWithEnvironmentCustomDomain; /* * Name of the conflicting Container App on the Managed Environment if it's within the same subscription. */ - @JsonProperty(value = "conflictingContainerAppResourceId", access = JsonProperty.Access.WRITE_ONLY) private String conflictingContainerAppResourceId; /* * CName records visible for this hostname. */ - @JsonProperty(value = "cNameRecords") private List cNameRecords; /* * TXT records visible for this hostname. */ - @JsonProperty(value = "txtRecords") private List txtRecords; /* * A records visible for this hostname. */ - @JsonProperty(value = "aRecords") private List aRecords; /* * Alternate CName records visible for this hostname. */ - @JsonProperty(value = "alternateCNameRecords") private List alternateCNameRecords; /* * Alternate TXT records visible for this hostname. */ - @JsonProperty(value = "alternateTxtRecords") private List alternateTxtRecords; /** @@ -143,8 +135,8 @@ public Boolean hasConflictOnManagedEnvironment() { } /** - * Get the conflictWithEnvironmentCustomDomain property: <code>true</code> if there is a conflict on - * the Container App's managed environment level custom domain; otherwise, <code>false</code>. + * Get the conflictWithEnvironmentCustomDomain property: <code>true</code> if there is a conflict on the + * Container App's managed environment level custom domain; otherwise, <code>false</code>. * * @return the conflictWithEnvironmentCustomDomain value. */ @@ -272,4 +264,80 @@ public void validate() { customDomainVerificationFailureInfo().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("cNameRecords", this.cNameRecords, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("txtRecords", this.txtRecords, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("aRecords", this.aRecords, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("alternateCNameRecords", this.alternateCNameRecords, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("alternateTxtRecords", this.alternateTxtRecords, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CustomHostnameAnalysisResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CustomHostnameAnalysisResultInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CustomHostnameAnalysisResultInner. + */ + public static CustomHostnameAnalysisResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CustomHostnameAnalysisResultInner deserializedCustomHostnameAnalysisResultInner + = new CustomHostnameAnalysisResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("hostName".equals(fieldName)) { + deserializedCustomHostnameAnalysisResultInner.hostname = reader.getString(); + } else if ("isHostnameAlreadyVerified".equals(fieldName)) { + deserializedCustomHostnameAnalysisResultInner.isHostnameAlreadyVerified + = reader.getNullable(JsonReader::getBoolean); + } else if ("customDomainVerificationTest".equals(fieldName)) { + deserializedCustomHostnameAnalysisResultInner.customDomainVerificationTest + = DnsVerificationTestResult.fromString(reader.getString()); + } else if ("customDomainVerificationFailureInfo".equals(fieldName)) { + deserializedCustomHostnameAnalysisResultInner.customDomainVerificationFailureInfo + = CustomHostnameAnalysisResultCustomDomainVerificationFailureInfo.fromJson(reader); + } else if ("hasConflictOnManagedEnvironment".equals(fieldName)) { + deserializedCustomHostnameAnalysisResultInner.hasConflictOnManagedEnvironment + = reader.getNullable(JsonReader::getBoolean); + } else if ("conflictWithEnvironmentCustomDomain".equals(fieldName)) { + deserializedCustomHostnameAnalysisResultInner.conflictWithEnvironmentCustomDomain + = reader.getNullable(JsonReader::getBoolean); + } else if ("conflictingContainerAppResourceId".equals(fieldName)) { + deserializedCustomHostnameAnalysisResultInner.conflictingContainerAppResourceId + = reader.getString(); + } else if ("cNameRecords".equals(fieldName)) { + List cNameRecords = reader.readArray(reader1 -> reader1.getString()); + deserializedCustomHostnameAnalysisResultInner.cNameRecords = cNameRecords; + } else if ("txtRecords".equals(fieldName)) { + List txtRecords = reader.readArray(reader1 -> reader1.getString()); + deserializedCustomHostnameAnalysisResultInner.txtRecords = txtRecords; + } else if ("aRecords".equals(fieldName)) { + List aRecords = reader.readArray(reader1 -> reader1.getString()); + deserializedCustomHostnameAnalysisResultInner.aRecords = aRecords; + } else if ("alternateCNameRecords".equals(fieldName)) { + List alternateCNameRecords = reader.readArray(reader1 -> reader1.getString()); + deserializedCustomHostnameAnalysisResultInner.alternateCNameRecords = alternateCNameRecords; + } else if ("alternateTxtRecords".equals(fieldName)) { + List alternateTxtRecords = reader.readArray(reader1 -> reader1.getString()); + deserializedCustomHostnameAnalysisResultInner.alternateTxtRecords = alternateTxtRecords; + } else { + reader.skipChildren(); + } + } + + return deserializedCustomHostnameAnalysisResultInner; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DaprComponentInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DaprComponentInner.java index a9dbee9bcb87..d72ca7ef778c 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DaprComponentInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DaprComponentInner.java @@ -7,10 +7,13 @@ 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.appcontainers.models.DaprComponentServiceBinding; import com.azure.resourcemanager.appcontainers.models.DaprMetadata; import com.azure.resourcemanager.appcontainers.models.Secret; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** @@ -21,15 +24,28 @@ public final class DaprComponentInner extends ProxyResource { /* * Dapr Component resource specific properties */ - @JsonProperty(value = "properties") private DaprComponentProperties innerProperties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + /** * Creates an instance of DaprComponentInner class. */ @@ -54,6 +70,36 @@ public SystemData systemData() { return this.systemData; } + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + /** * Get the componentType property: Component type. * @@ -271,4 +317,49 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DaprComponentInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DaprComponentInner 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 DaprComponentInner. + */ + public static DaprComponentInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DaprComponentInner deserializedDaprComponentInner = new DaprComponentInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedDaprComponentInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedDaprComponentInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedDaprComponentInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedDaprComponentInner.innerProperties = DaprComponentProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedDaprComponentInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDaprComponentInner; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DaprComponentProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DaprComponentProperties.java index dfe98a8c51d3..2ea651f923a4 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DaprComponentProperties.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DaprComponentProperties.java @@ -5,69 +5,64 @@ package com.azure.resourcemanager.appcontainers.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.appcontainers.models.DaprComponentServiceBinding; import com.azure.resourcemanager.appcontainers.models.DaprMetadata; import com.azure.resourcemanager.appcontainers.models.Secret; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * Dapr Component resource specific properties. */ @Fluent -public final class DaprComponentProperties { +public final class DaprComponentProperties implements JsonSerializable { /* * Component type */ - @JsonProperty(value = "componentType") private String componentType; /* * Component version */ - @JsonProperty(value = "version") private String version; /* * Boolean describing if the component errors are ignores */ - @JsonProperty(value = "ignoreErrors") private Boolean ignoreErrors; /* * Initialization timeout */ - @JsonProperty(value = "initTimeout") private String initTimeout; /* * Collection of secrets used by a Dapr component */ - @JsonProperty(value = "secrets") private List secrets; /* * Name of a Dapr component to retrieve component secrets from */ - @JsonProperty(value = "secretStoreComponent") private String secretStoreComponent; /* * Component metadata */ - @JsonProperty(value = "metadata") private List metadata; /* * Names of container apps that can use this Dapr component */ - @JsonProperty(value = "scopes") private List scopes; /* * List of container app services that are bound to the Dapr component */ - @JsonProperty(value = "serviceComponentBind") private List serviceComponentBind; /** @@ -272,4 +267,70 @@ public void validate() { serviceComponentBind().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("componentType", this.componentType); + jsonWriter.writeStringField("version", this.version); + jsonWriter.writeBooleanField("ignoreErrors", this.ignoreErrors); + jsonWriter.writeStringField("initTimeout", this.initTimeout); + jsonWriter.writeArrayField("secrets", this.secrets, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("secretStoreComponent", this.secretStoreComponent); + jsonWriter.writeArrayField("metadata", this.metadata, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("scopes", this.scopes, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("serviceComponentBind", this.serviceComponentBind, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DaprComponentProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DaprComponentProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the DaprComponentProperties. + */ + public static DaprComponentProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DaprComponentProperties deserializedDaprComponentProperties = new DaprComponentProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("componentType".equals(fieldName)) { + deserializedDaprComponentProperties.componentType = reader.getString(); + } else if ("version".equals(fieldName)) { + deserializedDaprComponentProperties.version = reader.getString(); + } else if ("ignoreErrors".equals(fieldName)) { + deserializedDaprComponentProperties.ignoreErrors = reader.getNullable(JsonReader::getBoolean); + } else if ("initTimeout".equals(fieldName)) { + deserializedDaprComponentProperties.initTimeout = reader.getString(); + } else if ("secrets".equals(fieldName)) { + List secrets = reader.readArray(reader1 -> Secret.fromJson(reader1)); + deserializedDaprComponentProperties.secrets = secrets; + } else if ("secretStoreComponent".equals(fieldName)) { + deserializedDaprComponentProperties.secretStoreComponent = reader.getString(); + } else if ("metadata".equals(fieldName)) { + List metadata = reader.readArray(reader1 -> DaprMetadata.fromJson(reader1)); + deserializedDaprComponentProperties.metadata = metadata; + } else if ("scopes".equals(fieldName)) { + List scopes = reader.readArray(reader1 -> reader1.getString()); + deserializedDaprComponentProperties.scopes = scopes; + } else if ("serviceComponentBind".equals(fieldName)) { + List serviceComponentBind + = reader.readArray(reader1 -> DaprComponentServiceBinding.fromJson(reader1)); + deserializedDaprComponentProperties.serviceComponentBind = serviceComponentBind; + } else { + reader.skipChildren(); + } + } + + return deserializedDaprComponentProperties; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DaprComponentResiliencyPolicyInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DaprComponentResiliencyPolicyInner.java index 168e53580749..4dff209498ba 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DaprComponentResiliencyPolicyInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DaprComponentResiliencyPolicyInner.java @@ -7,8 +7,11 @@ 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.appcontainers.models.DaprComponentResiliencyPolicyConfiguration; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * Dapr Component Resiliency Policy. @@ -18,15 +21,28 @@ public final class DaprComponentResiliencyPolicyInner extends ProxyResource { /* * Dapr Component Resiliency Policy resource specific properties */ - @JsonProperty(value = "properties") private DaprComponentResiliencyPolicyProperties innerProperties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + /** * Creates an instance of DaprComponentResiliencyPolicyInner class. */ @@ -51,6 +67,36 @@ public SystemData systemData() { return this.systemData; } + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + /** * Get the inboundPolicy property: The optional inbound component resiliency policy configuration. * @@ -109,4 +155,51 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DaprComponentResiliencyPolicyInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DaprComponentResiliencyPolicyInner 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 DaprComponentResiliencyPolicyInner. + */ + public static DaprComponentResiliencyPolicyInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DaprComponentResiliencyPolicyInner deserializedDaprComponentResiliencyPolicyInner + = new DaprComponentResiliencyPolicyInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedDaprComponentResiliencyPolicyInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedDaprComponentResiliencyPolicyInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedDaprComponentResiliencyPolicyInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedDaprComponentResiliencyPolicyInner.innerProperties + = DaprComponentResiliencyPolicyProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedDaprComponentResiliencyPolicyInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDaprComponentResiliencyPolicyInner; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DaprComponentResiliencyPolicyProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DaprComponentResiliencyPolicyProperties.java index 5dbc7f9b16a0..2167772c38d6 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DaprComponentResiliencyPolicyProperties.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DaprComponentResiliencyPolicyProperties.java @@ -5,24 +5,27 @@ package com.azure.resourcemanager.appcontainers.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.appcontainers.models.DaprComponentResiliencyPolicyConfiguration; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * Dapr Component Resiliency Policy resource specific properties. */ @Fluent -public final class DaprComponentResiliencyPolicyProperties { +public final class DaprComponentResiliencyPolicyProperties + implements JsonSerializable { /* * The optional inbound component resiliency policy configuration */ - @JsonProperty(value = "inboundPolicy") private DaprComponentResiliencyPolicyConfiguration inboundPolicy; /* * The optional outbound component resiliency policy configuration */ - @JsonProperty(value = "outboundPolicy") private DaprComponentResiliencyPolicyConfiguration outboundPolicy; /** @@ -86,4 +89,46 @@ public void validate() { outboundPolicy().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("inboundPolicy", this.inboundPolicy); + jsonWriter.writeJsonField("outboundPolicy", this.outboundPolicy); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DaprComponentResiliencyPolicyProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DaprComponentResiliencyPolicyProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DaprComponentResiliencyPolicyProperties. + */ + public static DaprComponentResiliencyPolicyProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DaprComponentResiliencyPolicyProperties deserializedDaprComponentResiliencyPolicyProperties + = new DaprComponentResiliencyPolicyProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("inboundPolicy".equals(fieldName)) { + deserializedDaprComponentResiliencyPolicyProperties.inboundPolicy + = DaprComponentResiliencyPolicyConfiguration.fromJson(reader); + } else if ("outboundPolicy".equals(fieldName)) { + deserializedDaprComponentResiliencyPolicyProperties.outboundPolicy + = DaprComponentResiliencyPolicyConfiguration.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDaprComponentResiliencyPolicyProperties; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DaprSecretsCollectionInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DaprSecretsCollectionInner.java index 4f4b9a166bde..0e76693a0119 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DaprSecretsCollectionInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DaprSecretsCollectionInner.java @@ -6,19 +6,22 @@ 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.appcontainers.models.DaprSecret; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * Dapr component Secrets Collection for ListSecrets Action. */ @Fluent -public final class DaprSecretsCollectionInner { +public final class DaprSecretsCollectionInner implements JsonSerializable { /* * Collection of secrets used by a Dapr component */ - @JsonProperty(value = "value", required = true) private List value; /** @@ -54,12 +57,51 @@ public DaprSecretsCollectionInner withValue(List value) { */ public void validate() { if (value() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property value in model DaprSecretsCollectionInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model DaprSecretsCollectionInner")); } else { value().forEach(e -> e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(DaprSecretsCollectionInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DaprSecretsCollectionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DaprSecretsCollectionInner 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 DaprSecretsCollectionInner. + */ + public static DaprSecretsCollectionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DaprSecretsCollectionInner deserializedDaprSecretsCollectionInner = new DaprSecretsCollectionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> DaprSecret.fromJson(reader1)); + deserializedDaprSecretsCollectionInner.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedDaprSecretsCollectionInner; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DaprSubscriptionInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DaprSubscriptionInner.java index 0939471b441f..a992678b5b84 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DaprSubscriptionInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DaprSubscriptionInner.java @@ -7,9 +7,12 @@ 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.appcontainers.models.DaprSubscriptionBulkSubscribeOptions; import com.azure.resourcemanager.appcontainers.models.DaprSubscriptionRoutes; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; import java.util.Map; @@ -21,15 +24,28 @@ public final class DaprSubscriptionInner extends ProxyResource { /* * Dapr PubSub Event Subscription resource specific properties */ - @JsonProperty(value = "properties") private DaprSubscriptionProperties innerProperties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + /** * Creates an instance of DaprSubscriptionInner class. */ @@ -54,6 +70,36 @@ public SystemData systemData() { return this.systemData; } + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + /** * Get the pubsubName property: Dapr PubSub component name. * @@ -225,4 +271,49 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DaprSubscriptionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DaprSubscriptionInner 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 DaprSubscriptionInner. + */ + public static DaprSubscriptionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DaprSubscriptionInner deserializedDaprSubscriptionInner = new DaprSubscriptionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedDaprSubscriptionInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedDaprSubscriptionInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedDaprSubscriptionInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedDaprSubscriptionInner.innerProperties = DaprSubscriptionProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedDaprSubscriptionInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDaprSubscriptionInner; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DaprSubscriptionProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DaprSubscriptionProperties.java index c3fbb8bc0aa6..94f636305390 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DaprSubscriptionProperties.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DaprSubscriptionProperties.java @@ -5,10 +5,13 @@ package com.azure.resourcemanager.appcontainers.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.appcontainers.models.DaprSubscriptionBulkSubscribeOptions; import com.azure.resourcemanager.appcontainers.models.DaprSubscriptionRoutes; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; import java.util.Map; @@ -16,48 +19,40 @@ * Dapr PubSub Event Subscription resource specific properties. */ @Fluent -public final class DaprSubscriptionProperties { +public final class DaprSubscriptionProperties implements JsonSerializable { /* * Dapr PubSub component name */ - @JsonProperty(value = "pubsubName") private String pubsubName; /* * Topic name */ - @JsonProperty(value = "topic") private String topic; /* * Deadletter topic name */ - @JsonProperty(value = "deadLetterTopic") private String deadLetterTopic; /* * Subscription routes */ - @JsonProperty(value = "routes") private DaprSubscriptionRoutes routes; /* * Application scopes to restrict the subscription to specific apps. */ - @JsonProperty(value = "scopes") private List scopes; /* * Subscription metadata */ - @JsonProperty(value = "metadata") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map metadata; /* * Bulk subscription options */ - @JsonProperty(value = "bulkSubscribe") private DaprSubscriptionBulkSubscribeOptions bulkSubscribe; /** @@ -219,4 +214,61 @@ public void validate() { bulkSubscribe().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("pubsubName", this.pubsubName); + jsonWriter.writeStringField("topic", this.topic); + jsonWriter.writeStringField("deadLetterTopic", this.deadLetterTopic); + jsonWriter.writeJsonField("routes", this.routes); + jsonWriter.writeArrayField("scopes", this.scopes, (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("metadata", this.metadata, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("bulkSubscribe", this.bulkSubscribe); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DaprSubscriptionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DaprSubscriptionProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DaprSubscriptionProperties. + */ + public static DaprSubscriptionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DaprSubscriptionProperties deserializedDaprSubscriptionProperties = new DaprSubscriptionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("pubsubName".equals(fieldName)) { + deserializedDaprSubscriptionProperties.pubsubName = reader.getString(); + } else if ("topic".equals(fieldName)) { + deserializedDaprSubscriptionProperties.topic = reader.getString(); + } else if ("deadLetterTopic".equals(fieldName)) { + deserializedDaprSubscriptionProperties.deadLetterTopic = reader.getString(); + } else if ("routes".equals(fieldName)) { + deserializedDaprSubscriptionProperties.routes = DaprSubscriptionRoutes.fromJson(reader); + } else if ("scopes".equals(fieldName)) { + List scopes = reader.readArray(reader1 -> reader1.getString()); + deserializedDaprSubscriptionProperties.scopes = scopes; + } else if ("metadata".equals(fieldName)) { + Map metadata = reader.readMap(reader1 -> reader1.getString()); + deserializedDaprSubscriptionProperties.metadata = metadata; + } else if ("bulkSubscribe".equals(fieldName)) { + deserializedDaprSubscriptionProperties.bulkSubscribe + = DaprSubscriptionBulkSubscribeOptions.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDaprSubscriptionProperties; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DiagnosticsCollectionInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DiagnosticsCollectionInner.java index 3467b799bcbb..23eacdf53c2d 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DiagnosticsCollectionInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DiagnosticsCollectionInner.java @@ -6,24 +6,26 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.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; /** * Diagnostics data collection for a resource. */ @Fluent -public final class DiagnosticsCollectionInner { +public final class DiagnosticsCollectionInner implements JsonSerializable { /* * Collection of diagnostic data. */ - @JsonProperty(value = "value", required = true) private List value; /* * Link to next page of resources. */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; /** @@ -68,12 +70,53 @@ public String nextLink() { */ public void validate() { if (value() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property value in model DiagnosticsCollectionInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model DiagnosticsCollectionInner")); } else { value().forEach(e -> e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(DiagnosticsCollectionInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DiagnosticsCollectionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DiagnosticsCollectionInner 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 DiagnosticsCollectionInner. + */ + public static DiagnosticsCollectionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DiagnosticsCollectionInner deserializedDiagnosticsCollectionInner = new DiagnosticsCollectionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> DiagnosticsInner.fromJson(reader1)); + deserializedDiagnosticsCollectionInner.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedDiagnosticsCollectionInner.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDiagnosticsCollectionInner; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DiagnosticsInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DiagnosticsInner.java index 7139bc06e6d9..0a3cb6412ecc 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DiagnosticsInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DiagnosticsInner.java @@ -7,8 +7,11 @@ 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.appcontainers.models.DiagnosticsProperties; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * Diagnostics data for a resource. @@ -18,15 +21,28 @@ public final class DiagnosticsInner extends ProxyResource { /* * Diagnostics resource specific properties */ - @JsonProperty(value = "properties") private DiagnosticsProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + /** * Creates an instance of DiagnosticsInner class. */ @@ -62,6 +78,36 @@ public SystemData systemData() { return this.systemData; } + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + /** * Validates the instance. * @@ -72,4 +118,49 @@ public void validate() { 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 DiagnosticsInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DiagnosticsInner 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 DiagnosticsInner. + */ + public static DiagnosticsInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DiagnosticsInner deserializedDiagnosticsInner = new DiagnosticsInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedDiagnosticsInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedDiagnosticsInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedDiagnosticsInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedDiagnosticsInner.properties = DiagnosticsProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedDiagnosticsInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDiagnosticsInner; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DotNetComponentInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DotNetComponentInner.java index bd1d51f60534..aae90eb67a57 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DotNetComponentInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DotNetComponentInner.java @@ -7,11 +7,14 @@ 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.appcontainers.models.DotNetComponentConfigurationProperty; import com.azure.resourcemanager.appcontainers.models.DotNetComponentProvisioningState; import com.azure.resourcemanager.appcontainers.models.DotNetComponentServiceBind; import com.azure.resourcemanager.appcontainers.models.DotNetComponentType; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** @@ -22,15 +25,28 @@ public final class DotNetComponentInner extends ProxyResource { /* * .NET Component resource specific properties */ - @JsonProperty(value = "properties") private DotNetComponentProperties innerProperties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + /** * Creates an instance of DotNetComponentInner class. */ @@ -55,6 +71,36 @@ public SystemData systemData() { return this.systemData; } + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + /** * Get the componentType property: Type of the .NET Component. * @@ -143,4 +189,49 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DotNetComponentInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DotNetComponentInner 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 DotNetComponentInner. + */ + public static DotNetComponentInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DotNetComponentInner deserializedDotNetComponentInner = new DotNetComponentInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedDotNetComponentInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedDotNetComponentInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedDotNetComponentInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedDotNetComponentInner.innerProperties = DotNetComponentProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedDotNetComponentInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDotNetComponentInner; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DotNetComponentProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DotNetComponentProperties.java index ca41f342548f..182ec5ce5887 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DotNetComponentProperties.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DotNetComponentProperties.java @@ -5,40 +5,40 @@ package com.azure.resourcemanager.appcontainers.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.appcontainers.models.DotNetComponentConfigurationProperty; import com.azure.resourcemanager.appcontainers.models.DotNetComponentProvisioningState; import com.azure.resourcemanager.appcontainers.models.DotNetComponentServiceBind; import com.azure.resourcemanager.appcontainers.models.DotNetComponentType; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * .NET Component resource specific properties. */ @Fluent -public final class DotNetComponentProperties { +public final class DotNetComponentProperties implements JsonSerializable { /* * Type of the .NET Component. */ - @JsonProperty(value = "componentType") private DotNetComponentType componentType; /* * Provisioning state of the .NET Component. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private DotNetComponentProvisioningState provisioningState; /* * List of .NET Components configuration properties */ - @JsonProperty(value = "configurations") private List configurations; /* * List of .NET Components that are bound to the .NET component */ - @JsonProperty(value = "serviceBinds") private List serviceBinds; /** @@ -129,4 +129,55 @@ public void validate() { serviceBinds().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("componentType", this.componentType == null ? null : this.componentType.toString()); + jsonWriter.writeArrayField("configurations", this.configurations, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("serviceBinds", this.serviceBinds, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DotNetComponentProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DotNetComponentProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DotNetComponentProperties. + */ + public static DotNetComponentProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DotNetComponentProperties deserializedDotNetComponentProperties = new DotNetComponentProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("componentType".equals(fieldName)) { + deserializedDotNetComponentProperties.componentType + = DotNetComponentType.fromString(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedDotNetComponentProperties.provisioningState + = DotNetComponentProvisioningState.fromString(reader.getString()); + } else if ("configurations".equals(fieldName)) { + List configurations + = reader.readArray(reader1 -> DotNetComponentConfigurationProperty.fromJson(reader1)); + deserializedDotNetComponentProperties.configurations = configurations; + } else if ("serviceBinds".equals(fieldName)) { + List serviceBinds + = reader.readArray(reader1 -> DotNetComponentServiceBind.fromJson(reader1)); + deserializedDotNetComponentProperties.serviceBinds = serviceBinds; + } else { + reader.skipChildren(); + } + } + + return deserializedDotNetComponentProperties; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/EnvironmentAuthTokenInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/EnvironmentAuthTokenInner.java index 781f86102246..3c6b0c872ef8 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/EnvironmentAuthTokenInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/EnvironmentAuthTokenInner.java @@ -7,7 +7,10 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; import com.azure.core.management.SystemData; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; import java.util.Map; @@ -19,15 +22,28 @@ public final class EnvironmentAuthTokenInner extends Resource { /* * Environment auth token resource specific properties */ - @JsonProperty(value = "properties") private EnvironmentAuthTokenProperties innerProperties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + /** * Creates an instance of EnvironmentAuthTokenInner class. */ @@ -52,6 +68,36 @@ public SystemData systemData() { return this.systemData; } + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + /** * {@inheritDoc} */ @@ -98,4 +144,57 @@ public void validate() { innerProperties().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.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EnvironmentAuthTokenInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EnvironmentAuthTokenInner 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 EnvironmentAuthTokenInner. + */ + public static EnvironmentAuthTokenInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EnvironmentAuthTokenInner deserializedEnvironmentAuthTokenInner = new EnvironmentAuthTokenInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedEnvironmentAuthTokenInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedEnvironmentAuthTokenInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedEnvironmentAuthTokenInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedEnvironmentAuthTokenInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedEnvironmentAuthTokenInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedEnvironmentAuthTokenInner.innerProperties + = EnvironmentAuthTokenProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedEnvironmentAuthTokenInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEnvironmentAuthTokenInner; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/EnvironmentAuthTokenProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/EnvironmentAuthTokenProperties.java index 59ca82a463d3..494d43da9dcd 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/EnvironmentAuthTokenProperties.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/EnvironmentAuthTokenProperties.java @@ -5,24 +5,27 @@ package com.azure.resourcemanager.appcontainers.fluent.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +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; /** * Environment auth token resource specific properties. */ @Immutable -public final class EnvironmentAuthTokenProperties { +public final class EnvironmentAuthTokenProperties implements JsonSerializable { /* * Auth token value. */ - @JsonProperty(value = "token", access = JsonProperty.Access.WRITE_ONLY) private String token; /* * Token expiration date. */ - @JsonProperty(value = "expires", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime expires; /** @@ -56,4 +59,43 @@ public OffsetDateTime expires() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EnvironmentAuthTokenProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EnvironmentAuthTokenProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the EnvironmentAuthTokenProperties. + */ + public static EnvironmentAuthTokenProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EnvironmentAuthTokenProperties deserializedEnvironmentAuthTokenProperties + = new EnvironmentAuthTokenProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("token".equals(fieldName)) { + deserializedEnvironmentAuthTokenProperties.token = reader.getString(); + } else if ("expires".equals(fieldName)) { + deserializedEnvironmentAuthTokenProperties.expires = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedEnvironmentAuthTokenProperties; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/HeaderMatchMatch.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/HeaderMatchMatch.java index 29d7763f5187..3f50c599fc2b 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/HeaderMatchMatch.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/HeaderMatchMatch.java @@ -5,35 +5,35 @@ package com.azure.resourcemanager.appcontainers.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Type of match to perform. */ @Fluent -public final class HeaderMatchMatch { +public final class HeaderMatchMatch implements JsonSerializable { /* * Exact value of the header */ - @JsonProperty(value = "exactMatch") private String exactMatch; /* * Prefix value of the header */ - @JsonProperty(value = "prefixMatch") private String prefixMatch; /* * Suffix value of the header */ - @JsonProperty(value = "suffixMatch") private String suffixMatch; /* * Regex value of the header */ - @JsonProperty(value = "regexMatch") private String regexMatch; /** @@ -129,4 +129,49 @@ public HeaderMatchMatch withRegexMatch(String regexMatch) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("exactMatch", this.exactMatch); + jsonWriter.writeStringField("prefixMatch", this.prefixMatch); + jsonWriter.writeStringField("suffixMatch", this.suffixMatch); + jsonWriter.writeStringField("regexMatch", this.regexMatch); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HeaderMatchMatch from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HeaderMatchMatch if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the HeaderMatchMatch. + */ + public static HeaderMatchMatch fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HeaderMatchMatch deserializedHeaderMatchMatch = new HeaderMatchMatch(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("exactMatch".equals(fieldName)) { + deserializedHeaderMatchMatch.exactMatch = reader.getString(); + } else if ("prefixMatch".equals(fieldName)) { + deserializedHeaderMatchMatch.prefixMatch = reader.getString(); + } else if ("suffixMatch".equals(fieldName)) { + deserializedHeaderMatchMatch.suffixMatch = reader.getString(); + } else if ("regexMatch".equals(fieldName)) { + deserializedHeaderMatchMatch.regexMatch = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedHeaderMatchMatch; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/HttpRetryPolicyMatches.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/HttpRetryPolicyMatches.java index 341adb4b7d7d..6d94fe02bc2b 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/HttpRetryPolicyMatches.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/HttpRetryPolicyMatches.java @@ -5,31 +5,32 @@ package com.azure.resourcemanager.appcontainers.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.appcontainers.models.HeaderMatch; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * Conditions that must be met for a request to be retried. */ @Fluent -public final class HttpRetryPolicyMatches { +public final class HttpRetryPolicyMatches implements JsonSerializable { /* * Headers that must be present for a request to be retried */ - @JsonProperty(value = "headers") private List headers; /* * Additional http status codes that can trigger a retry */ - @JsonProperty(value = "httpStatusCodes") private List httpStatusCodes; /* * Errors that can trigger a retry */ - @JsonProperty(value = "errors") private List errors; /** @@ -108,4 +109,50 @@ public void validate() { headers().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("headers", this.headers, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("httpStatusCodes", this.httpStatusCodes, + (writer, element) -> writer.writeInt(element)); + jsonWriter.writeArrayField("errors", this.errors, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HttpRetryPolicyMatches from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HttpRetryPolicyMatches if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the HttpRetryPolicyMatches. + */ + public static HttpRetryPolicyMatches fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HttpRetryPolicyMatches deserializedHttpRetryPolicyMatches = new HttpRetryPolicyMatches(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("headers".equals(fieldName)) { + List headers = reader.readArray(reader1 -> HeaderMatch.fromJson(reader1)); + deserializedHttpRetryPolicyMatches.headers = headers; + } else if ("httpStatusCodes".equals(fieldName)) { + List httpStatusCodes = reader.readArray(reader1 -> reader1.getInt()); + deserializedHttpRetryPolicyMatches.httpStatusCodes = httpStatusCodes; + } else if ("errors".equals(fieldName)) { + List errors = reader.readArray(reader1 -> reader1.getString()); + deserializedHttpRetryPolicyMatches.errors = errors; + } else { + reader.skipChildren(); + } + } + + return deserializedHttpRetryPolicyMatches; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/HttpRetryPolicyRetryBackOff.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/HttpRetryPolicyRetryBackOff.java index a56702256e35..b84e2a65d710 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/HttpRetryPolicyRetryBackOff.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/HttpRetryPolicyRetryBackOff.java @@ -5,23 +5,25 @@ package com.azure.resourcemanager.appcontainers.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Settings for retry backoff characteristics. */ @Fluent -public final class HttpRetryPolicyRetryBackOff { +public final class HttpRetryPolicyRetryBackOff implements JsonSerializable { /* * Initial delay, in milliseconds, before retrying a request */ - @JsonProperty(value = "initialDelayInMilliseconds") private Long initialDelayInMilliseconds; /* * Maximum interval, in milliseconds, between retries */ - @JsonProperty(value = "maxIntervalInMilliseconds") private Long maxIntervalInMilliseconds; /** @@ -77,4 +79,45 @@ public HttpRetryPolicyRetryBackOff withMaxIntervalInMilliseconds(Long maxInterva */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("initialDelayInMilliseconds", this.initialDelayInMilliseconds); + jsonWriter.writeNumberField("maxIntervalInMilliseconds", this.maxIntervalInMilliseconds); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HttpRetryPolicyRetryBackOff from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HttpRetryPolicyRetryBackOff if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the HttpRetryPolicyRetryBackOff. + */ + public static HttpRetryPolicyRetryBackOff fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HttpRetryPolicyRetryBackOff deserializedHttpRetryPolicyRetryBackOff = new HttpRetryPolicyRetryBackOff(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("initialDelayInMilliseconds".equals(fieldName)) { + deserializedHttpRetryPolicyRetryBackOff.initialDelayInMilliseconds + = reader.getNullable(JsonReader::getLong); + } else if ("maxIntervalInMilliseconds".equals(fieldName)) { + deserializedHttpRetryPolicyRetryBackOff.maxIntervalInMilliseconds + = reader.getNullable(JsonReader::getLong); + } else { + reader.skipChildren(); + } + } + + return deserializedHttpRetryPolicyRetryBackOff; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/JavaComponentInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/JavaComponentInner.java index cedf0eaf85e1..1cec2bd1e8eb 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/JavaComponentInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/JavaComponentInner.java @@ -7,12 +7,11 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; -import com.azure.resourcemanager.appcontainers.models.JavaComponentConfigurationProperty; -import com.azure.resourcemanager.appcontainers.models.JavaComponentProvisioningState; -import com.azure.resourcemanager.appcontainers.models.JavaComponentServiceBind; -import com.azure.resourcemanager.appcontainers.models.JavaComponentType; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.appcontainers.models.JavaComponentProperties; +import java.io.IOException; /** * Java Component. @@ -22,15 +21,28 @@ public final class JavaComponentInner extends ProxyResource { /* * Java Component resource specific properties */ - @JsonProperty(value = "properties") - private JavaComponentProperties innerProperties; + private JavaComponentProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + /** * Creates an instance of JavaComponentInner class. */ @@ -38,109 +50,117 @@ public JavaComponentInner() { } /** - * Get the innerProperties property: Java Component resource specific properties. + * Get the properties property: Java Component resource specific properties. * - * @return the innerProperties value. + * @return the properties value. */ - private JavaComponentProperties innerProperties() { - return this.innerProperties; + public JavaComponentProperties properties() { + return this.properties; } /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * Set the properties property: Java Component resource specific properties. * - * @return the systemData value. + * @param properties the properties value to set. + * @return the JavaComponentInner object itself. */ - public SystemData systemData() { - return this.systemData; + public JavaComponentInner withProperties(JavaComponentProperties properties) { + this.properties = properties; + return this; } /** - * Get the componentType property: Type of the Java Component. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the componentType value. + * @return the systemData value. */ - public JavaComponentType componentType() { - return this.innerProperties() == null ? null : this.innerProperties().componentType(); + public SystemData systemData() { + return this.systemData; } /** - * Set the componentType property: Type of the Java Component. + * Get the id property: Fully qualified resource Id for the resource. * - * @param componentType the componentType value to set. - * @return the JavaComponentInner object itself. + * @return the id value. */ - public JavaComponentInner withComponentType(JavaComponentType componentType) { - if (this.innerProperties() == null) { - this.innerProperties = new JavaComponentProperties(); - } - this.innerProperties().withComponentType(componentType); - return this; + @Override + public String id() { + return this.id; } /** - * Get the provisioningState property: Provisioning state of the Java Component. + * Get the name property: The name of the resource. * - * @return the provisioningState value. + * @return the name value. */ - public JavaComponentProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + @Override + public String name() { + return this.name; } /** - * Get the configurations property: List of Java Components configuration properties. + * Get the type property: The type of the resource. * - * @return the configurations value. + * @return the type value. */ - public List configurations() { - return this.innerProperties() == null ? null : this.innerProperties().configurations(); + @Override + public String type() { + return this.type; } /** - * Set the configurations property: List of Java Components configuration properties. + * Validates the instance. * - * @param configurations the configurations value to set. - * @return the JavaComponentInner object itself. + * @throws IllegalArgumentException thrown if the instance is not valid. */ - public JavaComponentInner withConfigurations(List configurations) { - if (this.innerProperties() == null) { - this.innerProperties = new JavaComponentProperties(); + public void validate() { + if (properties() != null) { + properties().validate(); } - this.innerProperties().withConfigurations(configurations); - return this; } /** - * Get the serviceBinds property: List of Java Components that are bound to the Java component. - * - * @return the serviceBinds value. + * {@inheritDoc} */ - public List serviceBinds() { - return this.innerProperties() == null ? null : this.innerProperties().serviceBinds(); + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); } /** - * Set the serviceBinds property: List of Java Components that are bound to the Java component. + * Reads an instance of JavaComponentInner from the JsonReader. * - * @param serviceBinds the serviceBinds value to set. - * @return the JavaComponentInner object itself. + * @param jsonReader The JsonReader being read. + * @return An instance of JavaComponentInner 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 JavaComponentInner. */ - public JavaComponentInner withServiceBinds(List serviceBinds) { - if (this.innerProperties() == null) { - this.innerProperties = new JavaComponentProperties(); - } - this.innerProperties().withServiceBinds(serviceBinds); - return this; - } + public static JavaComponentInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + JavaComponentInner deserializedJavaComponentInner = new JavaComponentInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } + if ("id".equals(fieldName)) { + deserializedJavaComponentInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedJavaComponentInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedJavaComponentInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedJavaComponentInner.properties = JavaComponentProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedJavaComponentInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedJavaComponentInner; + }); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/JavaComponentProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/JavaComponentProperties.java deleted file mode 100644 index 7b0b5c56ad9e..000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/JavaComponentProperties.java +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.appcontainers.models.JavaComponentConfigurationProperty; -import com.azure.resourcemanager.appcontainers.models.JavaComponentProvisioningState; -import com.azure.resourcemanager.appcontainers.models.JavaComponentServiceBind; -import com.azure.resourcemanager.appcontainers.models.JavaComponentType; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** - * Java Component resource specific properties. - */ -@Fluent -public final class JavaComponentProperties { - /* - * Type of the Java Component. - */ - @JsonProperty(value = "componentType") - private JavaComponentType componentType; - - /* - * Provisioning state of the Java Component. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private JavaComponentProvisioningState provisioningState; - - /* - * List of Java Components configuration properties - */ - @JsonProperty(value = "configurations") - private List configurations; - - /* - * List of Java Components that are bound to the Java component - */ - @JsonProperty(value = "serviceBinds") - private List serviceBinds; - - /** - * Creates an instance of JavaComponentProperties class. - */ - public JavaComponentProperties() { - } - - /** - * Get the componentType property: Type of the Java Component. - * - * @return the componentType value. - */ - public JavaComponentType componentType() { - return this.componentType; - } - - /** - * Set the componentType property: Type of the Java Component. - * - * @param componentType the componentType value to set. - * @return the JavaComponentProperties object itself. - */ - public JavaComponentProperties withComponentType(JavaComponentType componentType) { - this.componentType = componentType; - return this; - } - - /** - * Get the provisioningState property: Provisioning state of the Java Component. - * - * @return the provisioningState value. - */ - public JavaComponentProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Get the configurations property: List of Java Components configuration properties. - * - * @return the configurations value. - */ - public List configurations() { - return this.configurations; - } - - /** - * Set the configurations property: List of Java Components configuration properties. - * - * @param configurations the configurations value to set. - * @return the JavaComponentProperties object itself. - */ - public JavaComponentProperties withConfigurations(List configurations) { - this.configurations = configurations; - return this; - } - - /** - * Get the serviceBinds property: List of Java Components that are bound to the Java component. - * - * @return the serviceBinds value. - */ - public List serviceBinds() { - return this.serviceBinds; - } - - /** - * Set the serviceBinds property: List of Java Components that are bound to the Java component. - * - * @param serviceBinds the serviceBinds value to set. - * @return the JavaComponentProperties object itself. - */ - public JavaComponentProperties withServiceBinds(List serviceBinds) { - this.serviceBinds = serviceBinds; - 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()); - } - if (serviceBinds() != null) { - serviceBinds().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/JobExecutionBaseInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/JobExecutionBaseInner.java index 53a7de1913f8..79e1d2fa6122 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/JobExecutionBaseInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/JobExecutionBaseInner.java @@ -5,23 +5,25 @@ package com.azure.resourcemanager.appcontainers.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Container App's Job execution name. */ @Fluent -public final class JobExecutionBaseInner { +public final class JobExecutionBaseInner implements JsonSerializable { /* * Job execution name. */ - @JsonProperty(value = "name") private String name; /* * Job execution Id. */ - @JsonProperty(value = "id") private String id; /** @@ -77,4 +79,43 @@ public JobExecutionBaseInner withId(String id) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of JobExecutionBaseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of JobExecutionBaseInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the JobExecutionBaseInner. + */ + public static JobExecutionBaseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + JobExecutionBaseInner deserializedJobExecutionBaseInner = new JobExecutionBaseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedJobExecutionBaseInner.name = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedJobExecutionBaseInner.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedJobExecutionBaseInner; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/JobExecutionInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/JobExecutionInner.java index d407d72fc16f..e2a76d5a4b6e 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/JobExecutionInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/JobExecutionInner.java @@ -5,38 +5,39 @@ package com.azure.resourcemanager.appcontainers.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.appcontainers.models.ExecutionStatus; import com.azure.resourcemanager.appcontainers.models.JobExecutionRunningState; import com.azure.resourcemanager.appcontainers.models.JobExecutionTemplate; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.time.OffsetDateTime; /** * Container Apps Job execution. */ @Fluent -public final class JobExecutionInner { +public final class JobExecutionInner implements JsonSerializable { /* * Job execution Name. */ - @JsonProperty(value = "name") private String name; /* * Job execution Id. */ - @JsonProperty(value = "id") private String id; /* * Job execution type */ - @JsonProperty(value = "type") private String type; /* * Container Apps Job execution specific properties. */ - @JsonProperty(value = "properties") private JobExecutionProperties innerProperties; /** @@ -192,6 +193,29 @@ public JobExecutionInner withTemplate(JobExecutionTemplate template) { return this; } + /** + * Get the detailedStatus property: Detailed status of the job execution. + * + * @return the detailedStatus value. + */ + public ExecutionStatus detailedStatus() { + return this.innerProperties() == null ? null : this.innerProperties().detailedStatus(); + } + + /** + * Set the detailedStatus property: Detailed status of the job execution. + * + * @param detailedStatus the detailedStatus value to set. + * @return the JobExecutionInner object itself. + */ + public JobExecutionInner withDetailedStatus(ExecutionStatus detailedStatus) { + if (this.innerProperties() == null) { + this.innerProperties = new JobExecutionProperties(); + } + this.innerProperties().withDetailedStatus(detailedStatus); + return this; + } + /** * Validates the instance. * @@ -202,4 +226,49 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("type", this.type); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of JobExecutionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of JobExecutionInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the JobExecutionInner. + */ + public static JobExecutionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + JobExecutionInner deserializedJobExecutionInner = new JobExecutionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedJobExecutionInner.name = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedJobExecutionInner.id = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedJobExecutionInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedJobExecutionInner.innerProperties = JobExecutionProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedJobExecutionInner; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/JobExecutionProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/JobExecutionProperties.java index 38038116fad5..f4c57c06efca 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/JobExecutionProperties.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/JobExecutionProperties.java @@ -5,40 +5,48 @@ package com.azure.resourcemanager.appcontainers.fluent.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 com.azure.resourcemanager.appcontainers.models.ExecutionStatus; import com.azure.resourcemanager.appcontainers.models.JobExecutionRunningState; import com.azure.resourcemanager.appcontainers.models.JobExecutionTemplate; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; /** * Container Apps Job execution specific properties. */ @Fluent -public final class JobExecutionProperties { +public final class JobExecutionProperties implements JsonSerializable { /* * Current running State of the job */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) private JobExecutionRunningState status; /* * Job execution start time. */ - @JsonProperty(value = "startTime") private OffsetDateTime startTime; /* * Job execution end time. */ - @JsonProperty(value = "endTime") private OffsetDateTime endTime; /* * Job's execution container. */ - @JsonProperty(value = "template") private JobExecutionTemplate template; + /* + * Detailed status of the job execution. + */ + private ExecutionStatus detailedStatus; + /** * Creates an instance of JobExecutionProperties class. */ @@ -114,6 +122,26 @@ public JobExecutionProperties withTemplate(JobExecutionTemplate template) { return this; } + /** + * Get the detailedStatus property: Detailed status of the job execution. + * + * @return the detailedStatus value. + */ + public ExecutionStatus detailedStatus() { + return this.detailedStatus; + } + + /** + * Set the detailedStatus property: Detailed status of the job execution. + * + * @param detailedStatus the detailedStatus value to set. + * @return the JobExecutionProperties object itself. + */ + public JobExecutionProperties withDetailedStatus(ExecutionStatus detailedStatus) { + this.detailedStatus = detailedStatus; + return this; + } + /** * Validates the instance. * @@ -123,5 +151,59 @@ public void validate() { if (template() != null) { template().validate(); } + if (detailedStatus() != null) { + detailedStatus().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + 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.writeJsonField("template", this.template); + jsonWriter.writeJsonField("detailedStatus", this.detailedStatus); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of JobExecutionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of JobExecutionProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the JobExecutionProperties. + */ + public static JobExecutionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + JobExecutionProperties deserializedJobExecutionProperties = new JobExecutionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedJobExecutionProperties.status = JobExecutionRunningState.fromString(reader.getString()); + } else if ("startTime".equals(fieldName)) { + deserializedJobExecutionProperties.startTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("endTime".equals(fieldName)) { + deserializedJobExecutionProperties.endTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("template".equals(fieldName)) { + deserializedJobExecutionProperties.template = JobExecutionTemplate.fromJson(reader); + } else if ("detailedStatus".equals(fieldName)) { + deserializedJobExecutionProperties.detailedStatus = ExecutionStatus.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedJobExecutionProperties; + }); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/JobInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/JobInner.java index 1f480d8be425..7179369fe9c0 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/JobInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/JobInner.java @@ -7,12 +7,15 @@ 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.appcontainers.models.ExtendedLocation; import com.azure.resourcemanager.appcontainers.models.JobConfiguration; import com.azure.resourcemanager.appcontainers.models.JobProvisioningState; import com.azure.resourcemanager.appcontainers.models.JobTemplate; import com.azure.resourcemanager.appcontainers.models.ManagedServiceIdentity; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; import java.util.Map; @@ -24,28 +27,39 @@ public final class JobInner extends Resource { /* * The complex type of the extended location. */ - @JsonProperty(value = "extendedLocation") private ExtendedLocation extendedLocation; /* * Managed identities needed by a container app job to interact with other Azure services to not maintain any * secrets or credentials in code. */ - @JsonProperty(value = "identity") private ManagedServiceIdentity identity; /* * Container Apps Job resource specific properties. */ - @JsonProperty(value = "properties") private JobProperties innerProperties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + /** * Creates an instance of JobInner class. */ @@ -73,8 +87,8 @@ public JobInner withExtendedLocation(ExtendedLocation extendedLocation) { } /** - * Get the identity property: Managed identities needed by a container app job to interact with other Azure - * services to not maintain any secrets or credentials in code. + * Get the identity property: Managed identities needed by a container app job to interact with other Azure services + * to not maintain any secrets or credentials in code. * * @return the identity value. */ @@ -83,8 +97,8 @@ public ManagedServiceIdentity identity() { } /** - * Set the identity property: Managed identities needed by a container app job to interact with other Azure - * services to not maintain any secrets or credentials in code. + * Set the identity property: Managed identities needed by a container app job to interact with other Azure services + * to not maintain any secrets or credentials in code. * * @param identity the identity value to set. * @return the JobInner object itself. @@ -112,6 +126,36 @@ public SystemData systemData() { return this.systemData; } + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + /** * {@inheritDoc} */ @@ -265,4 +309,62 @@ public void validate() { innerProperties().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("extendedLocation", this.extendedLocation); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of JobInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of JobInner 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 JobInner. + */ + public static JobInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + JobInner deserializedJobInner = new JobInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedJobInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedJobInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedJobInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedJobInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedJobInner.withTags(tags); + } else if ("extendedLocation".equals(fieldName)) { + deserializedJobInner.extendedLocation = ExtendedLocation.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedJobInner.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedJobInner.innerProperties = JobProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedJobInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedJobInner; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/JobProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/JobProperties.java index f1e4e6838a0a..f5b84eefb271 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/JobProperties.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/JobProperties.java @@ -5,57 +5,54 @@ package com.azure.resourcemanager.appcontainers.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.appcontainers.models.JobConfiguration; import com.azure.resourcemanager.appcontainers.models.JobProvisioningState; import com.azure.resourcemanager.appcontainers.models.JobTemplate; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * Container Apps Job resource specific properties. */ @Fluent -public final class JobProperties { +public final class JobProperties implements JsonSerializable { /* * Provisioning state of the Container Apps Job. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private JobProvisioningState provisioningState; /* * Resource ID of environment. */ - @JsonProperty(value = "environmentId") private String environmentId; /* * Workload profile name to pin for container apps job execution. */ - @JsonProperty(value = "workloadProfileName") private String workloadProfileName; /* * Container Apps Job configuration properties. */ - @JsonProperty(value = "configuration") private JobConfiguration configuration; /* * Container Apps job definition. */ - @JsonProperty(value = "template") private JobTemplate template; /* * Outbound IP Addresses of a container apps job. */ - @JsonProperty(value = "outboundIpAddresses", access = JsonProperty.Access.WRITE_ONLY) private List outboundIpAddresses; /* * The endpoint of the eventstream of the container apps job. */ - @JsonProperty(value = "eventStreamEndpoint", access = JsonProperty.Access.WRITE_ONLY) private String eventStreamEndpoint; /** @@ -184,4 +181,56 @@ public void validate() { template().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("environmentId", this.environmentId); + jsonWriter.writeStringField("workloadProfileName", this.workloadProfileName); + jsonWriter.writeJsonField("configuration", this.configuration); + jsonWriter.writeJsonField("template", this.template); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of JobProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of JobProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the JobProperties. + */ + public static JobProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + JobProperties deserializedJobProperties = new JobProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedJobProperties.provisioningState = JobProvisioningState.fromString(reader.getString()); + } else if ("environmentId".equals(fieldName)) { + deserializedJobProperties.environmentId = reader.getString(); + } else if ("workloadProfileName".equals(fieldName)) { + deserializedJobProperties.workloadProfileName = reader.getString(); + } else if ("configuration".equals(fieldName)) { + deserializedJobProperties.configuration = JobConfiguration.fromJson(reader); + } else if ("template".equals(fieldName)) { + deserializedJobProperties.template = JobTemplate.fromJson(reader); + } else if ("outboundIpAddresses".equals(fieldName)) { + List outboundIpAddresses = reader.readArray(reader1 -> reader1.getString()); + deserializedJobProperties.outboundIpAddresses = outboundIpAddresses; + } else if ("eventStreamEndpoint".equals(fieldName)) { + deserializedJobProperties.eventStreamEndpoint = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedJobProperties; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/JobSecretsCollectionInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/JobSecretsCollectionInner.java index 47707c7fade7..db7a2b3b449f 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/JobSecretsCollectionInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/JobSecretsCollectionInner.java @@ -6,19 +6,22 @@ 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.appcontainers.models.Secret; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * Container Apps Job Secrets Collection ARM resource. */ @Fluent -public final class JobSecretsCollectionInner { +public final class JobSecretsCollectionInner implements JsonSerializable { /* * Collection of resources. */ - @JsonProperty(value = "value", required = true) private List value; /** @@ -54,12 +57,51 @@ public JobSecretsCollectionInner withValue(List value) { */ public void validate() { if (value() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property value in model JobSecretsCollectionInner")); + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property value in model JobSecretsCollectionInner")); } else { value().forEach(e -> e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(JobSecretsCollectionInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of JobSecretsCollectionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of JobSecretsCollectionInner 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 JobSecretsCollectionInner. + */ + public static JobSecretsCollectionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + JobSecretsCollectionInner deserializedJobSecretsCollectionInner = new JobSecretsCollectionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> Secret.fromJson(reader1)); + deserializedJobSecretsCollectionInner.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedJobSecretsCollectionInner; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/LogicAppInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/LogicAppInner.java new file mode 100644 index 000000000000..d312f548439a --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/LogicAppInner.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.appcontainers.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 java.io.IOException; + +/** + * A logic app extension resource. + */ +@Fluent +public final class LogicAppInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private Object properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + + /** + * Creates an instance of LogicAppInner class. + */ + public LogicAppInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public Object properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the LogicAppInner object itself. + */ + public LogicAppInner withProperties(Object 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 id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Validates the instance. + * + * @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("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LogicAppInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LogicAppInner 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 LogicAppInner. + */ + public static LogicAppInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LogicAppInner deserializedLogicAppInner = new LogicAppInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedLogicAppInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedLogicAppInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedLogicAppInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedLogicAppInner.properties = reader.readUntyped(); + } else if ("systemData".equals(fieldName)) { + deserializedLogicAppInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedLogicAppInner; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ManagedCertificateInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ManagedCertificateInner.java index d9284752cbc7..06078138d52e 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ManagedCertificateInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ManagedCertificateInner.java @@ -7,8 +7,11 @@ 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.appcontainers.models.ManagedCertificateProperties; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.Map; /** @@ -19,15 +22,28 @@ public final class ManagedCertificateInner extends Resource { /* * Certificate resource specific properties */ - @JsonProperty(value = "properties") private ManagedCertificateProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + /** * Creates an instance of ManagedCertificateInner class. */ @@ -63,6 +79,36 @@ public SystemData systemData() { return this.systemData; } + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + /** * {@inheritDoc} */ @@ -91,4 +137,56 @@ public void validate() { 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 ManagedCertificateInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedCertificateInner 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 ManagedCertificateInner. + */ + public static ManagedCertificateInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedCertificateInner deserializedManagedCertificateInner = new ManagedCertificateInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedManagedCertificateInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedManagedCertificateInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedManagedCertificateInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedManagedCertificateInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedManagedCertificateInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedManagedCertificateInner.properties = ManagedCertificateProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedManagedCertificateInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedCertificateInner; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ManagedEnvironmentInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ManagedEnvironmentInner.java index c31e5a5ee4f0..e22a402ac672 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ManagedEnvironmentInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ManagedEnvironmentInner.java @@ -7,6 +7,9 @@ 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.appcontainers.models.AppInsightsConfiguration; import com.azure.resourcemanager.appcontainers.models.AppLogsConfiguration; import com.azure.resourcemanager.appcontainers.models.CustomDomainConfiguration; @@ -14,11 +17,13 @@ import com.azure.resourcemanager.appcontainers.models.EnvironmentProvisioningState; import com.azure.resourcemanager.appcontainers.models.KedaConfiguration; import com.azure.resourcemanager.appcontainers.models.ManagedEnvironmentPropertiesPeerAuthentication; +import com.azure.resourcemanager.appcontainers.models.ManagedEnvironmentPropertiesPeerTrafficConfiguration; import com.azure.resourcemanager.appcontainers.models.ManagedServiceIdentity; import com.azure.resourcemanager.appcontainers.models.OpenTelemetryConfiguration; +import com.azure.resourcemanager.appcontainers.models.PublicNetworkAccess; import com.azure.resourcemanager.appcontainers.models.VnetConfiguration; import com.azure.resourcemanager.appcontainers.models.WorkloadProfile; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; import java.util.Map; @@ -30,28 +35,39 @@ public final class ManagedEnvironmentInner extends Resource { /* * Kind of the Environment. */ - @JsonProperty(value = "kind") private String kind; /* * Managed identities for the Managed Environment to interact with other Azure services without maintaining any * secrets or credentials in code. */ - @JsonProperty(value = "identity") private ManagedServiceIdentity identity; /* * Managed environment resource specific properties */ - @JsonProperty(value = "properties") private ManagedEnvironmentProperties innerProperties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + /** * Creates an instance of ManagedEnvironmentInner class. */ @@ -118,6 +134,36 @@ public SystemData systemData() { return this.systemData; } + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + /** * {@inheritDoc} */ @@ -171,8 +217,8 @@ public ManagedEnvironmentInner withDaprAIInstrumentationKey(String daprAIInstrum } /** - * Get the daprAIConnectionString property: Application Insights connection string used by Dapr to export Service - * to Service communication telemetry. + * Get the daprAIConnectionString property: Application Insights connection string used by Dapr to export Service to + * Service communication telemetry. * * @return the daprAIConnectionString value. */ @@ -181,8 +227,8 @@ public String daprAIConnectionString() { } /** - * Set the daprAIConnectionString property: Application Insights connection string used by Dapr to export Service - * to Service communication telemetry. + * Set the daprAIConnectionString property: Application Insights connection string used by Dapr to export Service to + * Service communication telemetry. * * @param daprAIConnectionString the daprAIConnectionString value to set. * @return the ManagedEnvironmentInner object itself. @@ -444,9 +490,9 @@ public ManagedEnvironmentInner withDaprConfiguration(DaprConfiguration daprConfi } /** - * Get the infrastructureResourceGroup property: Name of the platform-managed resource group created for the - * Managed Environment to host infrastructure resources. If a subnet ID is provided, this resource group will be - * created in the same subscription as the subnet. + * Get the infrastructureResourceGroup property: Name of the platform-managed resource group created for the Managed + * Environment to host infrastructure resources. If a subnet ID is provided, this resource group will be created in + * the same subscription as the subnet. * * @return the infrastructureResourceGroup value. */ @@ -455,9 +501,9 @@ public String infrastructureResourceGroup() { } /** - * Set the infrastructureResourceGroup property: Name of the platform-managed resource group created for the - * Managed Environment to host infrastructure resources. If a subnet ID is provided, this resource group will be - * created in the same subscription as the subnet. + * Set the infrastructureResourceGroup property: Name of the platform-managed resource group created for the Managed + * Environment to host infrastructure resources. If a subnet ID is provided, this resource group will be created in + * the same subscription as the subnet. * * @param infrastructureResourceGroup the infrastructureResourceGroup value to set. * @return the ManagedEnvironmentInner object itself. @@ -494,6 +540,64 @@ public ManagedEnvironmentPropertiesPeerAuthentication peerAuthentication() { return this; } + /** + * Get the peerTrafficConfiguration property: Peer traffic settings for the Managed Environment. + * + * @return the peerTrafficConfiguration value. + */ + public ManagedEnvironmentPropertiesPeerTrafficConfiguration peerTrafficConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().peerTrafficConfiguration(); + } + + /** + * Set the peerTrafficConfiguration property: Peer traffic settings for the Managed Environment. + * + * @param peerTrafficConfiguration the peerTrafficConfiguration value to set. + * @return the ManagedEnvironmentInner object itself. + */ + public ManagedEnvironmentInner + withPeerTrafficConfiguration(ManagedEnvironmentPropertiesPeerTrafficConfiguration peerTrafficConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedEnvironmentProperties(); + } + this.innerProperties().withPeerTrafficConfiguration(peerTrafficConfiguration); + return this; + } + + /** + * Get the privateEndpointConnections property: Private endpoint connections to the resource. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.innerProperties() == null ? null : this.innerProperties().privateEndpointConnections(); + } + + /** + * Get the publicNetworkAccess property: Property to allow or block all public traffic. Allowed Values: 'Enabled', + * 'Disabled'. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.innerProperties() == null ? null : this.innerProperties().publicNetworkAccess(); + } + + /** + * Set the publicNetworkAccess property: Property to allow or block all public traffic. Allowed Values: 'Enabled', + * 'Disabled'. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the ManagedEnvironmentInner object itself. + */ + public ManagedEnvironmentInner withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedEnvironmentProperties(); + } + this.innerProperties().withPublicNetworkAccess(publicNetworkAccess); + return this; + } + /** * Validates the instance. * @@ -507,4 +611,62 @@ public void validate() { innerProperties().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.writeStringField("kind", this.kind); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedEnvironmentInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedEnvironmentInner 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 ManagedEnvironmentInner. + */ + public static ManagedEnvironmentInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedEnvironmentInner deserializedManagedEnvironmentInner = new ManagedEnvironmentInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedManagedEnvironmentInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedManagedEnvironmentInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedManagedEnvironmentInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedManagedEnvironmentInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedManagedEnvironmentInner.withTags(tags); + } else if ("kind".equals(fieldName)) { + deserializedManagedEnvironmentInner.kind = reader.getString(); + } else if ("identity".equals(fieldName)) { + deserializedManagedEnvironmentInner.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedManagedEnvironmentInner.innerProperties = ManagedEnvironmentProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedManagedEnvironmentInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedEnvironmentInner; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ManagedEnvironmentProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ManagedEnvironmentProperties.java index 8cdc1ac40fbd..a2f8451b0f7f 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ManagedEnvironmentProperties.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ManagedEnvironmentProperties.java @@ -5,6 +5,10 @@ package com.azure.resourcemanager.appcontainers.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.appcontainers.models.AppInsightsConfiguration; import com.azure.resourcemanager.appcontainers.models.AppLogsConfiguration; import com.azure.resourcemanager.appcontainers.models.CustomDomainConfiguration; @@ -12,57 +16,52 @@ import com.azure.resourcemanager.appcontainers.models.EnvironmentProvisioningState; import com.azure.resourcemanager.appcontainers.models.KedaConfiguration; import com.azure.resourcemanager.appcontainers.models.ManagedEnvironmentPropertiesPeerAuthentication; +import com.azure.resourcemanager.appcontainers.models.ManagedEnvironmentPropertiesPeerTrafficConfiguration; import com.azure.resourcemanager.appcontainers.models.OpenTelemetryConfiguration; +import com.azure.resourcemanager.appcontainers.models.PublicNetworkAccess; import com.azure.resourcemanager.appcontainers.models.VnetConfiguration; import com.azure.resourcemanager.appcontainers.models.WorkloadProfile; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * Managed environment resource specific properties. */ @Fluent -public final class ManagedEnvironmentProperties { +public final class ManagedEnvironmentProperties implements JsonSerializable { /* * Provisioning state of the Environment. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private EnvironmentProvisioningState provisioningState; /* * Azure Monitor instrumentation key used by Dapr to export Service to Service communication telemetry */ - @JsonProperty(value = "daprAIInstrumentationKey") private String daprAIInstrumentationKey; /* * Application Insights connection string used by Dapr to export Service to Service communication telemetry */ - @JsonProperty(value = "daprAIConnectionString") private String daprAIConnectionString; /* * Vnet configuration for the environment */ - @JsonProperty(value = "vnetConfiguration") private VnetConfiguration vnetConfiguration; /* * Any errors that occurred during deployment or deployment validation */ - @JsonProperty(value = "deploymentErrors", access = JsonProperty.Access.WRITE_ONLY) private String deploymentErrors; /* * Default Domain Name for the cluster */ - @JsonProperty(value = "defaultDomain", access = JsonProperty.Access.WRITE_ONLY) private String defaultDomain; /* * Static IP of the Environment */ - @JsonProperty(value = "staticIp", access = JsonProperty.Access.WRITE_ONLY) private String staticIp; /* @@ -70,71 +69,74 @@ public final class ManagedEnvironmentProperties { * app logs to a destination. Currently only "log-analytics" is * supported */ - @JsonProperty(value = "appLogsConfiguration") private AppLogsConfiguration appLogsConfiguration; /* * Environment level Application Insights configuration */ - @JsonProperty(value = "appInsightsConfiguration") private AppInsightsConfiguration appInsightsConfiguration; /* * Environment Open Telemetry configuration */ - @JsonProperty(value = "openTelemetryConfiguration") private OpenTelemetryConfiguration openTelemetryConfiguration; /* * Whether or not this Managed Environment is zone-redundant. */ - @JsonProperty(value = "zoneRedundant") private Boolean zoneRedundant; /* * Custom domain configuration for the environment */ - @JsonProperty(value = "customDomainConfiguration") private CustomDomainConfiguration customDomainConfiguration; /* * The endpoint of the eventstream of the Environment. */ - @JsonProperty(value = "eventStreamEndpoint", access = JsonProperty.Access.WRITE_ONLY) private String eventStreamEndpoint; /* * Workload profiles configured for the Managed Environment. */ - @JsonProperty(value = "workloadProfiles") private List workloadProfiles; /* * The configuration of Keda component. */ - @JsonProperty(value = "kedaConfiguration") private KedaConfiguration kedaConfiguration; /* * The configuration of Dapr component. */ - @JsonProperty(value = "daprConfiguration") private DaprConfiguration daprConfiguration; /* - * Name of the platform-managed resource group created for the Managed Environment to host infrastructure - * resources. If a subnet ID is provided, this resource group will be created in the same subscription as the - * subnet. + * Name of the platform-managed resource group created for the Managed Environment to host infrastructure resources. + * If a subnet ID is provided, this resource group will be created in the same subscription as the subnet. */ - @JsonProperty(value = "infrastructureResourceGroup") private String infrastructureResourceGroup; /* * Peer authentication settings for the Managed Environment */ - @JsonProperty(value = "peerAuthentication") private ManagedEnvironmentPropertiesPeerAuthentication peerAuthentication; + /* + * Peer traffic settings for the Managed Environment + */ + private ManagedEnvironmentPropertiesPeerTrafficConfiguration peerTrafficConfiguration; + + /* + * Private endpoint connections to the resource. + */ + private List privateEndpointConnections; + + /* + * Property to allow or block all public traffic. Allowed Values: 'Enabled', 'Disabled'. + */ + private PublicNetworkAccess publicNetworkAccess; + /** * Creates an instance of ManagedEnvironmentProperties class. */ @@ -173,8 +175,8 @@ public ManagedEnvironmentProperties withDaprAIInstrumentationKey(String daprAIIn } /** - * Get the daprAIConnectionString property: Application Insights connection string used by Dapr to export Service - * to Service communication telemetry. + * Get the daprAIConnectionString property: Application Insights connection string used by Dapr to export Service to + * Service communication telemetry. * * @return the daprAIConnectionString value. */ @@ -183,8 +185,8 @@ public String daprAIConnectionString() { } /** - * Set the daprAIConnectionString property: Application Insights connection string used by Dapr to export Service - * to Service communication telemetry. + * Set the daprAIConnectionString property: Application Insights connection string used by Dapr to export Service to + * Service communication telemetry. * * @param daprAIConnectionString the daprAIConnectionString value to set. * @return the ManagedEnvironmentProperties object itself. @@ -418,9 +420,9 @@ public ManagedEnvironmentProperties withDaprConfiguration(DaprConfiguration dapr } /** - * Get the infrastructureResourceGroup property: Name of the platform-managed resource group created for the - * Managed Environment to host infrastructure resources. If a subnet ID is provided, this resource group will be - * created in the same subscription as the subnet. + * Get the infrastructureResourceGroup property: Name of the platform-managed resource group created for the Managed + * Environment to host infrastructure resources. If a subnet ID is provided, this resource group will be created in + * the same subscription as the subnet. * * @return the infrastructureResourceGroup value. */ @@ -429,9 +431,9 @@ public String infrastructureResourceGroup() { } /** - * Set the infrastructureResourceGroup property: Name of the platform-managed resource group created for the - * Managed Environment to host infrastructure resources. If a subnet ID is provided, this resource group will be - * created in the same subscription as the subnet. + * Set the infrastructureResourceGroup property: Name of the platform-managed resource group created for the Managed + * Environment to host infrastructure resources. If a subnet ID is provided, this resource group will be created in + * the same subscription as the subnet. * * @param infrastructureResourceGroup the infrastructureResourceGroup value to set. * @return the ManagedEnvironmentProperties object itself. @@ -462,6 +464,58 @@ public ManagedEnvironmentPropertiesPeerAuthentication peerAuthentication() { return this; } + /** + * Get the peerTrafficConfiguration property: Peer traffic settings for the Managed Environment. + * + * @return the peerTrafficConfiguration value. + */ + public ManagedEnvironmentPropertiesPeerTrafficConfiguration peerTrafficConfiguration() { + return this.peerTrafficConfiguration; + } + + /** + * Set the peerTrafficConfiguration property: Peer traffic settings for the Managed Environment. + * + * @param peerTrafficConfiguration the peerTrafficConfiguration value to set. + * @return the ManagedEnvironmentProperties object itself. + */ + public ManagedEnvironmentProperties + withPeerTrafficConfiguration(ManagedEnvironmentPropertiesPeerTrafficConfiguration peerTrafficConfiguration) { + this.peerTrafficConfiguration = peerTrafficConfiguration; + return this; + } + + /** + * Get the privateEndpointConnections property: Private endpoint connections to the resource. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** + * Get the publicNetworkAccess property: Property to allow or block all public traffic. Allowed Values: 'Enabled', + * 'Disabled'. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.publicNetworkAccess; + } + + /** + * Set the publicNetworkAccess property: Property to allow or block all public traffic. Allowed Values: 'Enabled', + * 'Disabled'. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the ManagedEnvironmentProperties object itself. + */ + public ManagedEnvironmentProperties withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + return this; + } + /** * Validates the instance. * @@ -495,5 +549,115 @@ public void validate() { if (peerAuthentication() != null) { peerAuthentication().validate(); } + if (peerTrafficConfiguration() != null) { + peerTrafficConfiguration().validate(); + } + if (privateEndpointConnections() != null) { + privateEndpointConnections().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("daprAIInstrumentationKey", this.daprAIInstrumentationKey); + jsonWriter.writeStringField("daprAIConnectionString", this.daprAIConnectionString); + jsonWriter.writeJsonField("vnetConfiguration", this.vnetConfiguration); + jsonWriter.writeJsonField("appLogsConfiguration", this.appLogsConfiguration); + jsonWriter.writeJsonField("appInsightsConfiguration", this.appInsightsConfiguration); + jsonWriter.writeJsonField("openTelemetryConfiguration", this.openTelemetryConfiguration); + jsonWriter.writeBooleanField("zoneRedundant", this.zoneRedundant); + jsonWriter.writeJsonField("customDomainConfiguration", this.customDomainConfiguration); + jsonWriter.writeArrayField("workloadProfiles", this.workloadProfiles, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("kedaConfiguration", this.kedaConfiguration); + jsonWriter.writeJsonField("daprConfiguration", this.daprConfiguration); + jsonWriter.writeStringField("infrastructureResourceGroup", this.infrastructureResourceGroup); + jsonWriter.writeJsonField("peerAuthentication", this.peerAuthentication); + jsonWriter.writeJsonField("peerTrafficConfiguration", this.peerTrafficConfiguration); + jsonWriter.writeStringField("publicNetworkAccess", + this.publicNetworkAccess == null ? null : this.publicNetworkAccess.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedEnvironmentProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedEnvironmentProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedEnvironmentProperties. + */ + public static ManagedEnvironmentProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedEnvironmentProperties deserializedManagedEnvironmentProperties = new ManagedEnvironmentProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedManagedEnvironmentProperties.provisioningState + = EnvironmentProvisioningState.fromString(reader.getString()); + } else if ("daprAIInstrumentationKey".equals(fieldName)) { + deserializedManagedEnvironmentProperties.daprAIInstrumentationKey = reader.getString(); + } else if ("daprAIConnectionString".equals(fieldName)) { + deserializedManagedEnvironmentProperties.daprAIConnectionString = reader.getString(); + } else if ("vnetConfiguration".equals(fieldName)) { + deserializedManagedEnvironmentProperties.vnetConfiguration = VnetConfiguration.fromJson(reader); + } else if ("deploymentErrors".equals(fieldName)) { + deserializedManagedEnvironmentProperties.deploymentErrors = reader.getString(); + } else if ("defaultDomain".equals(fieldName)) { + deserializedManagedEnvironmentProperties.defaultDomain = reader.getString(); + } else if ("staticIp".equals(fieldName)) { + deserializedManagedEnvironmentProperties.staticIp = reader.getString(); + } else if ("appLogsConfiguration".equals(fieldName)) { + deserializedManagedEnvironmentProperties.appLogsConfiguration + = AppLogsConfiguration.fromJson(reader); + } else if ("appInsightsConfiguration".equals(fieldName)) { + deserializedManagedEnvironmentProperties.appInsightsConfiguration + = AppInsightsConfiguration.fromJson(reader); + } else if ("openTelemetryConfiguration".equals(fieldName)) { + deserializedManagedEnvironmentProperties.openTelemetryConfiguration + = OpenTelemetryConfiguration.fromJson(reader); + } else if ("zoneRedundant".equals(fieldName)) { + deserializedManagedEnvironmentProperties.zoneRedundant = reader.getNullable(JsonReader::getBoolean); + } else if ("customDomainConfiguration".equals(fieldName)) { + deserializedManagedEnvironmentProperties.customDomainConfiguration + = CustomDomainConfiguration.fromJson(reader); + } else if ("eventStreamEndpoint".equals(fieldName)) { + deserializedManagedEnvironmentProperties.eventStreamEndpoint = reader.getString(); + } else if ("workloadProfiles".equals(fieldName)) { + List workloadProfiles + = reader.readArray(reader1 -> WorkloadProfile.fromJson(reader1)); + deserializedManagedEnvironmentProperties.workloadProfiles = workloadProfiles; + } else if ("kedaConfiguration".equals(fieldName)) { + deserializedManagedEnvironmentProperties.kedaConfiguration = KedaConfiguration.fromJson(reader); + } else if ("daprConfiguration".equals(fieldName)) { + deserializedManagedEnvironmentProperties.daprConfiguration = DaprConfiguration.fromJson(reader); + } else if ("infrastructureResourceGroup".equals(fieldName)) { + deserializedManagedEnvironmentProperties.infrastructureResourceGroup = reader.getString(); + } else if ("peerAuthentication".equals(fieldName)) { + deserializedManagedEnvironmentProperties.peerAuthentication + = ManagedEnvironmentPropertiesPeerAuthentication.fromJson(reader); + } else if ("peerTrafficConfiguration".equals(fieldName)) { + deserializedManagedEnvironmentProperties.peerTrafficConfiguration + = ManagedEnvironmentPropertiesPeerTrafficConfiguration.fromJson(reader); + } else if ("privateEndpointConnections".equals(fieldName)) { + List privateEndpointConnections + = reader.readArray(reader1 -> PrivateEndpointConnectionInner.fromJson(reader1)); + deserializedManagedEnvironmentProperties.privateEndpointConnections = privateEndpointConnections; + } else if ("publicNetworkAccess".equals(fieldName)) { + deserializedManagedEnvironmentProperties.publicNetworkAccess + = PublicNetworkAccess.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedEnvironmentProperties; + }); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ManagedEnvironmentStorageInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ManagedEnvironmentStorageInner.java index 57742145165c..0dae489da5c7 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ManagedEnvironmentStorageInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ManagedEnvironmentStorageInner.java @@ -7,8 +7,11 @@ 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.appcontainers.models.ManagedEnvironmentStorageProperties; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * Storage resource for managedEnvironment. @@ -18,15 +21,28 @@ public final class ManagedEnvironmentStorageInner extends ProxyResource { /* * Storage properties */ - @JsonProperty(value = "properties") private ManagedEnvironmentStorageProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + /** * Creates an instance of ManagedEnvironmentStorageInner class. */ @@ -62,6 +78,36 @@ public SystemData systemData() { return this.systemData; } + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + /** * Validates the instance. * @@ -72,4 +118,51 @@ public void validate() { 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 ManagedEnvironmentStorageInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedEnvironmentStorageInner 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 ManagedEnvironmentStorageInner. + */ + public static ManagedEnvironmentStorageInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedEnvironmentStorageInner deserializedManagedEnvironmentStorageInner + = new ManagedEnvironmentStorageInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedManagedEnvironmentStorageInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedManagedEnvironmentStorageInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedManagedEnvironmentStorageInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedManagedEnvironmentStorageInner.properties + = ManagedEnvironmentStorageProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedManagedEnvironmentStorageInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedEnvironmentStorageInner; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ManagedEnvironmentStoragesCollectionInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ManagedEnvironmentStoragesCollectionInner.java index 58a26bebfd69..ca0c960c9eab 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ManagedEnvironmentStoragesCollectionInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ManagedEnvironmentStoragesCollectionInner.java @@ -6,18 +6,22 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.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; /** * Collection of Storage for Environments. */ @Fluent -public final class ManagedEnvironmentStoragesCollectionInner { +public final class ManagedEnvironmentStoragesCollectionInner + implements JsonSerializable { /* * Collection of storage resources. */ - @JsonProperty(value = "value", required = true) private List value; /** @@ -53,12 +57,53 @@ public ManagedEnvironmentStoragesCollectionInner withValue(List e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(ManagedEnvironmentStoragesCollectionInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedEnvironmentStoragesCollectionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedEnvironmentStoragesCollectionInner 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 ManagedEnvironmentStoragesCollectionInner. + */ + public static ManagedEnvironmentStoragesCollectionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedEnvironmentStoragesCollectionInner deserializedManagedEnvironmentStoragesCollectionInner + = new ManagedEnvironmentStoragesCollectionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ManagedEnvironmentStorageInner.fromJson(reader1)); + deserializedManagedEnvironmentStoragesCollectionInner.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedManagedEnvironmentStoragesCollectionInner; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/OperationDetailInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/OperationDetailInner.java index da3d614ef163..d67f73e58a9b 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/OperationDetailInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/OperationDetailInner.java @@ -5,36 +5,36 @@ package com.azure.resourcemanager.appcontainers.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.appcontainers.models.OperationDisplay; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * Operation detail payload. */ @Fluent -public final class OperationDetailInner { +public final class OperationDetailInner implements JsonSerializable { /* * Name of the operation */ - @JsonProperty(value = "name") private String name; /* * Indicates whether the operation is a data action */ - @JsonProperty(value = "isDataAction") private Boolean isDataAction; /* * Display of the operation */ - @JsonProperty(value = "display") private OperationDisplay display; /* * Origin of the operation */ - @JsonProperty(value = "origin") private String origin; /** @@ -133,4 +133,49 @@ public void validate() { display().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeBooleanField("isDataAction", this.isDataAction); + jsonWriter.writeJsonField("display", this.display); + jsonWriter.writeStringField("origin", this.origin); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationDetailInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationDetailInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationDetailInner. + */ + public static OperationDetailInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationDetailInner deserializedOperationDetailInner = new OperationDetailInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedOperationDetailInner.name = reader.getString(); + } else if ("isDataAction".equals(fieldName)) { + deserializedOperationDetailInner.isDataAction = reader.getNullable(JsonReader::getBoolean); + } else if ("display".equals(fieldName)) { + deserializedOperationDetailInner.display = OperationDisplay.fromJson(reader); + } else if ("origin".equals(fieldName)) { + deserializedOperationDetailInner.origin = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationDetailInner; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/PrivateEndpointConnectionInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/PrivateEndpointConnectionInner.java new file mode 100644 index 000000000000..81b5224c3217 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/PrivateEndpointConnectionInner.java @@ -0,0 +1,227 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.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.appcontainers.models.PrivateEndpoint; +import com.azure.resourcemanager.appcontainers.models.PrivateEndpointConnectionProvisioningState; +import com.azure.resourcemanager.appcontainers.models.PrivateLinkServiceConnectionState; +import java.io.IOException; +import java.util.List; + +/** + * The Private Endpoint Connection resource. + */ +@Fluent +public final class PrivateEndpointConnectionInner extends ProxyResource { + /* + * Resource properties. + */ + private PrivateEndpointConnectionProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + + /** + * Creates an instance of PrivateEndpointConnectionInner class. + */ + public PrivateEndpointConnectionInner() { + } + + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. + */ + private PrivateEndpointConnectionProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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 id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the groupIds property: The group ids for the private endpoint resource. + * + * @return the groupIds value. + */ + public List groupIds() { + return this.innerProperties() == null ? null : this.innerProperties().groupIds(); + } + + /** + * Get the privateEndpoint property: The resource of private end point. + * + * @return the privateEndpoint value. + */ + public PrivateEndpoint privateEndpoint() { + return this.innerProperties() == null ? null : this.innerProperties().privateEndpoint(); + } + + /** + * Set the privateEndpoint property: The resource of private end point. + * + * @param privateEndpoint the privateEndpoint value to set. + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateEndpointConnectionProperties(); + } + this.innerProperties().withPrivateEndpoint(privateEndpoint); + return this; + } + + /** + * Get the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @return the privateLinkServiceConnectionState value. + */ + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.innerProperties() == null ? null : this.innerProperties().privateLinkServiceConnectionState(); + } + + /** + * Set the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner + withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateEndpointConnectionProperties(); + } + this.innerProperties().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the private endpoint connection resource. + * + * @return the provisioningState value. + */ + public PrivateEndpointConnectionProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpointConnectionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpointConnectionInner 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 PrivateEndpointConnectionInner. + */ + public static PrivateEndpointConnectionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpointConnectionInner deserializedPrivateEndpointConnectionInner + = new PrivateEndpointConnectionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.innerProperties + = PrivateEndpointConnectionProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpointConnectionInner; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/PrivateEndpointConnectionProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/PrivateEndpointConnectionProperties.java new file mode 100644 index 000000000000..6ccaf7bee389 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/PrivateEndpointConnectionProperties.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.appcontainers.fluent.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.appcontainers.models.PrivateEndpoint; +import com.azure.resourcemanager.appcontainers.models.PrivateEndpointConnectionProvisioningState; +import com.azure.resourcemanager.appcontainers.models.PrivateLinkServiceConnectionState; +import java.io.IOException; +import java.util.List; + +/** + * Properties of the private endpoint connection. + */ +@Fluent +public final class PrivateEndpointConnectionProperties + implements JsonSerializable { + /* + * The group ids for the private endpoint resource. + */ + private List groupIds; + + /* + * The resource of private end point. + */ + private PrivateEndpoint privateEndpoint; + + /* + * A collection of information about the state of the connection between service consumer and provider. + */ + private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; + + /* + * The provisioning state of the private endpoint connection resource. + */ + private PrivateEndpointConnectionProvisioningState provisioningState; + + /** + * Creates an instance of PrivateEndpointConnectionProperties class. + */ + public PrivateEndpointConnectionProperties() { + } + + /** + * Get the groupIds property: The group ids for the private endpoint resource. + * + * @return the groupIds value. + */ + public List groupIds() { + return this.groupIds; + } + + /** + * Get the privateEndpoint property: The resource of private end point. + * + * @return the privateEndpoint value. + */ + public PrivateEndpoint privateEndpoint() { + return this.privateEndpoint; + } + + /** + * Set the privateEndpoint property: The resource of private end point. + * + * @param privateEndpoint the privateEndpoint value to set. + * @return the PrivateEndpointConnectionProperties object itself. + */ + public PrivateEndpointConnectionProperties withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.privateEndpoint = privateEndpoint; + return this; + } + + /** + * Get the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @return the privateLinkServiceConnectionState value. + */ + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.privateLinkServiceConnectionState; + } + + /** + * Set the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. + * @return the PrivateEndpointConnectionProperties object itself. + */ + public PrivateEndpointConnectionProperties + withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the private endpoint connection resource. + * + * @return the provisioningState value. + */ + public PrivateEndpointConnectionProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (privateEndpoint() != null) { + privateEndpoint().validate(); + } + if (privateLinkServiceConnectionState() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property privateLinkServiceConnectionState in model PrivateEndpointConnectionProperties")); + } else { + privateLinkServiceConnectionState().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PrivateEndpointConnectionProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("privateLinkServiceConnectionState", this.privateLinkServiceConnectionState); + jsonWriter.writeJsonField("privateEndpoint", this.privateEndpoint); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpointConnectionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpointConnectionProperties 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 PrivateEndpointConnectionProperties. + */ + public static PrivateEndpointConnectionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpointConnectionProperties deserializedPrivateEndpointConnectionProperties + = new PrivateEndpointConnectionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("privateLinkServiceConnectionState".equals(fieldName)) { + deserializedPrivateEndpointConnectionProperties.privateLinkServiceConnectionState + = PrivateLinkServiceConnectionState.fromJson(reader); + } else if ("groupIds".equals(fieldName)) { + List groupIds = reader.readArray(reader1 -> reader1.getString()); + deserializedPrivateEndpointConnectionProperties.groupIds = groupIds; + } else if ("privateEndpoint".equals(fieldName)) { + deserializedPrivateEndpointConnectionProperties.privateEndpoint = PrivateEndpoint.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedPrivateEndpointConnectionProperties.provisioningState + = PrivateEndpointConnectionProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpointConnectionProperties; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/PrivateLinkResourceInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/PrivateLinkResourceInner.java new file mode 100644 index 000000000000..a618742e74df --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/PrivateLinkResourceInner.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.appcontainers.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 java.io.IOException; +import java.util.List; + +/** + * A private link resource. + */ +@Fluent +public final class PrivateLinkResourceInner extends ProxyResource { + /* + * Resource properties. + */ + private PrivateLinkResourceProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + + /** + * Creates an instance of PrivateLinkResourceInner class. + */ + public PrivateLinkResourceInner() { + } + + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. + */ + private PrivateLinkResourceProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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 id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the groupId property: The private link resource group id. + * + * @return the groupId value. + */ + public String groupId() { + return this.innerProperties() == null ? null : this.innerProperties().groupId(); + } + + /** + * Get the requiredMembers property: The private link resource required member names. + * + * @return the requiredMembers value. + */ + public List requiredMembers() { + return this.innerProperties() == null ? null : this.innerProperties().requiredMembers(); + } + + /** + * Get the requiredZoneNames property: The private link resource private link DNS zone name. + * + * @return the requiredZoneNames value. + */ + public List requiredZoneNames() { + return this.innerProperties() == null ? null : this.innerProperties().requiredZoneNames(); + } + + /** + * Set the requiredZoneNames property: The private link resource private link DNS zone name. + * + * @param requiredZoneNames the requiredZoneNames value to set. + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withRequiredZoneNames(List requiredZoneNames) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateLinkResourceProperties(); + } + this.innerProperties().withRequiredZoneNames(requiredZoneNames); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkResourceInner 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 PrivateLinkResourceInner. + */ + public static PrivateLinkResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkResourceInner deserializedPrivateLinkResourceInner = new PrivateLinkResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPrivateLinkResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedPrivateLinkResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedPrivateLinkResourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedPrivateLinkResourceInner.innerProperties + = PrivateLinkResourceProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedPrivateLinkResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkResourceInner; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/PrivateLinkResourceProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/PrivateLinkResourceProperties.java new file mode 100644 index 000000000000..f47ea4ff34d9 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/PrivateLinkResourceProperties.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.appcontainers.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 java.io.IOException; +import java.util.List; + +/** + * Properties of a private link resource. + */ +@Fluent +public final class PrivateLinkResourceProperties implements JsonSerializable { + /* + * The private link resource group id. + */ + private String groupId; + + /* + * The private link resource required member names. + */ + private List requiredMembers; + + /* + * The private link resource private link DNS zone name. + */ + private List requiredZoneNames; + + /** + * Creates an instance of PrivateLinkResourceProperties class. + */ + public PrivateLinkResourceProperties() { + } + + /** + * Get the groupId property: The private link resource group id. + * + * @return the groupId value. + */ + public String groupId() { + return this.groupId; + } + + /** + * Get the requiredMembers property: The private link resource required member names. + * + * @return the requiredMembers value. + */ + public List requiredMembers() { + return this.requiredMembers; + } + + /** + * Get the requiredZoneNames property: The private link resource private link DNS zone name. + * + * @return the requiredZoneNames value. + */ + public List requiredZoneNames() { + return this.requiredZoneNames; + } + + /** + * Set the requiredZoneNames property: The private link resource private link DNS zone name. + * + * @param requiredZoneNames the requiredZoneNames value to set. + * @return the PrivateLinkResourceProperties object itself. + */ + public PrivateLinkResourceProperties withRequiredZoneNames(List requiredZoneNames) { + this.requiredZoneNames = requiredZoneNames; + return this; + } + + /** + * Validates the instance. + * + * @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("requiredZoneNames", this.requiredZoneNames, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkResourceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkResourceProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateLinkResourceProperties. + */ + public static PrivateLinkResourceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkResourceProperties deserializedPrivateLinkResourceProperties + = new PrivateLinkResourceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("groupId".equals(fieldName)) { + deserializedPrivateLinkResourceProperties.groupId = reader.getString(); + } else if ("requiredMembers".equals(fieldName)) { + List requiredMembers = reader.readArray(reader1 -> reader1.getString()); + deserializedPrivateLinkResourceProperties.requiredMembers = requiredMembers; + } else if ("requiredZoneNames".equals(fieldName)) { + List requiredZoneNames = reader.readArray(reader1 -> reader1.getString()); + deserializedPrivateLinkResourceProperties.requiredZoneNames = requiredZoneNames; + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkResourceProperties; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ReplicaCollectionInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ReplicaCollectionInner.java index ef472cec5078..fb0c68b00763 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ReplicaCollectionInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ReplicaCollectionInner.java @@ -6,18 +6,21 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.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; /** * Container App Revision Replicas collection ARM resource. */ @Fluent -public final class ReplicaCollectionInner { +public final class ReplicaCollectionInner implements JsonSerializable { /* * Collection of resources. */ - @JsonProperty(value = "value", required = true) private List value; /** @@ -53,12 +56,50 @@ public ReplicaCollectionInner withValue(List value) { */ public void validate() { if (value() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property value in model ReplicaCollectionInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model ReplicaCollectionInner")); } else { value().forEach(e -> e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(ReplicaCollectionInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ReplicaCollectionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ReplicaCollectionInner 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 ReplicaCollectionInner. + */ + public static ReplicaCollectionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ReplicaCollectionInner deserializedReplicaCollectionInner = new ReplicaCollectionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> ReplicaInner.fromJson(reader1)); + deserializedReplicaCollectionInner.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedReplicaCollectionInner; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ReplicaInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ReplicaInner.java index fb33c279dd3f..0a708c8a4486 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ReplicaInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ReplicaInner.java @@ -7,9 +7,12 @@ 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.appcontainers.models.ContainerAppReplicaRunningState; import com.azure.resourcemanager.appcontainers.models.ReplicaContainer; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.time.OffsetDateTime; import java.util.List; @@ -21,15 +24,28 @@ public final class ReplicaInner extends ProxyResource { /* * Replica resource specific properties */ - @JsonProperty(value = "properties") private ReplicaProperties innerProperties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + /** * Creates an instance of ReplicaInner class. */ @@ -54,6 +70,36 @@ public SystemData systemData() { return this.systemData; } + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + /** * Get the createdTime property: Timestamp describing when the pod was created by controller. * @@ -137,4 +183,49 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ReplicaInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ReplicaInner 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 ReplicaInner. + */ + public static ReplicaInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ReplicaInner deserializedReplicaInner = new ReplicaInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedReplicaInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedReplicaInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedReplicaInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedReplicaInner.innerProperties = ReplicaProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedReplicaInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedReplicaInner; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ReplicaProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ReplicaProperties.java index 68dfe31c056b..f2ba7088effc 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ReplicaProperties.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ReplicaProperties.java @@ -5,9 +5,14 @@ package com.azure.resourcemanager.appcontainers.fluent.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 com.azure.resourcemanager.appcontainers.models.ContainerAppReplicaRunningState; import com.azure.resourcemanager.appcontainers.models.ReplicaContainer; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.time.OffsetDateTime; import java.util.List; @@ -15,35 +20,30 @@ * Replica resource specific properties. */ @Fluent -public final class ReplicaProperties { +public final class ReplicaProperties implements JsonSerializable { /* * Timestamp describing when the pod was created by controller */ - @JsonProperty(value = "createdTime", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime createdTime; /* * Current running state of the replica */ - @JsonProperty(value = "runningState", access = JsonProperty.Access.WRITE_ONLY) private ContainerAppReplicaRunningState runningState; /* * The details of replica current running state */ - @JsonProperty(value = "runningStateDetails", access = JsonProperty.Access.WRITE_ONLY) private String runningStateDetails; /* * The containers collection under a replica. */ - @JsonProperty(value = "containers") private List containers; /* * The init containers collection under a replica. */ - @JsonProperty(value = "initContainers") private List initContainers; /** @@ -132,4 +132,55 @@ public void validate() { initContainers().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("containers", this.containers, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("initContainers", this.initContainers, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ReplicaProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ReplicaProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ReplicaProperties. + */ + public static ReplicaProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ReplicaProperties deserializedReplicaProperties = new ReplicaProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("createdTime".equals(fieldName)) { + deserializedReplicaProperties.createdTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("runningState".equals(fieldName)) { + deserializedReplicaProperties.runningState + = ContainerAppReplicaRunningState.fromString(reader.getString()); + } else if ("runningStateDetails".equals(fieldName)) { + deserializedReplicaProperties.runningStateDetails = reader.getString(); + } else if ("containers".equals(fieldName)) { + List containers = reader.readArray(reader1 -> ReplicaContainer.fromJson(reader1)); + deserializedReplicaProperties.containers = containers; + } else if ("initContainers".equals(fieldName)) { + List initContainers + = reader.readArray(reader1 -> ReplicaContainer.fromJson(reader1)); + deserializedReplicaProperties.initContainers = initContainers; + } else { + reader.skipChildren(); + } + } + + return deserializedReplicaProperties; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/RevisionInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/RevisionInner.java index a5635ffbc21b..08adff0bb444 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/RevisionInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/RevisionInner.java @@ -7,11 +7,14 @@ import com.azure.core.annotation.Immutable; 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.appcontainers.models.RevisionHealthState; import com.azure.resourcemanager.appcontainers.models.RevisionProvisioningState; import com.azure.resourcemanager.appcontainers.models.RevisionRunningState; import com.azure.resourcemanager.appcontainers.models.Template; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.time.OffsetDateTime; /** @@ -22,15 +25,28 @@ public final class RevisionInner extends ProxyResource { /* * Revision resource specific properties */ - @JsonProperty(value = "properties") private RevisionProperties innerProperties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + /** * Creates an instance of RevisionInner class. */ @@ -55,6 +71,36 @@ public SystemData systemData() { return this.systemData; } + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + /** * Get the createdTime property: Timestamp describing when the revision was created * by controller. @@ -168,4 +214,49 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RevisionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RevisionInner 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 RevisionInner. + */ + public static RevisionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RevisionInner deserializedRevisionInner = new RevisionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedRevisionInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedRevisionInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedRevisionInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedRevisionInner.innerProperties = RevisionProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedRevisionInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRevisionInner; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/RevisionProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/RevisionProperties.java index e05d58766764..29f8e0525ebb 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/RevisionProperties.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/RevisionProperties.java @@ -5,35 +5,37 @@ package com.azure.resourcemanager.appcontainers.fluent.models; import com.azure.core.annotation.Immutable; +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 com.azure.resourcemanager.appcontainers.models.RevisionHealthState; import com.azure.resourcemanager.appcontainers.models.RevisionProvisioningState; import com.azure.resourcemanager.appcontainers.models.RevisionRunningState; import com.azure.resourcemanager.appcontainers.models.Template; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.time.OffsetDateTime; /** * Revision resource specific properties. */ @Immutable -public final class RevisionProperties { +public final class RevisionProperties implements JsonSerializable { /* * Timestamp describing when the revision was created * by controller */ - @JsonProperty(value = "createdTime", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime createdTime; /* * Timestamp describing when the revision was last active. Only meaningful when revision is inactive */ - @JsonProperty(value = "lastActiveTime", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime lastActiveTime; /* * Fully qualified domain name of the revision */ - @JsonProperty(value = "fqdn", access = JsonProperty.Access.WRITE_ONLY) private String fqdn; /* @@ -41,49 +43,41 @@ public final class RevisionProperties { * defaults if user did not provide them. The defaults are populated * as they were at the creation time */ - @JsonProperty(value = "template", access = JsonProperty.Access.WRITE_ONLY) private Template template; /* * Boolean describing if the Revision is Active */ - @JsonProperty(value = "active", access = JsonProperty.Access.WRITE_ONLY) private Boolean active; /* * Number of pods currently running for this revision */ - @JsonProperty(value = "replicas", access = JsonProperty.Access.WRITE_ONLY) private Integer replicas; /* * Traffic weight assigned to this revision */ - @JsonProperty(value = "trafficWeight", access = JsonProperty.Access.WRITE_ONLY) private Integer trafficWeight; /* * Optional Field - Platform Error Message */ - @JsonProperty(value = "provisioningError", access = JsonProperty.Access.WRITE_ONLY) private String provisioningError; /* * Current health State of the revision */ - @JsonProperty(value = "healthState", access = JsonProperty.Access.WRITE_ONLY) private RevisionHealthState healthState; /* * Current provisioning State of the revision */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private RevisionProvisioningState provisioningState; /* * Current running state of the revision */ - @JsonProperty(value = "runningState", access = JsonProperty.Access.WRITE_ONLY) private RevisionRunningState runningState; /** @@ -205,4 +199,62 @@ public void validate() { template().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RevisionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RevisionProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the RevisionProperties. + */ + public static RevisionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RevisionProperties deserializedRevisionProperties = new RevisionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("createdTime".equals(fieldName)) { + deserializedRevisionProperties.createdTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastActiveTime".equals(fieldName)) { + deserializedRevisionProperties.lastActiveTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("fqdn".equals(fieldName)) { + deserializedRevisionProperties.fqdn = reader.getString(); + } else if ("template".equals(fieldName)) { + deserializedRevisionProperties.template = Template.fromJson(reader); + } else if ("active".equals(fieldName)) { + deserializedRevisionProperties.active = reader.getNullable(JsonReader::getBoolean); + } else if ("replicas".equals(fieldName)) { + deserializedRevisionProperties.replicas = reader.getNullable(JsonReader::getInt); + } else if ("trafficWeight".equals(fieldName)) { + deserializedRevisionProperties.trafficWeight = reader.getNullable(JsonReader::getInt); + } else if ("provisioningError".equals(fieldName)) { + deserializedRevisionProperties.provisioningError = reader.getString(); + } else if ("healthState".equals(fieldName)) { + deserializedRevisionProperties.healthState = RevisionHealthState.fromString(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedRevisionProperties.provisioningState + = RevisionProvisioningState.fromString(reader.getString()); + } else if ("runningState".equals(fieldName)) { + deserializedRevisionProperties.runningState = RevisionRunningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedRevisionProperties; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/SecretsCollectionInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/SecretsCollectionInner.java index f3ee91d90586..89c90347637c 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/SecretsCollectionInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/SecretsCollectionInner.java @@ -6,19 +6,22 @@ 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.appcontainers.models.ContainerAppSecret; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * Container App Secrets Collection ARM resource. */ @Fluent -public final class SecretsCollectionInner { +public final class SecretsCollectionInner implements JsonSerializable { /* * Collection of resources. */ - @JsonProperty(value = "value", required = true) private List value; /** @@ -54,12 +57,50 @@ public SecretsCollectionInner withValue(List value) { */ public void validate() { if (value() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property value in model SecretsCollectionInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model SecretsCollectionInner")); } else { value().forEach(e -> e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(SecretsCollectionInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecretsCollectionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecretsCollectionInner 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 SecretsCollectionInner. + */ + public static SecretsCollectionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecretsCollectionInner deserializedSecretsCollectionInner = new SecretsCollectionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> ContainerAppSecret.fromJson(reader1)); + deserializedSecretsCollectionInner.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedSecretsCollectionInner; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/SessionPoolInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/SessionPoolInner.java new file mode 100644 index 000000000000..9e0b7b339bd0 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/SessionPoolInner.java @@ -0,0 +1,402 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.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.appcontainers.models.ContainerType; +import com.azure.resourcemanager.appcontainers.models.CustomContainerTemplate; +import com.azure.resourcemanager.appcontainers.models.DynamicPoolConfiguration; +import com.azure.resourcemanager.appcontainers.models.PoolManagementType; +import com.azure.resourcemanager.appcontainers.models.ScaleConfiguration; +import com.azure.resourcemanager.appcontainers.models.SessionNetworkConfiguration; +import com.azure.resourcemanager.appcontainers.models.SessionPoolProvisioningState; +import com.azure.resourcemanager.appcontainers.models.SessionPoolSecret; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Container App session pool. + */ +@Fluent +public final class SessionPoolInner extends Resource { + /* + * Container App session pool resource specific properties + */ + private SessionPoolProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + + /** + * Creates an instance of SessionPoolInner class. + */ + public SessionPoolInner() { + } + + /** + * Get the innerProperties property: Container App session pool resource specific properties. + * + * @return the innerProperties value. + */ + private SessionPoolProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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 id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * {@inheritDoc} + */ + @Override + public SessionPoolInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SessionPoolInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the environmentId property: Resource ID of the session pool's environment. + * + * @return the environmentId value. + */ + public String environmentId() { + return this.innerProperties() == null ? null : this.innerProperties().environmentId(); + } + + /** + * Set the environmentId property: Resource ID of the session pool's environment. + * + * @param environmentId the environmentId value to set. + * @return the SessionPoolInner object itself. + */ + public SessionPoolInner withEnvironmentId(String environmentId) { + if (this.innerProperties() == null) { + this.innerProperties = new SessionPoolProperties(); + } + this.innerProperties().withEnvironmentId(environmentId); + return this; + } + + /** + * Get the containerType property: The container type of the sessions. + * + * @return the containerType value. + */ + public ContainerType containerType() { + return this.innerProperties() == null ? null : this.innerProperties().containerType(); + } + + /** + * Set the containerType property: The container type of the sessions. + * + * @param containerType the containerType value to set. + * @return the SessionPoolInner object itself. + */ + public SessionPoolInner withContainerType(ContainerType containerType) { + if (this.innerProperties() == null) { + this.innerProperties = new SessionPoolProperties(); + } + this.innerProperties().withContainerType(containerType); + return this; + } + + /** + * Get the poolManagementType property: The pool management type of the session pool. + * + * @return the poolManagementType value. + */ + public PoolManagementType poolManagementType() { + return this.innerProperties() == null ? null : this.innerProperties().poolManagementType(); + } + + /** + * Set the poolManagementType property: The pool management type of the session pool. + * + * @param poolManagementType the poolManagementType value to set. + * @return the SessionPoolInner object itself. + */ + public SessionPoolInner withPoolManagementType(PoolManagementType poolManagementType) { + if (this.innerProperties() == null) { + this.innerProperties = new SessionPoolProperties(); + } + this.innerProperties().withPoolManagementType(poolManagementType); + return this; + } + + /** + * Get the nodeCount property: The number of nodes the session pool is using. + * + * @return the nodeCount value. + */ + public Integer nodeCount() { + return this.innerProperties() == null ? null : this.innerProperties().nodeCount(); + } + + /** + * Get the scaleConfiguration property: The scale configuration of the session pool. + * + * @return the scaleConfiguration value. + */ + public ScaleConfiguration scaleConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().scaleConfiguration(); + } + + /** + * Set the scaleConfiguration property: The scale configuration of the session pool. + * + * @param scaleConfiguration the scaleConfiguration value to set. + * @return the SessionPoolInner object itself. + */ + public SessionPoolInner withScaleConfiguration(ScaleConfiguration scaleConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new SessionPoolProperties(); + } + this.innerProperties().withScaleConfiguration(scaleConfiguration); + return this; + } + + /** + * Get the secrets property: The secrets of the session pool. + * + * @return the secrets value. + */ + public List secrets() { + return this.innerProperties() == null ? null : this.innerProperties().secrets(); + } + + /** + * Set the secrets property: The secrets of the session pool. + * + * @param secrets the secrets value to set. + * @return the SessionPoolInner object itself. + */ + public SessionPoolInner withSecrets(List secrets) { + if (this.innerProperties() == null) { + this.innerProperties = new SessionPoolProperties(); + } + this.innerProperties().withSecrets(secrets); + return this; + } + + /** + * Get the dynamicPoolConfiguration property: The pool configuration if the poolManagementType is dynamic. + * + * @return the dynamicPoolConfiguration value. + */ + public DynamicPoolConfiguration dynamicPoolConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().dynamicPoolConfiguration(); + } + + /** + * Set the dynamicPoolConfiguration property: The pool configuration if the poolManagementType is dynamic. + * + * @param dynamicPoolConfiguration the dynamicPoolConfiguration value to set. + * @return the SessionPoolInner object itself. + */ + public SessionPoolInner withDynamicPoolConfiguration(DynamicPoolConfiguration dynamicPoolConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new SessionPoolProperties(); + } + this.innerProperties().withDynamicPoolConfiguration(dynamicPoolConfiguration); + return this; + } + + /** + * Get the customContainerTemplate property: The custom container configuration if the containerType is + * CustomContainer. + * + * @return the customContainerTemplate value. + */ + public CustomContainerTemplate customContainerTemplate() { + return this.innerProperties() == null ? null : this.innerProperties().customContainerTemplate(); + } + + /** + * Set the customContainerTemplate property: The custom container configuration if the containerType is + * CustomContainer. + * + * @param customContainerTemplate the customContainerTemplate value to set. + * @return the SessionPoolInner object itself. + */ + public SessionPoolInner withCustomContainerTemplate(CustomContainerTemplate customContainerTemplate) { + if (this.innerProperties() == null) { + this.innerProperties = new SessionPoolProperties(); + } + this.innerProperties().withCustomContainerTemplate(customContainerTemplate); + return this; + } + + /** + * Get the sessionNetworkConfiguration property: The network configuration of the sessions in the session pool. + * + * @return the sessionNetworkConfiguration value. + */ + public SessionNetworkConfiguration sessionNetworkConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().sessionNetworkConfiguration(); + } + + /** + * Set the sessionNetworkConfiguration property: The network configuration of the sessions in the session pool. + * + * @param sessionNetworkConfiguration the sessionNetworkConfiguration value to set. + * @return the SessionPoolInner object itself. + */ + public SessionPoolInner withSessionNetworkConfiguration(SessionNetworkConfiguration sessionNetworkConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new SessionPoolProperties(); + } + this.innerProperties().withSessionNetworkConfiguration(sessionNetworkConfiguration); + return this; + } + + /** + * Get the poolManagementEndpoint property: The endpoint to manage the pool. + * + * @return the poolManagementEndpoint value. + */ + public String poolManagementEndpoint() { + return this.innerProperties() == null ? null : this.innerProperties().poolManagementEndpoint(); + } + + /** + * Get the provisioningState property: Provisioning state of the session pool. + * + * @return the provisioningState value. + */ + public SessionPoolProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().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.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SessionPoolInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SessionPoolInner 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 SessionPoolInner. + */ + public static SessionPoolInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SessionPoolInner deserializedSessionPoolInner = new SessionPoolInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedSessionPoolInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedSessionPoolInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedSessionPoolInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedSessionPoolInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedSessionPoolInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedSessionPoolInner.innerProperties = SessionPoolProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedSessionPoolInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSessionPoolInner; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/SessionPoolProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/SessionPoolProperties.java new file mode 100644 index 000000000000..02214a703a37 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/SessionPoolProperties.java @@ -0,0 +1,371 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.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.appcontainers.models.ContainerType; +import com.azure.resourcemanager.appcontainers.models.CustomContainerTemplate; +import com.azure.resourcemanager.appcontainers.models.DynamicPoolConfiguration; +import com.azure.resourcemanager.appcontainers.models.PoolManagementType; +import com.azure.resourcemanager.appcontainers.models.ScaleConfiguration; +import com.azure.resourcemanager.appcontainers.models.SessionNetworkConfiguration; +import com.azure.resourcemanager.appcontainers.models.SessionPoolProvisioningState; +import com.azure.resourcemanager.appcontainers.models.SessionPoolSecret; +import java.io.IOException; +import java.util.List; + +/** + * Container App session pool resource specific properties. + */ +@Fluent +public final class SessionPoolProperties implements JsonSerializable { + /* + * Resource ID of the session pool's environment. + */ + private String environmentId; + + /* + * The container type of the sessions. + */ + private ContainerType containerType; + + /* + * The pool management type of the session pool. + */ + private PoolManagementType poolManagementType; + + /* + * The number of nodes the session pool is using. + */ + private Integer nodeCount; + + /* + * The scale configuration of the session pool. + */ + private ScaleConfiguration scaleConfiguration; + + /* + * The secrets of the session pool. + */ + private List secrets; + + /* + * The pool configuration if the poolManagementType is dynamic. + */ + private DynamicPoolConfiguration dynamicPoolConfiguration; + + /* + * The custom container configuration if the containerType is CustomContainer. + */ + private CustomContainerTemplate customContainerTemplate; + + /* + * The network configuration of the sessions in the session pool. + */ + private SessionNetworkConfiguration sessionNetworkConfiguration; + + /* + * The endpoint to manage the pool. + */ + private String poolManagementEndpoint; + + /* + * Provisioning state of the session pool. + */ + private SessionPoolProvisioningState provisioningState; + + /** + * Creates an instance of SessionPoolProperties class. + */ + public SessionPoolProperties() { + } + + /** + * Get the environmentId property: Resource ID of the session pool's environment. + * + * @return the environmentId value. + */ + public String environmentId() { + return this.environmentId; + } + + /** + * Set the environmentId property: Resource ID of the session pool's environment. + * + * @param environmentId the environmentId value to set. + * @return the SessionPoolProperties object itself. + */ + public SessionPoolProperties withEnvironmentId(String environmentId) { + this.environmentId = environmentId; + return this; + } + + /** + * Get the containerType property: The container type of the sessions. + * + * @return the containerType value. + */ + public ContainerType containerType() { + return this.containerType; + } + + /** + * Set the containerType property: The container type of the sessions. + * + * @param containerType the containerType value to set. + * @return the SessionPoolProperties object itself. + */ + public SessionPoolProperties withContainerType(ContainerType containerType) { + this.containerType = containerType; + return this; + } + + /** + * Get the poolManagementType property: The pool management type of the session pool. + * + * @return the poolManagementType value. + */ + public PoolManagementType poolManagementType() { + return this.poolManagementType; + } + + /** + * Set the poolManagementType property: The pool management type of the session pool. + * + * @param poolManagementType the poolManagementType value to set. + * @return the SessionPoolProperties object itself. + */ + public SessionPoolProperties withPoolManagementType(PoolManagementType poolManagementType) { + this.poolManagementType = poolManagementType; + return this; + } + + /** + * Get the nodeCount property: The number of nodes the session pool is using. + * + * @return the nodeCount value. + */ + public Integer nodeCount() { + return this.nodeCount; + } + + /** + * Get the scaleConfiguration property: The scale configuration of the session pool. + * + * @return the scaleConfiguration value. + */ + public ScaleConfiguration scaleConfiguration() { + return this.scaleConfiguration; + } + + /** + * Set the scaleConfiguration property: The scale configuration of the session pool. + * + * @param scaleConfiguration the scaleConfiguration value to set. + * @return the SessionPoolProperties object itself. + */ + public SessionPoolProperties withScaleConfiguration(ScaleConfiguration scaleConfiguration) { + this.scaleConfiguration = scaleConfiguration; + return this; + } + + /** + * Get the secrets property: The secrets of the session pool. + * + * @return the secrets value. + */ + public List secrets() { + return this.secrets; + } + + /** + * Set the secrets property: The secrets of the session pool. + * + * @param secrets the secrets value to set. + * @return the SessionPoolProperties object itself. + */ + public SessionPoolProperties withSecrets(List secrets) { + this.secrets = secrets; + return this; + } + + /** + * Get the dynamicPoolConfiguration property: The pool configuration if the poolManagementType is dynamic. + * + * @return the dynamicPoolConfiguration value. + */ + public DynamicPoolConfiguration dynamicPoolConfiguration() { + return this.dynamicPoolConfiguration; + } + + /** + * Set the dynamicPoolConfiguration property: The pool configuration if the poolManagementType is dynamic. + * + * @param dynamicPoolConfiguration the dynamicPoolConfiguration value to set. + * @return the SessionPoolProperties object itself. + */ + public SessionPoolProperties withDynamicPoolConfiguration(DynamicPoolConfiguration dynamicPoolConfiguration) { + this.dynamicPoolConfiguration = dynamicPoolConfiguration; + return this; + } + + /** + * Get the customContainerTemplate property: The custom container configuration if the containerType is + * CustomContainer. + * + * @return the customContainerTemplate value. + */ + public CustomContainerTemplate customContainerTemplate() { + return this.customContainerTemplate; + } + + /** + * Set the customContainerTemplate property: The custom container configuration if the containerType is + * CustomContainer. + * + * @param customContainerTemplate the customContainerTemplate value to set. + * @return the SessionPoolProperties object itself. + */ + public SessionPoolProperties withCustomContainerTemplate(CustomContainerTemplate customContainerTemplate) { + this.customContainerTemplate = customContainerTemplate; + return this; + } + + /** + * Get the sessionNetworkConfiguration property: The network configuration of the sessions in the session pool. + * + * @return the sessionNetworkConfiguration value. + */ + public SessionNetworkConfiguration sessionNetworkConfiguration() { + return this.sessionNetworkConfiguration; + } + + /** + * Set the sessionNetworkConfiguration property: The network configuration of the sessions in the session pool. + * + * @param sessionNetworkConfiguration the sessionNetworkConfiguration value to set. + * @return the SessionPoolProperties object itself. + */ + public SessionPoolProperties + withSessionNetworkConfiguration(SessionNetworkConfiguration sessionNetworkConfiguration) { + this.sessionNetworkConfiguration = sessionNetworkConfiguration; + return this; + } + + /** + * Get the poolManagementEndpoint property: The endpoint to manage the pool. + * + * @return the poolManagementEndpoint value. + */ + public String poolManagementEndpoint() { + return this.poolManagementEndpoint; + } + + /** + * Get the provisioningState property: Provisioning state of the session pool. + * + * @return the provisioningState value. + */ + public SessionPoolProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (scaleConfiguration() != null) { + scaleConfiguration().validate(); + } + if (secrets() != null) { + secrets().forEach(e -> e.validate()); + } + if (dynamicPoolConfiguration() != null) { + dynamicPoolConfiguration().validate(); + } + if (customContainerTemplate() != null) { + customContainerTemplate().validate(); + } + if (sessionNetworkConfiguration() != null) { + sessionNetworkConfiguration().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("environmentId", this.environmentId); + jsonWriter.writeStringField("containerType", this.containerType == null ? null : this.containerType.toString()); + jsonWriter.writeStringField("poolManagementType", + this.poolManagementType == null ? null : this.poolManagementType.toString()); + jsonWriter.writeJsonField("scaleConfiguration", this.scaleConfiguration); + jsonWriter.writeArrayField("secrets", this.secrets, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("dynamicPoolConfiguration", this.dynamicPoolConfiguration); + jsonWriter.writeJsonField("customContainerTemplate", this.customContainerTemplate); + jsonWriter.writeJsonField("sessionNetworkConfiguration", this.sessionNetworkConfiguration); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SessionPoolProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SessionPoolProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the SessionPoolProperties. + */ + public static SessionPoolProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SessionPoolProperties deserializedSessionPoolProperties = new SessionPoolProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("environmentId".equals(fieldName)) { + deserializedSessionPoolProperties.environmentId = reader.getString(); + } else if ("containerType".equals(fieldName)) { + deserializedSessionPoolProperties.containerType = ContainerType.fromString(reader.getString()); + } else if ("poolManagementType".equals(fieldName)) { + deserializedSessionPoolProperties.poolManagementType + = PoolManagementType.fromString(reader.getString()); + } else if ("nodeCount".equals(fieldName)) { + deserializedSessionPoolProperties.nodeCount = reader.getNullable(JsonReader::getInt); + } else if ("scaleConfiguration".equals(fieldName)) { + deserializedSessionPoolProperties.scaleConfiguration = ScaleConfiguration.fromJson(reader); + } else if ("secrets".equals(fieldName)) { + List secrets = reader.readArray(reader1 -> SessionPoolSecret.fromJson(reader1)); + deserializedSessionPoolProperties.secrets = secrets; + } else if ("dynamicPoolConfiguration".equals(fieldName)) { + deserializedSessionPoolProperties.dynamicPoolConfiguration + = DynamicPoolConfiguration.fromJson(reader); + } else if ("customContainerTemplate".equals(fieldName)) { + deserializedSessionPoolProperties.customContainerTemplate + = CustomContainerTemplate.fromJson(reader); + } else if ("sessionNetworkConfiguration".equals(fieldName)) { + deserializedSessionPoolProperties.sessionNetworkConfiguration + = SessionNetworkConfiguration.fromJson(reader); + } else if ("poolManagementEndpoint".equals(fieldName)) { + deserializedSessionPoolProperties.poolManagementEndpoint = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedSessionPoolProperties.provisioningState + = SessionPoolProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSessionPoolProperties; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/SessionPoolUpdatablePropertiesProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/SessionPoolUpdatablePropertiesProperties.java new file mode 100644 index 000000000000..d826fa30dd3e --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/SessionPoolUpdatablePropertiesProperties.java @@ -0,0 +1,238 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.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.appcontainers.models.CustomContainerTemplate; +import com.azure.resourcemanager.appcontainers.models.DynamicPoolConfiguration; +import com.azure.resourcemanager.appcontainers.models.ScaleConfiguration; +import com.azure.resourcemanager.appcontainers.models.SessionNetworkConfiguration; +import com.azure.resourcemanager.appcontainers.models.SessionPoolSecret; +import java.io.IOException; +import java.util.List; + +/** + * Session pool resource specific updatable properties. + */ +@Fluent +public final class SessionPoolUpdatablePropertiesProperties + implements JsonSerializable { + /* + * The scale configuration of the session pool. + */ + private ScaleConfiguration scaleConfiguration; + + /* + * The secrets of the session pool. + */ + private List secrets; + + /* + * The pool configuration if the poolManagementType is dynamic. + */ + private DynamicPoolConfiguration dynamicPoolConfiguration; + + /* + * The custom container configuration if the containerType is CustomContainer. + */ + private CustomContainerTemplate customContainerTemplate; + + /* + * The network configuration of the sessions in the session pool. + */ + private SessionNetworkConfiguration sessionNetworkConfiguration; + + /** + * Creates an instance of SessionPoolUpdatablePropertiesProperties class. + */ + public SessionPoolUpdatablePropertiesProperties() { + } + + /** + * Get the scaleConfiguration property: The scale configuration of the session pool. + * + * @return the scaleConfiguration value. + */ + public ScaleConfiguration scaleConfiguration() { + return this.scaleConfiguration; + } + + /** + * Set the scaleConfiguration property: The scale configuration of the session pool. + * + * @param scaleConfiguration the scaleConfiguration value to set. + * @return the SessionPoolUpdatablePropertiesProperties object itself. + */ + public SessionPoolUpdatablePropertiesProperties withScaleConfiguration(ScaleConfiguration scaleConfiguration) { + this.scaleConfiguration = scaleConfiguration; + return this; + } + + /** + * Get the secrets property: The secrets of the session pool. + * + * @return the secrets value. + */ + public List secrets() { + return this.secrets; + } + + /** + * Set the secrets property: The secrets of the session pool. + * + * @param secrets the secrets value to set. + * @return the SessionPoolUpdatablePropertiesProperties object itself. + */ + public SessionPoolUpdatablePropertiesProperties withSecrets(List secrets) { + this.secrets = secrets; + return this; + } + + /** + * Get the dynamicPoolConfiguration property: The pool configuration if the poolManagementType is dynamic. + * + * @return the dynamicPoolConfiguration value. + */ + public DynamicPoolConfiguration dynamicPoolConfiguration() { + return this.dynamicPoolConfiguration; + } + + /** + * Set the dynamicPoolConfiguration property: The pool configuration if the poolManagementType is dynamic. + * + * @param dynamicPoolConfiguration the dynamicPoolConfiguration value to set. + * @return the SessionPoolUpdatablePropertiesProperties object itself. + */ + public SessionPoolUpdatablePropertiesProperties + withDynamicPoolConfiguration(DynamicPoolConfiguration dynamicPoolConfiguration) { + this.dynamicPoolConfiguration = dynamicPoolConfiguration; + return this; + } + + /** + * Get the customContainerTemplate property: The custom container configuration if the containerType is + * CustomContainer. + * + * @return the customContainerTemplate value. + */ + public CustomContainerTemplate customContainerTemplate() { + return this.customContainerTemplate; + } + + /** + * Set the customContainerTemplate property: The custom container configuration if the containerType is + * CustomContainer. + * + * @param customContainerTemplate the customContainerTemplate value to set. + * @return the SessionPoolUpdatablePropertiesProperties object itself. + */ + public SessionPoolUpdatablePropertiesProperties + withCustomContainerTemplate(CustomContainerTemplate customContainerTemplate) { + this.customContainerTemplate = customContainerTemplate; + return this; + } + + /** + * Get the sessionNetworkConfiguration property: The network configuration of the sessions in the session pool. + * + * @return the sessionNetworkConfiguration value. + */ + public SessionNetworkConfiguration sessionNetworkConfiguration() { + return this.sessionNetworkConfiguration; + } + + /** + * Set the sessionNetworkConfiguration property: The network configuration of the sessions in the session pool. + * + * @param sessionNetworkConfiguration the sessionNetworkConfiguration value to set. + * @return the SessionPoolUpdatablePropertiesProperties object itself. + */ + public SessionPoolUpdatablePropertiesProperties + withSessionNetworkConfiguration(SessionNetworkConfiguration sessionNetworkConfiguration) { + this.sessionNetworkConfiguration = sessionNetworkConfiguration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (scaleConfiguration() != null) { + scaleConfiguration().validate(); + } + if (secrets() != null) { + secrets().forEach(e -> e.validate()); + } + if (dynamicPoolConfiguration() != null) { + dynamicPoolConfiguration().validate(); + } + if (customContainerTemplate() != null) { + customContainerTemplate().validate(); + } + if (sessionNetworkConfiguration() != null) { + sessionNetworkConfiguration().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("scaleConfiguration", this.scaleConfiguration); + jsonWriter.writeArrayField("secrets", this.secrets, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("dynamicPoolConfiguration", this.dynamicPoolConfiguration); + jsonWriter.writeJsonField("customContainerTemplate", this.customContainerTemplate); + jsonWriter.writeJsonField("sessionNetworkConfiguration", this.sessionNetworkConfiguration); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SessionPoolUpdatablePropertiesProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SessionPoolUpdatablePropertiesProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SessionPoolUpdatablePropertiesProperties. + */ + public static SessionPoolUpdatablePropertiesProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SessionPoolUpdatablePropertiesProperties deserializedSessionPoolUpdatablePropertiesProperties + = new SessionPoolUpdatablePropertiesProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("scaleConfiguration".equals(fieldName)) { + deserializedSessionPoolUpdatablePropertiesProperties.scaleConfiguration + = ScaleConfiguration.fromJson(reader); + } else if ("secrets".equals(fieldName)) { + List secrets = reader.readArray(reader1 -> SessionPoolSecret.fromJson(reader1)); + deserializedSessionPoolUpdatablePropertiesProperties.secrets = secrets; + } else if ("dynamicPoolConfiguration".equals(fieldName)) { + deserializedSessionPoolUpdatablePropertiesProperties.dynamicPoolConfiguration + = DynamicPoolConfiguration.fromJson(reader); + } else if ("customContainerTemplate".equals(fieldName)) { + deserializedSessionPoolUpdatablePropertiesProperties.customContainerTemplate + = CustomContainerTemplate.fromJson(reader); + } else if ("sessionNetworkConfiguration".equals(fieldName)) { + deserializedSessionPoolUpdatablePropertiesProperties.sessionNetworkConfiguration + = SessionNetworkConfiguration.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSessionPoolUpdatablePropertiesProperties; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/SourceControlInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/SourceControlInner.java index 434e069ed942..d9898c404ecc 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/SourceControlInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/SourceControlInner.java @@ -7,9 +7,12 @@ 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.appcontainers.models.GithubActionConfiguration; import com.azure.resourcemanager.appcontainers.models.SourceControlOperationState; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * Container App SourceControl. @@ -19,15 +22,28 @@ public final class SourceControlInner extends ProxyResource { /* * SourceControl resource specific properties */ - @JsonProperty(value = "properties") private SourceControlProperties innerProperties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + /** * Creates an instance of SourceControlInner class. */ @@ -52,6 +68,36 @@ public SystemData systemData() { return this.systemData; } + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + /** * Get the operationState property: Current provisioning State of the operation. * @@ -144,4 +190,49 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SourceControlInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SourceControlInner 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 SourceControlInner. + */ + public static SourceControlInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SourceControlInner deserializedSourceControlInner = new SourceControlInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedSourceControlInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedSourceControlInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedSourceControlInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedSourceControlInner.innerProperties = SourceControlProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedSourceControlInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSourceControlInner; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/SourceControlProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/SourceControlProperties.java index c6111e7ed356..798cb258d277 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/SourceControlProperties.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/SourceControlProperties.java @@ -5,31 +5,32 @@ package com.azure.resourcemanager.appcontainers.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.appcontainers.models.GithubActionConfiguration; import com.azure.resourcemanager.appcontainers.models.SourceControlOperationState; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * SourceControl resource specific properties. */ @Fluent -public final class SourceControlProperties { +public final class SourceControlProperties implements JsonSerializable { /* * Current provisioning State of the operation */ - @JsonProperty(value = "operationState", access = JsonProperty.Access.WRITE_ONLY) private SourceControlOperationState operationState; /* * The repo url which will be integrated to ContainerApp. */ - @JsonProperty(value = "repoUrl") private String repoUrl; /* * The branch which will trigger the auto deployment */ - @JsonProperty(value = "branch") private String branch; /* @@ -37,7 +38,6 @@ public final class SourceControlProperties { * defaults if user did not provide them. The defaults are populated * as they were at the creation time */ - @JsonProperty(value = "githubActionConfiguration") private GithubActionConfiguration githubActionConfiguration; /** @@ -129,4 +129,50 @@ public void validate() { githubActionConfiguration().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("repoUrl", this.repoUrl); + jsonWriter.writeStringField("branch", this.branch); + jsonWriter.writeJsonField("githubActionConfiguration", this.githubActionConfiguration); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SourceControlProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SourceControlProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the SourceControlProperties. + */ + public static SourceControlProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SourceControlProperties deserializedSourceControlProperties = new SourceControlProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("operationState".equals(fieldName)) { + deserializedSourceControlProperties.operationState + = SourceControlOperationState.fromString(reader.getString()); + } else if ("repoUrl".equals(fieldName)) { + deserializedSourceControlProperties.repoUrl = reader.getString(); + } else if ("branch".equals(fieldName)) { + deserializedSourceControlProperties.branch = reader.getString(); + } else if ("githubActionConfiguration".equals(fieldName)) { + deserializedSourceControlProperties.githubActionConfiguration + = GithubActionConfiguration.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSourceControlProperties; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/UsageInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/UsageInner.java index e37f5a12c5f9..652f2a4fc567 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/UsageInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/UsageInner.java @@ -6,36 +6,36 @@ 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.appcontainers.models.UsageName; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * Describes Compute Resource Usage. */ @Fluent -public final class UsageInner { +public final class UsageInner implements JsonSerializable { /* * An enum describing the unit of usage measurement. */ - @JsonProperty(value = "unit", required = true) private String unit = "Count"; /* * The current usage of the resource. */ - @JsonProperty(value = "currentValue", required = true) private float currentValue; /* * The maximum permitted usage of the resource. */ - @JsonProperty(value = "limit", required = true) private float limit; /* * The name of the type of usage. */ - @JsonProperty(value = "name", required = true) private UsageName name; /** @@ -131,12 +131,56 @@ public UsageInner withName(UsageName name) { */ public void validate() { if (name() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property name in model UsageInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property name in model UsageInner")); } else { name().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(UsageInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("unit", this.unit); + jsonWriter.writeFloatField("currentValue", this.currentValue); + jsonWriter.writeFloatField("limit", this.limit); + jsonWriter.writeJsonField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UsageInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UsageInner 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 UsageInner. + */ + public static UsageInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UsageInner deserializedUsageInner = new UsageInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("currentValue".equals(fieldName)) { + deserializedUsageInner.currentValue = reader.getFloat(); + } else if ("limit".equals(fieldName)) { + deserializedUsageInner.limit = reader.getFloat(); + } else if ("name".equals(fieldName)) { + deserializedUsageInner.name = UsageName.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedUsageInner; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/WorkflowEnvelopeInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/WorkflowEnvelopeInner.java new file mode 100644 index 000000000000..ed3a7ea4427c --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/WorkflowEnvelopeInner.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.appcontainers.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.appcontainers.models.WorkflowEnvelopeProperties; +import java.io.IOException; + +/** + * Workflow properties definition. + */ +@Fluent +public final class WorkflowEnvelopeInner implements JsonSerializable { + /* + * The resource id. + */ + private String id; + + /* + * Gets the resource name. + */ + private String name; + + /* + * Gets the resource type. + */ + private String type; + + /* + * The resource kind. + */ + private String kind; + + /* + * The resource location. + */ + private String location; + + /* + * Additional workflow properties. + */ + private WorkflowEnvelopeProperties properties; + + /** + * Creates an instance of WorkflowEnvelopeInner class. + */ + public WorkflowEnvelopeInner() { + } + + /** + * Get the id property: The resource id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: Gets the resource name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the type property: Gets the resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the kind property: The resource kind. + * + * @return the kind value. + */ + public String kind() { + return this.kind; + } + + /** + * Set the kind property: The resource kind. + * + * @param kind the kind value to set. + * @return the WorkflowEnvelopeInner object itself. + */ + public WorkflowEnvelopeInner withKind(String kind) { + this.kind = kind; + return this; + } + + /** + * Get the location property: The resource location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The resource location. + * + * @param location the location value to set. + * @return the WorkflowEnvelopeInner object itself. + */ + public WorkflowEnvelopeInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the properties property: Additional workflow properties. + * + * @return the properties value. + */ + public WorkflowEnvelopeProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Additional workflow properties. + * + * @param properties the properties value to set. + * @return the WorkflowEnvelopeInner object itself. + */ + public WorkflowEnvelopeInner withProperties(WorkflowEnvelopeProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WorkflowEnvelopeInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WorkflowEnvelopeInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the WorkflowEnvelopeInner. + */ + public static WorkflowEnvelopeInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WorkflowEnvelopeInner deserializedWorkflowEnvelopeInner = new WorkflowEnvelopeInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedWorkflowEnvelopeInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedWorkflowEnvelopeInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedWorkflowEnvelopeInner.type = reader.getString(); + } else if ("kind".equals(fieldName)) { + deserializedWorkflowEnvelopeInner.kind = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedWorkflowEnvelopeInner.location = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedWorkflowEnvelopeInner.properties = WorkflowEnvelopeProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedWorkflowEnvelopeInner; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/WorkloadProfileStatesInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/WorkloadProfileStatesInner.java index 50c4bf0688d8..5fa01e7da57c 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/WorkloadProfileStatesInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/WorkloadProfileStatesInner.java @@ -7,8 +7,11 @@ 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.appcontainers.models.WorkloadProfileStatesProperties; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * Collection of all the workload Profile States for a Managed Environment.. @@ -18,15 +21,28 @@ public final class WorkloadProfileStatesInner extends ProxyResource { /* * Workload Profile resource specific properties. */ - @JsonProperty(value = "properties") private WorkloadProfileStatesProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + /** * Creates an instance of WorkloadProfileStatesInner class. */ @@ -62,6 +78,36 @@ public SystemData systemData() { return this.systemData; } + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + /** * Validates the instance. * @@ -72,4 +118,50 @@ public void validate() { 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 WorkloadProfileStatesInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WorkloadProfileStatesInner 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 WorkloadProfileStatesInner. + */ + public static WorkloadProfileStatesInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WorkloadProfileStatesInner deserializedWorkloadProfileStatesInner = new WorkloadProfileStatesInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedWorkloadProfileStatesInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedWorkloadProfileStatesInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedWorkloadProfileStatesInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedWorkloadProfileStatesInner.properties + = WorkloadProfileStatesProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedWorkloadProfileStatesInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedWorkloadProfileStatesInner; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/package-info.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/package-info.java index 9ea383c7aad7..f87287ab52d0 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/package-info.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/package-info.java @@ -4,6 +4,8 @@ /** * Package containing the inner data models for ContainerAppsApiClient. - * null. + * Functions is an extension resource to revisions and the api listed is used to proxy the call from Web RP to the + * function app's host process, this api is not exposed to users and only Web RP is allowed to invoke functions + * extension resource. */ package com.azure.resourcemanager.appcontainers.fluent.models; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/package-info.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/package-info.java index 131b0b619aad..0eba2fe983f2 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/package-info.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/package-info.java @@ -4,6 +4,8 @@ /** * Package containing the service clients for ContainerAppsApiClient. - * null. + * Functions is an extension resource to revisions and the api listed is used to proxy the call from Web RP to the + * function app's host process, this api is not exposed to users and only Web RP is allowed to invoke functions + * extension resource. */ package com.azure.resourcemanager.appcontainers.fluent; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/AppResilienciesClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/AppResilienciesClientImpl.java index af7bcd069fbb..e117050a35fb 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/AppResilienciesClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/AppResilienciesClientImpl.java @@ -60,8 +60,8 @@ public final class AppResilienciesClientImpl implements AppResilienciesClient { } /** - * The interface defining all the services for ContainerAppsApiClientAppResiliencies to be used by the proxy - * service to perform REST calls. + * The interface defining all the services for ContainerAppsApiClientAppResiliencies to be used by the proxy service + * to perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "ContainerAppsApiClie") @@ -874,9 +874,7 @@ public PagedIterable list(String resourceGroupName, String a /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -902,9 +900,7 @@ private Mono> listNextSinglePageAsync(String n /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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 DefaultErrorResponseErrorException thrown if the request is rejected by server. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/AppResiliencyImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/AppResiliencyImpl.java index 2d715f1928f4..ac7c0ecd7a10 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/AppResiliencyImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/AppResiliencyImpl.java @@ -85,14 +85,18 @@ public AppResiliencyImpl withExistingContainerApp(String resourceGroupName, Stri } public AppResiliency create() { - this.innerObject = serviceManager.serviceClient().getAppResiliencies() - .createOrUpdateWithResponse(resourceGroupName, appName, name, this.innerModel(), Context.NONE).getValue(); + this.innerObject = serviceManager.serviceClient() + .getAppResiliencies() + .createOrUpdateWithResponse(resourceGroupName, appName, name, this.innerModel(), Context.NONE) + .getValue(); return this; } public AppResiliency create(Context context) { - this.innerObject = serviceManager.serviceClient().getAppResiliencies() - .createOrUpdateWithResponse(resourceGroupName, appName, name, this.innerModel(), context).getValue(); + this.innerObject = serviceManager.serviceClient() + .getAppResiliencies() + .createOrUpdateWithResponse(resourceGroupName, appName, name, this.innerModel(), context) + .getValue(); return this; } @@ -107,14 +111,18 @@ public AppResiliencyImpl update() { } public AppResiliency apply() { - this.innerObject = serviceManager.serviceClient().getAppResiliencies() - .updateWithResponse(resourceGroupName, appName, name, this.innerModel(), Context.NONE).getValue(); + this.innerObject = serviceManager.serviceClient() + .getAppResiliencies() + .updateWithResponse(resourceGroupName, appName, name, this.innerModel(), Context.NONE) + .getValue(); return this; } public AppResiliency apply(Context context) { - this.innerObject = serviceManager.serviceClient().getAppResiliencies() - .updateWithResponse(resourceGroupName, appName, name, this.innerModel(), context).getValue(); + this.innerObject = serviceManager.serviceClient() + .getAppResiliencies() + .updateWithResponse(resourceGroupName, appName, name, this.innerModel(), context) + .getValue(); return this; } @@ -128,14 +136,18 @@ public AppResiliency apply(Context context) { } public AppResiliency refresh() { - this.innerObject = serviceManager.serviceClient().getAppResiliencies() - .getWithResponse(resourceGroupName, appName, name, Context.NONE).getValue(); + this.innerObject = serviceManager.serviceClient() + .getAppResiliencies() + .getWithResponse(resourceGroupName, appName, name, Context.NONE) + .getValue(); return this; } public AppResiliency refresh(Context context) { - this.innerObject = serviceManager.serviceClient().getAppResiliencies() - .getWithResponse(resourceGroupName, appName, name, context).getValue(); + this.innerObject = serviceManager.serviceClient() + .getAppResiliencies() + .getWithResponse(resourceGroupName, appName, name, context) + .getValue(); return this; } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/AuthConfigImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/AuthConfigImpl.java index 579bbf3d7b60..dac6789aac8f 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/AuthConfigImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/AuthConfigImpl.java @@ -85,14 +85,17 @@ public AuthConfigImpl withExistingContainerApp(String resourceGroupName, String } public AuthConfig create() { - this.innerObject - = serviceManager.serviceClient().getContainerAppsAuthConfigs().createOrUpdateWithResponse(resourceGroupName, - containerAppName, authConfigName, this.innerModel(), Context.NONE).getValue(); + this.innerObject = serviceManager.serviceClient() + .getContainerAppsAuthConfigs() + .createOrUpdateWithResponse(resourceGroupName, containerAppName, authConfigName, this.innerModel(), + Context.NONE) + .getValue(); return this; } public AuthConfig create(Context context) { - this.innerObject = serviceManager.serviceClient().getContainerAppsAuthConfigs() + this.innerObject = serviceManager.serviceClient() + .getContainerAppsAuthConfigs() .createOrUpdateWithResponse(resourceGroupName, containerAppName, authConfigName, this.innerModel(), context) .getValue(); return this; @@ -109,14 +112,17 @@ public AuthConfigImpl update() { } public AuthConfig apply() { - this.innerObject - = serviceManager.serviceClient().getContainerAppsAuthConfigs().createOrUpdateWithResponse(resourceGroupName, - containerAppName, authConfigName, this.innerModel(), Context.NONE).getValue(); + this.innerObject = serviceManager.serviceClient() + .getContainerAppsAuthConfigs() + .createOrUpdateWithResponse(resourceGroupName, containerAppName, authConfigName, this.innerModel(), + Context.NONE) + .getValue(); return this; } public AuthConfig apply(Context context) { - this.innerObject = serviceManager.serviceClient().getContainerAppsAuthConfigs() + this.innerObject = serviceManager.serviceClient() + .getContainerAppsAuthConfigs() .createOrUpdateWithResponse(resourceGroupName, containerAppName, authConfigName, this.innerModel(), context) .getValue(); return this; @@ -132,14 +138,18 @@ public AuthConfig apply(Context context) { } public AuthConfig refresh() { - this.innerObject = serviceManager.serviceClient().getContainerAppsAuthConfigs() - .getWithResponse(resourceGroupName, containerAppName, authConfigName, Context.NONE).getValue(); + this.innerObject = serviceManager.serviceClient() + .getContainerAppsAuthConfigs() + .getWithResponse(resourceGroupName, containerAppName, authConfigName, Context.NONE) + .getValue(); return this; } public AuthConfig refresh(Context context) { - this.innerObject = serviceManager.serviceClient().getContainerAppsAuthConfigs() - .getWithResponse(resourceGroupName, containerAppName, authConfigName, context).getValue(); + this.innerObject = serviceManager.serviceClient() + .getContainerAppsAuthConfigs() + .getWithResponse(resourceGroupName, containerAppName, authConfigName, context) + .getValue(); return this; } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/AvailableWorkloadProfilesClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/AvailableWorkloadProfilesClientImpl.java index 8b2591bf0788..12b04142d7af 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/AvailableWorkloadProfilesClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/AvailableWorkloadProfilesClientImpl.java @@ -218,9 +218,7 @@ public PagedIterable get(String location, Context /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. @@ -246,9 +244,7 @@ private Mono> getNextSinglePageAsyn /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/BuildAuthTokensClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/BuildAuthTokensClientImpl.java index 416f699371ba..c41f96fc70bf 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/BuildAuthTokensClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/BuildAuthTokensClientImpl.java @@ -51,8 +51,8 @@ public final class BuildAuthTokensClientImpl implements BuildAuthTokensClient { } /** - * The interface defining all the services for ContainerAppsApiClientBuildAuthTokens to be used by the proxy - * service to perform REST calls. + * The interface defining all the services for ContainerAppsApiClientBuildAuthTokens to be used by the proxy service + * to perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "ContainerAppsApiClie") diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/BuildResourceImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/BuildResourceImpl.java index da4354a5db34..f254e9354fc1 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/BuildResourceImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/BuildResourceImpl.java @@ -87,14 +87,16 @@ public BuildResourceImpl withExistingBuilder(String resourceGroupName, String bu } public BuildResource create() { - this.innerObject = serviceManager.serviceClient().getBuilds().createOrUpdate(resourceGroupName, builderName, - buildName, this.innerModel(), Context.NONE); + this.innerObject = serviceManager.serviceClient() + .getBuilds() + .createOrUpdate(resourceGroupName, builderName, buildName, this.innerModel(), Context.NONE); return this; } public BuildResource create(Context context) { - this.innerObject = serviceManager.serviceClient().getBuilds().createOrUpdate(resourceGroupName, builderName, - buildName, this.innerModel(), context); + this.innerObject = serviceManager.serviceClient() + .getBuilds() + .createOrUpdate(resourceGroupName, builderName, buildName, this.innerModel(), context); return this; } @@ -109,14 +111,16 @@ public BuildResourceImpl update() { } public BuildResource apply() { - this.innerObject = serviceManager.serviceClient().getBuilds().createOrUpdate(resourceGroupName, builderName, - buildName, this.innerModel(), Context.NONE); + this.innerObject = serviceManager.serviceClient() + .getBuilds() + .createOrUpdate(resourceGroupName, builderName, buildName, this.innerModel(), Context.NONE); return this; } public BuildResource apply(Context context) { - this.innerObject = serviceManager.serviceClient().getBuilds().createOrUpdate(resourceGroupName, builderName, - buildName, this.innerModel(), context); + this.innerObject = serviceManager.serviceClient() + .getBuilds() + .createOrUpdate(resourceGroupName, builderName, buildName, this.innerModel(), context); return this; } @@ -130,14 +134,18 @@ public BuildResource apply(Context context) { } public BuildResource refresh() { - this.innerObject = serviceManager.serviceClient().getBuilds() - .getWithResponse(resourceGroupName, builderName, buildName, Context.NONE).getValue(); + this.innerObject = serviceManager.serviceClient() + .getBuilds() + .getWithResponse(resourceGroupName, builderName, buildName, Context.NONE) + .getValue(); return this; } public BuildResource refresh(Context context) { - this.innerObject = serviceManager.serviceClient().getBuilds() - .getWithResponse(resourceGroupName, builderName, buildName, context).getValue(); + this.innerObject = serviceManager.serviceClient() + .getBuilds() + .getWithResponse(resourceGroupName, builderName, buildName, context) + .getValue(); return this; } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/BuilderResourceImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/BuilderResourceImpl.java index 9926d63f18bc..14d509009b5e 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/BuilderResourceImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/BuilderResourceImpl.java @@ -104,14 +104,16 @@ public BuilderResourceImpl withExistingResourceGroup(String resourceGroupName) { } public BuilderResource create() { - this.innerObject = serviceManager.serviceClient().getBuilders().createOrUpdate(resourceGroupName, builderName, - this.innerModel(), Context.NONE); + this.innerObject = serviceManager.serviceClient() + .getBuilders() + .createOrUpdate(resourceGroupName, builderName, this.innerModel(), Context.NONE); return this; } public BuilderResource create(Context context) { - this.innerObject = serviceManager.serviceClient().getBuilders().createOrUpdate(resourceGroupName, builderName, - this.innerModel(), context); + this.innerObject = serviceManager.serviceClient() + .getBuilders() + .createOrUpdate(resourceGroupName, builderName, this.innerModel(), context); return this; } @@ -127,14 +129,16 @@ public BuilderResourceImpl update() { } public BuilderResource apply() { - this.innerObject = serviceManager.serviceClient().getBuilders().update(resourceGroupName, builderName, - updateBuilderEnvelope, Context.NONE); + this.innerObject = serviceManager.serviceClient() + .getBuilders() + .update(resourceGroupName, builderName, updateBuilderEnvelope, Context.NONE); return this; } public BuilderResource apply(Context context) { - this.innerObject = serviceManager.serviceClient().getBuilders().update(resourceGroupName, builderName, - updateBuilderEnvelope, context); + this.innerObject = serviceManager.serviceClient() + .getBuilders() + .update(resourceGroupName, builderName, updateBuilderEnvelope, context); return this; } @@ -147,14 +151,18 @@ public BuilderResource apply(Context context) { } public BuilderResource refresh() { - this.innerObject = serviceManager.serviceClient().getBuilders() - .getByResourceGroupWithResponse(resourceGroupName, builderName, Context.NONE).getValue(); + this.innerObject = serviceManager.serviceClient() + .getBuilders() + .getByResourceGroupWithResponse(resourceGroupName, builderName, Context.NONE) + .getValue(); return this; } public BuilderResource refresh(Context context) { - this.innerObject = serviceManager.serviceClient().getBuilders() - .getByResourceGroupWithResponse(resourceGroupName, builderName, context).getValue(); + this.innerObject = serviceManager.serviceClient() + .getBuilders() + .getByResourceGroupWithResponse(resourceGroupName, builderName, context) + .getValue(); return this; } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/BuildersClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/BuildersClientImpl.java index 9387f812cdd8..573cee8d22d9 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/BuildersClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/BuildersClientImpl.java @@ -1171,9 +1171,7 @@ public void delete(String resourceGroupName, String builderName, Context context /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. @@ -1201,9 +1199,7 @@ private Mono> listBySubscriptionNextSinglePa /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. @@ -1231,9 +1227,7 @@ private Mono> listBySubscriptionNextSinglePa /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. @@ -1261,9 +1255,7 @@ private Mono> listByResourceGroupNextSingleP /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/BuildsByBuilderResourcesClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/BuildsByBuilderResourcesClientImpl.java index d1239550cfb1..e5110840118b 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/BuildsByBuilderResourcesClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/BuildsByBuilderResourcesClientImpl.java @@ -222,9 +222,7 @@ public PagedIterable list(String resourceGroupName, String b /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. @@ -250,9 +248,7 @@ private Mono> listNextSinglePageAsync(String n /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/CertificateImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/CertificateImpl.java index 237e1e0d2aa2..7f84f8f2426b 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/CertificateImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/CertificateImpl.java @@ -87,7 +87,8 @@ public CertificateImpl withExistingConnectedEnvironment(String resourceGroupName } public Certificate create() { - this.innerObject = serviceManager.serviceClient().getConnectedEnvironmentsCertificates() + this.innerObject = serviceManager.serviceClient() + .getConnectedEnvironmentsCertificates() .createOrUpdateWithResponse(resourceGroupName, connectedEnvironmentName, certificateName, this.innerModel(), Context.NONE) .getValue(); @@ -95,9 +96,11 @@ public Certificate create() { } public Certificate create(Context context) { - this.innerObject - = serviceManager.serviceClient().getConnectedEnvironmentsCertificates().createOrUpdateWithResponse( - resourceGroupName, connectedEnvironmentName, certificateName, this.innerModel(), context).getValue(); + this.innerObject = serviceManager.serviceClient() + .getConnectedEnvironmentsCertificates() + .createOrUpdateWithResponse(resourceGroupName, connectedEnvironmentName, certificateName, this.innerModel(), + context) + .getValue(); return this; } @@ -113,7 +116,8 @@ public CertificateImpl update() { } public Certificate apply() { - this.innerObject = serviceManager.serviceClient().getConnectedEnvironmentsCertificates() + this.innerObject = serviceManager.serviceClient() + .getConnectedEnvironmentsCertificates() .updateWithResponse(resourceGroupName, connectedEnvironmentName, certificateName, updateCertificateEnvelope, Context.NONE) .getValue(); @@ -121,7 +125,8 @@ public Certificate apply() { } public Certificate apply(Context context) { - this.innerObject = serviceManager.serviceClient().getConnectedEnvironmentsCertificates() + this.innerObject = serviceManager.serviceClient() + .getConnectedEnvironmentsCertificates() .updateWithResponse(resourceGroupName, connectedEnvironmentName, certificateName, updateCertificateEnvelope, context) .getValue(); @@ -139,14 +144,18 @@ public Certificate apply(Context context) { } public Certificate refresh() { - this.innerObject = serviceManager.serviceClient().getConnectedEnvironmentsCertificates() - .getWithResponse(resourceGroupName, connectedEnvironmentName, certificateName, Context.NONE).getValue(); + this.innerObject = serviceManager.serviceClient() + .getConnectedEnvironmentsCertificates() + .getWithResponse(resourceGroupName, connectedEnvironmentName, certificateName, Context.NONE) + .getValue(); return this; } public Certificate refresh(Context context) { - this.innerObject = serviceManager.serviceClient().getConnectedEnvironmentsCertificates() - .getWithResponse(resourceGroupName, connectedEnvironmentName, certificateName, context).getValue(); + this.innerObject = serviceManager.serviceClient() + .getConnectedEnvironmentsCertificates() + .getWithResponse(resourceGroupName, connectedEnvironmentName, certificateName, context) + .getValue(); return this; } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/CertificatesClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/CertificatesClientImpl.java index 3a3b7b71bd48..e73945511e00 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/CertificatesClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/CertificatesClientImpl.java @@ -61,8 +61,8 @@ public final class CertificatesClientImpl implements CertificatesClient { } /** - * The interface defining all the services for ContainerAppsApiClientCertificates to be used by the proxy service - * to perform REST calls. + * The interface defining all the services for ContainerAppsApiClientCertificates to be used by the proxy service to + * perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "ContainerAppsApiClie") @@ -861,9 +861,7 @@ public CertificateInner update(String resourceGroupName, String environmentName, /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -888,9 +886,7 @@ private Mono> listNextSinglePageAsync(String nex /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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 DefaultErrorResponseErrorException thrown if the request is rejected by server. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/CertificatesImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/CertificatesImpl.java index bb48fdd2cdf8..8d014c732e36 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/CertificatesImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/CertificatesImpl.java @@ -61,8 +61,9 @@ public Certificate get(String resourceGroupName, String environmentName, String public Response createOrUpdateWithResponse(String resourceGroupName, String environmentName, String certificateName, CertificateInner certificateEnvelope, Context context) { - Response inner = this.serviceClient().createOrUpdateWithResponse(resourceGroupName, - environmentName, certificateName, certificateEnvelope, context); + Response inner = this.serviceClient() + .createOrUpdateWithResponse(resourceGroupName, environmentName, certificateName, certificateEnvelope, + context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new CertificateImpl(inner.getValue(), this.manager())); @@ -92,8 +93,8 @@ public void delete(String resourceGroupName, String environmentName, String cert public Response updateWithResponse(String resourceGroupName, String environmentName, String certificateName, CertificatePatch certificateEnvelope, Context context) { - Response inner = this.serviceClient().updateWithResponse(resourceGroupName, environmentName, - certificateName, certificateEnvelope, context); + Response inner = this.serviceClient() + .updateWithResponse(resourceGroupName, environmentName, certificateName, certificateEnvelope, context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new CertificateImpl(inner.getValue(), this.manager())); diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentImpl.java index a733c450c07e..47db3449f3da 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentImpl.java @@ -111,14 +111,16 @@ public ConnectedEnvironmentImpl withExistingResourceGroup(String resourceGroupNa } public ConnectedEnvironment create() { - this.innerObject = serviceManager.serviceClient().getConnectedEnvironments().createOrUpdate(resourceGroupName, - connectedEnvironmentName, this.innerModel(), Context.NONE); + this.innerObject = serviceManager.serviceClient() + .getConnectedEnvironments() + .createOrUpdate(resourceGroupName, connectedEnvironmentName, this.innerModel(), Context.NONE); return this; } public ConnectedEnvironment create(Context context) { - this.innerObject = serviceManager.serviceClient().getConnectedEnvironments().createOrUpdate(resourceGroupName, - connectedEnvironmentName, this.innerModel(), context); + this.innerObject = serviceManager.serviceClient() + .getConnectedEnvironments() + .createOrUpdate(resourceGroupName, connectedEnvironmentName, this.innerModel(), context); return this; } @@ -134,14 +136,16 @@ public ConnectedEnvironmentImpl update() { } public ConnectedEnvironment apply() { - this.innerObject = serviceManager.serviceClient().getConnectedEnvironments().createOrUpdate(resourceGroupName, - connectedEnvironmentName, this.innerModel(), Context.NONE); + this.innerObject = serviceManager.serviceClient() + .getConnectedEnvironments() + .createOrUpdate(resourceGroupName, connectedEnvironmentName, this.innerModel(), Context.NONE); return this; } public ConnectedEnvironment apply(Context context) { - this.innerObject = serviceManager.serviceClient().getConnectedEnvironments().createOrUpdate(resourceGroupName, - connectedEnvironmentName, this.innerModel(), context); + this.innerObject = serviceManager.serviceClient() + .getConnectedEnvironments() + .createOrUpdate(resourceGroupName, connectedEnvironmentName, this.innerModel(), context); return this; } @@ -155,27 +159,32 @@ public ConnectedEnvironment apply(Context context) { } public ConnectedEnvironment refresh() { - this.innerObject = serviceManager.serviceClient().getConnectedEnvironments() - .getByResourceGroupWithResponse(resourceGroupName, connectedEnvironmentName, Context.NONE).getValue(); + this.innerObject = serviceManager.serviceClient() + .getConnectedEnvironments() + .getByResourceGroupWithResponse(resourceGroupName, connectedEnvironmentName, Context.NONE) + .getValue(); return this; } public ConnectedEnvironment refresh(Context context) { - this.innerObject = serviceManager.serviceClient().getConnectedEnvironments() - .getByResourceGroupWithResponse(resourceGroupName, connectedEnvironmentName, context).getValue(); + this.innerObject = serviceManager.serviceClient() + .getConnectedEnvironments() + .getByResourceGroupWithResponse(resourceGroupName, connectedEnvironmentName, context) + .getValue(); return this; } public Response checkNameAvailabilityWithResponse(CheckNameAvailabilityRequest checkNameAvailabilityRequest, Context context) { - return serviceManager.connectedEnvironments().checkNameAvailabilityWithResponse(resourceGroupName, - connectedEnvironmentName, checkNameAvailabilityRequest, context); + return serviceManager.connectedEnvironments() + .checkNameAvailabilityWithResponse(resourceGroupName, connectedEnvironmentName, + checkNameAvailabilityRequest, context); } public CheckNameAvailabilityResponse checkNameAvailability(CheckNameAvailabilityRequest checkNameAvailabilityRequest) { - return serviceManager.connectedEnvironments().checkNameAvailability(resourceGroupName, connectedEnvironmentName, - checkNameAvailabilityRequest); + return serviceManager.connectedEnvironments() + .checkNameAvailability(resourceGroupName, connectedEnvironmentName, checkNameAvailabilityRequest); } public ConnectedEnvironmentImpl withRegion(Region location) { diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentStorageImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentStorageImpl.java index 1dfa1dde464c..9b485850e274 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentStorageImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentStorageImpl.java @@ -62,14 +62,20 @@ public ConnectedEnvironmentStorageImpl withExistingConnectedEnvironment(String r } public ConnectedEnvironmentStorage create() { - this.innerObject = serviceManager.serviceClient().getConnectedEnvironmentsStorages().createOrUpdateWithResponse( - resourceGroupName, connectedEnvironmentName, storageName, this.innerModel(), Context.NONE).getValue(); + this.innerObject = serviceManager.serviceClient() + .getConnectedEnvironmentsStorages() + .createOrUpdateWithResponse(resourceGroupName, connectedEnvironmentName, storageName, this.innerModel(), + Context.NONE) + .getValue(); return this; } public ConnectedEnvironmentStorage create(Context context) { - this.innerObject = serviceManager.serviceClient().getConnectedEnvironmentsStorages().createOrUpdateWithResponse( - resourceGroupName, connectedEnvironmentName, storageName, this.innerModel(), context).getValue(); + this.innerObject = serviceManager.serviceClient() + .getConnectedEnvironmentsStorages() + .createOrUpdateWithResponse(resourceGroupName, connectedEnvironmentName, storageName, this.innerModel(), + context) + .getValue(); return this; } @@ -85,14 +91,20 @@ public ConnectedEnvironmentStorageImpl update() { } public ConnectedEnvironmentStorage apply() { - this.innerObject = serviceManager.serviceClient().getConnectedEnvironmentsStorages().createOrUpdateWithResponse( - resourceGroupName, connectedEnvironmentName, storageName, this.innerModel(), Context.NONE).getValue(); + this.innerObject = serviceManager.serviceClient() + .getConnectedEnvironmentsStorages() + .createOrUpdateWithResponse(resourceGroupName, connectedEnvironmentName, storageName, this.innerModel(), + Context.NONE) + .getValue(); return this; } public ConnectedEnvironmentStorage apply(Context context) { - this.innerObject = serviceManager.serviceClient().getConnectedEnvironmentsStorages().createOrUpdateWithResponse( - resourceGroupName, connectedEnvironmentName, storageName, this.innerModel(), context).getValue(); + this.innerObject = serviceManager.serviceClient() + .getConnectedEnvironmentsStorages() + .createOrUpdateWithResponse(resourceGroupName, connectedEnvironmentName, storageName, this.innerModel(), + context) + .getValue(); return this; } @@ -107,14 +119,18 @@ public ConnectedEnvironmentStorage apply(Context context) { } public ConnectedEnvironmentStorage refresh() { - this.innerObject = serviceManager.serviceClient().getConnectedEnvironmentsStorages() - .getWithResponse(resourceGroupName, connectedEnvironmentName, storageName, Context.NONE).getValue(); + this.innerObject = serviceManager.serviceClient() + .getConnectedEnvironmentsStorages() + .getWithResponse(resourceGroupName, connectedEnvironmentName, storageName, Context.NONE) + .getValue(); return this; } public ConnectedEnvironmentStorage refresh(Context context) { - this.innerObject = serviceManager.serviceClient().getConnectedEnvironmentsStorages() - .getWithResponse(resourceGroupName, connectedEnvironmentName, storageName, context).getValue(); + this.innerObject = serviceManager.serviceClient() + .getConnectedEnvironmentsStorages() + .getWithResponse(resourceGroupName, connectedEnvironmentName, storageName, context) + .getValue(); return this; } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentStoragesCollectionImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentStoragesCollectionImpl.java index 98958a7e2466..c5aaf65dce2f 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentStoragesCollectionImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentStoragesCollectionImpl.java @@ -26,9 +26,9 @@ public final class ConnectedEnvironmentStoragesCollectionImpl implements Connect public List value() { List inner = this.innerModel().value(); if (inner != null) { - return Collections.unmodifiableList( - inner.stream().map(inner1 -> new ConnectedEnvironmentStorageImpl(inner1, this.manager())) - .collect(Collectors.toList())); + return Collections.unmodifiableList(inner.stream() + .map(inner1 -> new ConnectedEnvironmentStorageImpl(inner1, this.manager())) + .collect(Collectors.toList())); } else { return Collections.emptyList(); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsCertificatesClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsCertificatesClientImpl.java index be1c333d2d80..9e35fe01415c 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsCertificatesClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsCertificatesClientImpl.java @@ -61,8 +61,8 @@ public final class ConnectedEnvironmentsCertificatesClientImpl implements Connec } /** - * The interface defining all the services for ContainerAppsApiClientConnectedEnvironmentsCertificates to be used - * by the proxy service to perform REST calls. + * The interface defining all the services for ContainerAppsApiClientConnectedEnvironmentsCertificates to be used by + * the proxy service to perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "ContainerAppsApiClie") @@ -874,9 +874,7 @@ public CertificateInner update(String resourceGroupName, String connectedEnviron /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -901,9 +899,7 @@ private Mono> listNextSinglePageAsync(String nex /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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 DefaultErrorResponseErrorException thrown if the request is rejected by server. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsCertificatesImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsCertificatesImpl.java index 599b752b8e5b..bbe34b1865dd 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsCertificatesImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsCertificatesImpl.java @@ -40,8 +40,8 @@ public PagedIterable list(String resourceGroupName, String connecte public Response getWithResponse(String resourceGroupName, String connectedEnvironmentName, String certificateName, Context context) { - Response inner = this.serviceClient().getWithResponse(resourceGroupName, - connectedEnvironmentName, certificateName, context); + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, connectedEnvironmentName, certificateName, context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new CertificateImpl(inner.getValue(), this.manager())); @@ -61,8 +61,8 @@ public Certificate get(String resourceGroupName, String connectedEnvironmentName public Response deleteWithResponse(String resourceGroupName, String connectedEnvironmentName, String certificateName, Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, connectedEnvironmentName, certificateName, - context); + return this.serviceClient() + .deleteWithResponse(resourceGroupName, connectedEnvironmentName, certificateName, context); } public void delete(String resourceGroupName, String connectedEnvironmentName, String certificateName) { diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsClientImpl.java index ab3ab2053e3f..f3bb3db660a0 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsClientImpl.java @@ -736,7 +736,8 @@ private Mono createOrUpdateAsync(String resourceGroup private Mono createOrUpdateAsync(String resourceGroupName, String connectedEnvironmentName, ConnectedEnvironmentInner environmentEnvelope, Context context) { return beginCreateOrUpdateAsync(resourceGroupName, connectedEnvironmentName, environmentEnvelope, context) - .last().flatMap(this.client::getLroFinalResultOrError); + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1271,9 +1272,7 @@ public CheckNameAvailabilityResponseInner checkNameAvailability(String resourceG /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1301,9 +1300,7 @@ private Mono> listBySubscriptionNextSin /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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 DefaultErrorResponseErrorException thrown if the request is rejected by server. @@ -1331,9 +1328,7 @@ private Mono> listBySubscriptionNextSin /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1361,9 +1356,7 @@ private Mono> listByResourceGroupNextSi /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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 DefaultErrorResponseErrorException thrown if the request is rejected by server. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsDaprComponentsClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsDaprComponentsClientImpl.java index bc4defccdabf..72cf1b79d747 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsDaprComponentsClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsDaprComponentsClientImpl.java @@ -36,8 +36,7 @@ import reactor.core.publisher.Mono; /** - * An instance of this class provides access to all the operations defined in - * ConnectedEnvironmentsDaprComponentsClient. + * An instance of this class provides access to all the operations defined in ConnectedEnvironmentsDaprComponentsClient. */ public final class ConnectedEnvironmentsDaprComponentsClientImpl implements ConnectedEnvironmentsDaprComponentsClient { /** @@ -858,9 +857,7 @@ public DaprSecretsCollectionInner listSecrets(String resourceGroupName, String c /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -885,9 +882,7 @@ private Mono> listNextSinglePageAsync(String n /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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 DefaultErrorResponseErrorException thrown if the request is rejected by server. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsDaprComponentsImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsDaprComponentsImpl.java index eacdeaebf3bb..81cb2b05c3e1 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsDaprComponentsImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsDaprComponentsImpl.java @@ -65,8 +65,8 @@ public DaprComponent get(String resourceGroupName, String connectedEnvironmentNa public Response deleteWithResponse(String resourceGroupName, String connectedEnvironmentName, String componentName, Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, connectedEnvironmentName, componentName, - context); + return this.serviceClient() + .deleteWithResponse(resourceGroupName, connectedEnvironmentName, componentName, context); } public void delete(String resourceGroupName, String connectedEnvironmentName, String componentName) { @@ -75,8 +75,8 @@ public void delete(String resourceGroupName, String connectedEnvironmentName, St public Response listSecretsWithResponse(String resourceGroupName, String connectedEnvironmentName, String componentName, Context context) { - Response inner = this.serviceClient().listSecretsWithResponse(resourceGroupName, - connectedEnvironmentName, componentName, context); + Response inner = this.serviceClient() + .listSecretsWithResponse(resourceGroupName, connectedEnvironmentName, componentName, context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new DaprSecretsCollectionImpl(inner.getValue(), this.manager())); diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsImpl.java index 2919f62d27be..65670a635404 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsImpl.java @@ -104,8 +104,9 @@ public ConnectedEnvironment update(String resourceGroupName, String connectedEnv public Response checkNameAvailabilityWithResponse(String resourceGroupName, String connectedEnvironmentName, CheckNameAvailabilityRequest checkNameAvailabilityRequest, Context context) { - Response inner = this.serviceClient().checkNameAvailabilityWithResponse( - resourceGroupName, connectedEnvironmentName, checkNameAvailabilityRequest, context); + Response inner = this.serviceClient() + .checkNameAvailabilityWithResponse(resourceGroupName, connectedEnvironmentName, + checkNameAvailabilityRequest, context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new CheckNameAvailabilityResponseImpl(inner.getValue(), this.manager())); @@ -116,8 +117,8 @@ public Response checkNameAvailabilityWithResponse public CheckNameAvailabilityResponse checkNameAvailability(String resourceGroupName, String connectedEnvironmentName, CheckNameAvailabilityRequest checkNameAvailabilityRequest) { - CheckNameAvailabilityResponseInner inner = this.serviceClient().checkNameAvailability(resourceGroupName, - connectedEnvironmentName, checkNameAvailabilityRequest); + CheckNameAvailabilityResponseInner inner = this.serviceClient() + .checkNameAvailability(resourceGroupName, connectedEnvironmentName, checkNameAvailabilityRequest); if (inner != null) { return new CheckNameAvailabilityResponseImpl(inner, this.manager()); } else { diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsStoragesClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsStoragesClientImpl.java index c44b673d9562..313d8933511a 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsStoragesClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsStoragesClientImpl.java @@ -55,8 +55,8 @@ public final class ConnectedEnvironmentsStoragesClientImpl implements ConnectedE } /** - * The interface defining all the services for ContainerAppsApiClientConnectedEnvironmentsStorages to be used by - * the proxy service to perform REST calls. + * The interface defining all the services for ContainerAppsApiClientConnectedEnvironmentsStorages to be used by the + * proxy service to perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "ContainerAppsApiClie") diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsStoragesImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsStoragesImpl.java index 3c5f66271c3b..06e1afd1673a 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsStoragesImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsStoragesImpl.java @@ -11,9 +11,9 @@ import com.azure.resourcemanager.appcontainers.fluent.ConnectedEnvironmentsStoragesClient; import com.azure.resourcemanager.appcontainers.fluent.models.ConnectedEnvironmentStorageInner; import com.azure.resourcemanager.appcontainers.fluent.models.ConnectedEnvironmentStoragesCollectionInner; +import com.azure.resourcemanager.appcontainers.models.ConnectedEnvironmentsStorages; import com.azure.resourcemanager.appcontainers.models.ConnectedEnvironmentStorage; import com.azure.resourcemanager.appcontainers.models.ConnectedEnvironmentStoragesCollection; -import com.azure.resourcemanager.appcontainers.models.ConnectedEnvironmentsStorages; public final class ConnectedEnvironmentsStoragesImpl implements ConnectedEnvironmentsStorages { private static final ClientLogger LOGGER = new ClientLogger(ConnectedEnvironmentsStoragesImpl.class); @@ -75,8 +75,8 @@ public ConnectedEnvironmentStorage get(String resourceGroupName, String connecte public Response deleteWithResponse(String resourceGroupName, String connectedEnvironmentName, String storageName, Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, connectedEnvironmentName, storageName, - context); + return this.serviceClient() + .deleteWithResponse(resourceGroupName, connectedEnvironmentName, storageName, context); } public void delete(String resourceGroupName, String connectedEnvironmentName, String storageName) { diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppImpl.java index 1325dc07837e..b3f91ceb38da 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppImpl.java @@ -12,9 +12,11 @@ import com.azure.resourcemanager.appcontainers.models.Configuration; import com.azure.resourcemanager.appcontainers.models.ContainerApp; import com.azure.resourcemanager.appcontainers.models.ContainerAppAuthToken; +import com.azure.resourcemanager.appcontainers.models.ContainerAppPropertiesPatchingConfiguration; import com.azure.resourcemanager.appcontainers.models.ContainerAppProvisioningState; import com.azure.resourcemanager.appcontainers.models.CustomHostnameAnalysisResult; import com.azure.resourcemanager.appcontainers.models.ExtendedLocation; +import com.azure.resourcemanager.appcontainers.models.Kind; import com.azure.resourcemanager.appcontainers.models.ManagedServiceIdentity; import com.azure.resourcemanager.appcontainers.models.SecretsCollection; import com.azure.resourcemanager.appcontainers.models.Template; @@ -64,6 +66,10 @@ public String managedBy() { return this.innerModel().managedBy(); } + public Kind kind() { + return this.innerModel().kind(); + } + public SystemData systemData() { return this.innerModel().systemData(); } @@ -84,6 +90,10 @@ public String workloadProfileName() { return this.innerModel().workloadProfileName(); } + public ContainerAppPropertiesPatchingConfiguration patchingConfiguration() { + return this.innerModel().patchingConfiguration(); + } + public String latestRevisionName() { return this.innerModel().latestRevisionName(); } @@ -151,14 +161,16 @@ public ContainerAppImpl withExistingResourceGroup(String resourceGroupName) { } public ContainerApp create() { - this.innerObject = serviceManager.serviceClient().getContainerApps().createOrUpdate(resourceGroupName, - containerAppName, this.innerModel(), Context.NONE); + this.innerObject = serviceManager.serviceClient() + .getContainerApps() + .createOrUpdate(resourceGroupName, containerAppName, this.innerModel(), Context.NONE); return this; } public ContainerApp create(Context context) { - this.innerObject = serviceManager.serviceClient().getContainerApps().createOrUpdate(resourceGroupName, - containerAppName, this.innerModel(), context); + this.innerObject = serviceManager.serviceClient() + .getContainerApps() + .createOrUpdate(resourceGroupName, containerAppName, this.innerModel(), context); return this; } @@ -173,14 +185,16 @@ public ContainerAppImpl update() { } public ContainerApp apply() { - this.innerObject = serviceManager.serviceClient().getContainerApps().update(resourceGroupName, containerAppName, - this.innerModel(), Context.NONE); + this.innerObject = serviceManager.serviceClient() + .getContainerApps() + .update(resourceGroupName, containerAppName, this.innerModel(), Context.NONE); return this; } public ContainerApp apply(Context context) { - this.innerObject = serviceManager.serviceClient().getContainerApps().update(resourceGroupName, containerAppName, - this.innerModel(), context); + this.innerObject = serviceManager.serviceClient() + .getContainerApps() + .update(resourceGroupName, containerAppName, this.innerModel(), context); return this; } @@ -193,21 +207,25 @@ public ContainerApp apply(Context context) { } public ContainerApp refresh() { - this.innerObject = serviceManager.serviceClient().getContainerApps() - .getByResourceGroupWithResponse(resourceGroupName, containerAppName, Context.NONE).getValue(); + this.innerObject = serviceManager.serviceClient() + .getContainerApps() + .getByResourceGroupWithResponse(resourceGroupName, containerAppName, Context.NONE) + .getValue(); return this; } public ContainerApp refresh(Context context) { - this.innerObject = serviceManager.serviceClient().getContainerApps() - .getByResourceGroupWithResponse(resourceGroupName, containerAppName, context).getValue(); + this.innerObject = serviceManager.serviceClient() + .getContainerApps() + .getByResourceGroupWithResponse(resourceGroupName, containerAppName, context) + .getValue(); return this; } public Response listCustomHostnameAnalysisWithResponse(String customHostname, Context context) { - return serviceManager.containerApps().listCustomHostnameAnalysisWithResponse(resourceGroupName, - containerAppName, customHostname, context); + return serviceManager.containerApps() + .listCustomHostnameAnalysisWithResponse(resourceGroupName, containerAppName, customHostname, context); } public CustomHostnameAnalysisResult listCustomHostnameAnalysis() { @@ -276,6 +294,11 @@ public ContainerAppImpl withManagedBy(String managedBy) { return this; } + public ContainerAppImpl withKind(Kind kind) { + this.innerModel().withKind(kind); + return this; + } + public ContainerAppImpl withManagedEnvironmentId(String managedEnvironmentId) { this.innerModel().withManagedEnvironmentId(managedEnvironmentId); return this; @@ -291,6 +314,12 @@ public ContainerAppImpl withWorkloadProfileName(String workloadProfileName) { return this; } + public ContainerAppImpl + withPatchingConfiguration(ContainerAppPropertiesPatchingConfiguration patchingConfiguration) { + this.innerModel().withPatchingConfiguration(patchingConfiguration); + return this; + } + public ContainerAppImpl withConfiguration(Configuration configuration) { this.innerModel().withConfiguration(configuration); return this; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppJobExecutionsImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppJobExecutionsImpl.java index 6f7c1e0d91d3..6dfa8160d1f7 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppJobExecutionsImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppJobExecutionsImpl.java @@ -27,7 +27,8 @@ public List value() { List inner = this.innerModel().value(); if (inner != null) { return Collections.unmodifiableList(inner.stream() - .map(inner1 -> new JobExecutionImpl(inner1, this.manager())).collect(Collectors.toList())); + .map(inner1 -> new JobExecutionImpl(inner1, this.manager())) + .collect(Collectors.toList())); } else { return Collections.emptyList(); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsApiClientBuilder.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsApiClientBuilder.java index 49c7d2ab750a..d2fa8d7fd0f7 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsApiClientBuilder.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsApiClientBuilder.java @@ -123,11 +123,13 @@ public ContainerAppsApiClientBuilder serializerAdapter(SerializerAdapter seriali public ContainerAppsApiClientImpl buildClient() { String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; - HttpPipeline localPipeline = (pipeline != null) ? pipeline + 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 + SerializerAdapter localSerializerAdapter = (serializerAdapter != null) + ? serializerAdapter : SerializerFactory.createDefaultManagementSerializerAdapter(); ContainerAppsApiClientImpl client = new ContainerAppsApiClientImpl(localPipeline, localSerializerAdapter, localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint); diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsApiClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsApiClientImpl.java index 1253a9deec72..09387f7de2eb 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsApiClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsApiClientImpl.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.appcontainers.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; @@ -12,8 +13,8 @@ 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.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; @@ -36,24 +37,32 @@ import com.azure.resourcemanager.appcontainers.fluent.ConnectedEnvironmentsStoragesClient; import com.azure.resourcemanager.appcontainers.fluent.ContainerAppsApiClient; import com.azure.resourcemanager.appcontainers.fluent.ContainerAppsAuthConfigsClient; +import com.azure.resourcemanager.appcontainers.fluent.ContainerAppsBuildsByContainerAppsClient; +import com.azure.resourcemanager.appcontainers.fluent.ContainerAppsBuildsClient; import com.azure.resourcemanager.appcontainers.fluent.ContainerAppsClient; import com.azure.resourcemanager.appcontainers.fluent.ContainerAppsDiagnosticsClient; +import com.azure.resourcemanager.appcontainers.fluent.ContainerAppsPatchesClient; import com.azure.resourcemanager.appcontainers.fluent.ContainerAppsRevisionReplicasClient; import com.azure.resourcemanager.appcontainers.fluent.ContainerAppsRevisionsClient; +import com.azure.resourcemanager.appcontainers.fluent.ContainerAppsSessionPoolsClient; import com.azure.resourcemanager.appcontainers.fluent.ContainerAppsSourceControlsClient; import com.azure.resourcemanager.appcontainers.fluent.DaprComponentResiliencyPoliciesClient; import com.azure.resourcemanager.appcontainers.fluent.DaprComponentsClient; import com.azure.resourcemanager.appcontainers.fluent.DaprSubscriptionsClient; import com.azure.resourcemanager.appcontainers.fluent.DotNetComponentsClient; +import com.azure.resourcemanager.appcontainers.fluent.FunctionsExtensionsClient; import com.azure.resourcemanager.appcontainers.fluent.JavaComponentsClient; import com.azure.resourcemanager.appcontainers.fluent.JobsClient; import com.azure.resourcemanager.appcontainers.fluent.JobsExecutionsClient; +import com.azure.resourcemanager.appcontainers.fluent.LogicAppsClient; import com.azure.resourcemanager.appcontainers.fluent.ManagedCertificatesClient; import com.azure.resourcemanager.appcontainers.fluent.ManagedEnvironmentDiagnosticsClient; -import com.azure.resourcemanager.appcontainers.fluent.ManagedEnvironmentUsagesClient; +import com.azure.resourcemanager.appcontainers.fluent.ManagedEnvironmentPrivateEndpointConnectionsClient; +import com.azure.resourcemanager.appcontainers.fluent.ManagedEnvironmentPrivateLinkResourcesClient; import com.azure.resourcemanager.appcontainers.fluent.ManagedEnvironmentsClient; import com.azure.resourcemanager.appcontainers.fluent.ManagedEnvironmentsDiagnosticsClient; import com.azure.resourcemanager.appcontainers.fluent.ManagedEnvironmentsStoragesClient; +import com.azure.resourcemanager.appcontainers.fluent.ManagedEnvironmentUsagesClient; import com.azure.resourcemanager.appcontainers.fluent.NamespacesClient; import com.azure.resourcemanager.appcontainers.fluent.OperationsClient; import com.azure.resourcemanager.appcontainers.fluent.ResourceProvidersClient; @@ -366,6 +375,48 @@ public ContainerAppsRevisionReplicasClient getContainerAppsRevisionReplicas() { return this.containerAppsRevisionReplicas; } + /** + * The ContainerAppsBuildsByContainerAppsClient object to access its operations. + */ + private final ContainerAppsBuildsByContainerAppsClient containerAppsBuildsByContainerApps; + + /** + * Gets the ContainerAppsBuildsByContainerAppsClient object to access its operations. + * + * @return the ContainerAppsBuildsByContainerAppsClient object. + */ + public ContainerAppsBuildsByContainerAppsClient getContainerAppsBuildsByContainerApps() { + return this.containerAppsBuildsByContainerApps; + } + + /** + * The ContainerAppsBuildsClient object to access its operations. + */ + private final ContainerAppsBuildsClient containerAppsBuilds; + + /** + * Gets the ContainerAppsBuildsClient object to access its operations. + * + * @return the ContainerAppsBuildsClient object. + */ + public ContainerAppsBuildsClient getContainerAppsBuilds() { + return this.containerAppsBuilds; + } + + /** + * The ContainerAppsPatchesClient object to access its operations. + */ + private final ContainerAppsPatchesClient containerAppsPatches; + + /** + * Gets the ContainerAppsPatchesClient object to access its operations. + * + * @return the ContainerAppsPatchesClient object. + */ + public ContainerAppsPatchesClient getContainerAppsPatches() { + return this.containerAppsPatches; + } + /** * The ContainerAppsDiagnosticsClient object to access its operations. */ @@ -422,6 +473,20 @@ public JobsClient getJobs() { return this.jobs; } + /** + * The DotNetComponentsClient object to access its operations. + */ + private final DotNetComponentsClient dotNetComponents; + + /** + * Gets the DotNetComponentsClient object to access its operations. + * + * @return the DotNetComponentsClient object. + */ + public DotNetComponentsClient getDotNetComponents() { + return this.dotNetComponents; + } + /** * The OperationsClient object to access its operations. */ @@ -436,6 +501,20 @@ public OperationsClient getOperations() { return this.operations; } + /** + * The JavaComponentsClient object to access its operations. + */ + private final JavaComponentsClient javaComponents; + + /** + * Gets the JavaComponentsClient object to access its operations. + * + * @return the JavaComponentsClient object. + */ + public JavaComponentsClient getJavaComponents() { + return this.javaComponents; + } + /** * The JobsExecutionsClient object to access its operations. */ @@ -520,6 +599,34 @@ public NamespacesClient getNamespaces() { return this.namespaces; } + /** + * The ManagedEnvironmentPrivateEndpointConnectionsClient object to access its operations. + */ + private final ManagedEnvironmentPrivateEndpointConnectionsClient managedEnvironmentPrivateEndpointConnections; + + /** + * Gets the ManagedEnvironmentPrivateEndpointConnectionsClient object to access its operations. + * + * @return the ManagedEnvironmentPrivateEndpointConnectionsClient object. + */ + public ManagedEnvironmentPrivateEndpointConnectionsClient getManagedEnvironmentPrivateEndpointConnections() { + return this.managedEnvironmentPrivateEndpointConnections; + } + + /** + * The ManagedEnvironmentPrivateLinkResourcesClient object to access its operations. + */ + private final ManagedEnvironmentPrivateLinkResourcesClient managedEnvironmentPrivateLinkResources; + + /** + * Gets the ManagedEnvironmentPrivateLinkResourcesClient object to access its operations. + * + * @return the ManagedEnvironmentPrivateLinkResourcesClient object. + */ + public ManagedEnvironmentPrivateLinkResourcesClient getManagedEnvironmentPrivateLinkResources() { + return this.managedEnvironmentPrivateLinkResources; + } + /** * The DaprComponentResiliencyPoliciesClient object to access its operations. */ @@ -619,31 +726,45 @@ public ManagedEnvironmentUsagesClient getManagedEnvironmentUsages() { } /** - * The JavaComponentsClient object to access its operations. + * The FunctionsExtensionsClient object to access its operations. */ - private final JavaComponentsClient javaComponents; + private final FunctionsExtensionsClient functionsExtensions; /** - * Gets the JavaComponentsClient object to access its operations. + * Gets the FunctionsExtensionsClient object to access its operations. * - * @return the JavaComponentsClient object. + * @return the FunctionsExtensionsClient object. */ - public JavaComponentsClient getJavaComponents() { - return this.javaComponents; + public FunctionsExtensionsClient getFunctionsExtensions() { + return this.functionsExtensions; } /** - * The DotNetComponentsClient object to access its operations. + * The LogicAppsClient object to access its operations. */ - private final DotNetComponentsClient dotNetComponents; + private final LogicAppsClient logicApps; /** - * Gets the DotNetComponentsClient object to access its operations. + * Gets the LogicAppsClient object to access its operations. * - * @return the DotNetComponentsClient object. + * @return the LogicAppsClient object. */ - public DotNetComponentsClient getDotNetComponents() { - return this.dotNetComponents; + public LogicAppsClient getLogicApps() { + return this.logicApps; + } + + /** + * The ContainerAppsSessionPoolsClient object to access its operations. + */ + private final ContainerAppsSessionPoolsClient containerAppsSessionPools; + + /** + * Gets the ContainerAppsSessionPoolsClient object to access its operations. + * + * @return the ContainerAppsSessionPoolsClient object. + */ + public ContainerAppsSessionPoolsClient getContainerAppsSessionPools() { + return this.containerAppsSessionPools; } /** @@ -663,7 +784,7 @@ public DotNetComponentsClient getDotNetComponents() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2023-11-02-preview"; + this.apiVersion = "2024-02-02-preview"; this.appResiliencies = new AppResilienciesClientImpl(this); this.containerAppsAuthConfigs = new ContainerAppsAuthConfigsClientImpl(this); this.availableWorkloadProfiles = new AvailableWorkloadProfilesClientImpl(this); @@ -679,17 +800,25 @@ public DotNetComponentsClient getDotNetComponents() { this.containerApps = new ContainerAppsClientImpl(this); this.containerAppsRevisions = new ContainerAppsRevisionsClientImpl(this); this.containerAppsRevisionReplicas = new ContainerAppsRevisionReplicasClientImpl(this); + this.containerAppsBuildsByContainerApps = new ContainerAppsBuildsByContainerAppsClientImpl(this); + this.containerAppsBuilds = new ContainerAppsBuildsClientImpl(this); + this.containerAppsPatches = new ContainerAppsPatchesClientImpl(this); this.containerAppsDiagnostics = new ContainerAppsDiagnosticsClientImpl(this); this.managedEnvironmentDiagnostics = new ManagedEnvironmentDiagnosticsClientImpl(this); this.managedEnvironmentsDiagnostics = new ManagedEnvironmentsDiagnosticsClientImpl(this); this.jobs = new JobsClientImpl(this); + this.dotNetComponents = new DotNetComponentsClientImpl(this); this.operations = new OperationsClientImpl(this); + this.javaComponents = new JavaComponentsClientImpl(this); this.jobsExecutions = new JobsExecutionsClientImpl(this); this.resourceProviders = new ResourceProvidersClientImpl(this); this.managedEnvironments = new ManagedEnvironmentsClientImpl(this); this.certificates = new CertificatesClientImpl(this); this.managedCertificates = new ManagedCertificatesClientImpl(this); this.namespaces = new NamespacesClientImpl(this); + this.managedEnvironmentPrivateEndpointConnections + = new ManagedEnvironmentPrivateEndpointConnectionsClientImpl(this); + this.managedEnvironmentPrivateLinkResources = new ManagedEnvironmentPrivateLinkResourcesClientImpl(this); this.daprComponentResiliencyPolicies = new DaprComponentResiliencyPoliciesClientImpl(this); this.daprComponents = new DaprComponentsClientImpl(this); this.daprSubscriptions = new DaprSubscriptionsClientImpl(this); @@ -697,8 +826,9 @@ public DotNetComponentsClient getDotNetComponents() { this.containerAppsSourceControls = new ContainerAppsSourceControlsClientImpl(this); this.usages = new UsagesClientImpl(this); this.managedEnvironmentUsages = new ManagedEnvironmentUsagesClientImpl(this); - this.javaComponents = new JavaComponentsClientImpl(this); - this.dotNetComponents = new DotNetComponentsClientImpl(this); + this.functionsExtensions = new FunctionsExtensionsClientImpl(this); + this.logicApps = new LogicAppsClientImpl(this); + this.containerAppsSessionPools = new ContainerAppsSessionPoolsClientImpl(this); } /** @@ -761,8 +891,8 @@ public Mono getLroFinalResultOrError(AsyncPollResponse, if (errorBody != null) { // try to deserialize error body to ManagementError try { - managementError = this.getSerializerAdapter().deserialize(errorBody, ManagementError.class, - SerializerEncoding.JSON); + managementError = this.getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); if (managementError.getCode() == null || managementError.getMessage() == null) { managementError = null; } @@ -803,7 +933,7 @@ public int getStatusCode() { } public String getHeaderValue(String s) { - return httpHeaders.getValue(s); + return httpHeaders.getValue(HttpHeaderName.fromString(s)); } public HttpHeaders getHeaders() { diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsAuthConfigsClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsAuthConfigsClientImpl.java index 83d04f142fbf..ab550bace5e0 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsAuthConfigsClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsAuthConfigsClientImpl.java @@ -683,9 +683,7 @@ public void delete(String resourceGroupName, String containerAppName, String aut /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -713,9 +711,7 @@ private Mono> listByContainerAppNextSinglePageAsy /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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 DefaultErrorResponseErrorException thrown if the request is rejected by server. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsBuildResourceImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsBuildResourceImpl.java new file mode 100644 index 000000000000..0140fcd8e536 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsBuildResourceImpl.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.appcontainers.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appcontainers.fluent.models.ContainerAppsBuildResourceInner; +import com.azure.resourcemanager.appcontainers.models.BuildProvisioningState; +import com.azure.resourcemanager.appcontainers.models.BuildStatus; +import com.azure.resourcemanager.appcontainers.models.ContainerAppsBuildConfiguration; +import com.azure.resourcemanager.appcontainers.models.ContainerAppsBuildResource; +import com.azure.resourcemanager.appcontainers.models.ContainerRegistryWithCustomImage; + +public final class ContainerAppsBuildResourceImpl implements ContainerAppsBuildResource { + private ContainerAppsBuildResourceInner innerObject; + + private final com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager; + + ContainerAppsBuildResourceImpl(ContainerAppsBuildResourceInner innerObject, + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager 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 SystemData systemData() { + return this.innerModel().systemData(); + } + + public BuildProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public BuildStatus buildStatus() { + return this.innerModel().buildStatus(); + } + + public ContainerRegistryWithCustomImage destinationContainerRegistry() { + return this.innerModel().destinationContainerRegistry(); + } + + public ContainerAppsBuildConfiguration configuration() { + return this.innerModel().configuration(); + } + + public String logStreamEndpoint() { + return this.innerModel().logStreamEndpoint(); + } + + public ContainerAppsBuildResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsBuildsByContainerAppsClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsBuildsByContainerAppsClientImpl.java new file mode 100644 index 000000000000..cbdc525440ca --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsBuildsByContainerAppsClientImpl.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.appcontainers.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.appcontainers.fluent.ContainerAppsBuildsByContainerAppsClient; +import com.azure.resourcemanager.appcontainers.fluent.models.ContainerAppsBuildResourceInner; +import com.azure.resourcemanager.appcontainers.models.ContainerAppsBuildCollection; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ContainerAppsBuildsByContainerAppsClient. + */ +public final class ContainerAppsBuildsByContainerAppsClientImpl implements ContainerAppsBuildsByContainerAppsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ContainerAppsBuildsByContainerAppsService service; + + /** + * The service client containing this operation class. + */ + private final ContainerAppsApiClientImpl client; + + /** + * Initializes an instance of ContainerAppsBuildsByContainerAppsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ContainerAppsBuildsByContainerAppsClientImpl(ContainerAppsApiClientImpl client) { + this.service = RestProxy.create(ContainerAppsBuildsByContainerAppsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerAppsApiClientContainerAppsBuildsByContainerApps to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerAppsApiClie") + public interface ContainerAppsBuildsByContainerAppsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/builds") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, @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 Container Apps Build resources by Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Build is associated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Container Apps Build Resource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String containerAppName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, accept, context)) + .>map(res -> new 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 Container Apps Build resources by Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Build is associated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Container Apps Build Resource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String containerAppName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, containerAppName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List Container Apps Build resources by Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Build is associated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Container Apps Build Resource list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String containerAppName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, containerAppName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List Container Apps Build resources by Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Build is associated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Container Apps Build Resource list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String containerAppName, + Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, containerAppName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List Container Apps Build resources by Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Build is associated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Container Apps Build Resource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String containerAppName) { + return new PagedIterable<>(listAsync(resourceGroupName, containerAppName)); + } + + /** + * List Container Apps Build resources by Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Build is associated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Container Apps Build Resource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String containerAppName, + Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, containerAppName, 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 the response of a Container Apps Build Resource 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 Container Apps Build Resource 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/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsBuildsByContainerAppsImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsBuildsByContainerAppsImpl.java new file mode 100644 index 000000000000..f5ff5268f874 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsBuildsByContainerAppsImpl.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.appcontainers.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.appcontainers.fluent.ContainerAppsBuildsByContainerAppsClient; +import com.azure.resourcemanager.appcontainers.fluent.models.ContainerAppsBuildResourceInner; +import com.azure.resourcemanager.appcontainers.models.ContainerAppsBuildResource; +import com.azure.resourcemanager.appcontainers.models.ContainerAppsBuildsByContainerApps; + +public final class ContainerAppsBuildsByContainerAppsImpl implements ContainerAppsBuildsByContainerApps { + private static final ClientLogger LOGGER = new ClientLogger(ContainerAppsBuildsByContainerAppsImpl.class); + + private final ContainerAppsBuildsByContainerAppsClient innerClient; + + private final com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager; + + public ContainerAppsBuildsByContainerAppsImpl(ContainerAppsBuildsByContainerAppsClient innerClient, + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String containerAppName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, containerAppName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ContainerAppsBuildResourceImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String containerAppName, + Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, containerAppName, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ContainerAppsBuildResourceImpl(inner1, this.manager())); + } + + private ContainerAppsBuildsByContainerAppsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsBuildsClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsBuildsClientImpl.java new file mode 100644 index 000000000000..0a9b6a1c7932 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsBuildsClientImpl.java @@ -0,0 +1,441 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.implementation; + +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.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.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.appcontainers.fluent.ContainerAppsBuildsClient; +import com.azure.resourcemanager.appcontainers.fluent.models.ContainerAppsBuildResourceInner; +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 ContainerAppsBuildsClient. + */ +public final class ContainerAppsBuildsClientImpl implements ContainerAppsBuildsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ContainerAppsBuildsService service; + + /** + * The service client containing this operation class. + */ + private final ContainerAppsApiClientImpl client; + + /** + * Initializes an instance of ContainerAppsBuildsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ContainerAppsBuildsClientImpl(ContainerAppsApiClientImpl client) { + this.service = RestProxy.create(ContainerAppsBuildsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerAppsApiClientContainerAppsBuilds to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerAppsApiClie") + public interface ContainerAppsBuildsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/builds/{buildName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, @PathParam("buildName") String buildName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/builds/{buildName}") + @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("containerAppName") String containerAppName, @PathParam("buildName") String buildName, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get a Container Apps Build resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Build is associated. + * @param buildName The name of a build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Container Apps Build resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String containerAppName, String buildName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (buildName == null) { + return Mono.error(new IllegalArgumentException("Parameter buildName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, buildName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a Container Apps Build resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Build is associated. + * @param buildName The name of a build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Container Apps Build resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String containerAppName, String buildName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (buildName == null) { + return Mono.error(new IllegalArgumentException("Parameter buildName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, containerAppName, buildName, accept, context); + } + + /** + * Get a Container Apps Build resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Build is associated. + * @param buildName The name of a build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Container Apps Build resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String containerAppName, + String buildName) { + return getWithResponseAsync(resourceGroupName, containerAppName, buildName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a Container Apps Build resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Build is associated. + * @param buildName The name of a build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Container Apps Build resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String containerAppName, + String buildName, Context context) { + return getWithResponseAsync(resourceGroupName, containerAppName, buildName, context).block(); + } + + /** + * Get a Container Apps Build resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Build is associated. + * @param buildName The name of a build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Container Apps Build resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContainerAppsBuildResourceInner get(String resourceGroupName, String containerAppName, String buildName) { + return getWithResponse(resourceGroupName, containerAppName, buildName, Context.NONE).getValue(); + } + + /** + * Delete a Container Apps Build resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Build is associated. + * @param buildName The name of a build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 containerAppName, + String buildName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (buildName == null) { + return Mono.error(new IllegalArgumentException("Parameter buildName 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, containerAppName, buildName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a Container Apps Build resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Build is associated. + * @param buildName The name of a build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 containerAppName, + String buildName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (buildName == null) { + return Mono.error(new IllegalArgumentException("Parameter buildName 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, containerAppName, buildName, accept, context); + } + + /** + * Delete a Container Apps Build resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Build is associated. + * @param buildName The name of a build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 containerAppName, + String buildName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, containerAppName, buildName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a Container Apps Build resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Build is associated. + * @param buildName The name of a build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 containerAppName, + String buildName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, containerAppName, buildName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a Container Apps Build resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Build is associated. + * @param buildName The name of a build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked 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 containerAppName, + String buildName) { + return this.beginDeleteAsync(resourceGroupName, containerAppName, buildName).getSyncPoller(); + } + + /** + * Delete a Container Apps Build resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Build is associated. + * @param buildName The name of a build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked 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 containerAppName, + String buildName, Context context) { + return this.beginDeleteAsync(resourceGroupName, containerAppName, buildName, context).getSyncPoller(); + } + + /** + * Delete a Container Apps Build resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Build is associated. + * @param buildName The name of a build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 containerAppName, String buildName) { + return beginDeleteAsync(resourceGroupName, containerAppName, buildName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Container Apps Build resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Build is associated. + * @param buildName The name of a build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 containerAppName, String buildName, + Context context) { + return beginDeleteAsync(resourceGroupName, containerAppName, buildName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Container Apps Build resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Build is associated. + * @param buildName The name of a build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 containerAppName, String buildName) { + deleteAsync(resourceGroupName, containerAppName, buildName).block(); + } + + /** + * Delete a Container Apps Build resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Build is associated. + * @param buildName The name of a build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 containerAppName, String buildName, Context context) { + deleteAsync(resourceGroupName, containerAppName, buildName, context).block(); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsBuildsImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsBuildsImpl.java new file mode 100644 index 000000000000..2e9fdac76510 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsBuildsImpl.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.appcontainers.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appcontainers.fluent.ContainerAppsBuildsClient; +import com.azure.resourcemanager.appcontainers.fluent.models.ContainerAppsBuildResourceInner; +import com.azure.resourcemanager.appcontainers.models.ContainerAppsBuildResource; +import com.azure.resourcemanager.appcontainers.models.ContainerAppsBuilds; + +public final class ContainerAppsBuildsImpl implements ContainerAppsBuilds { + private static final ClientLogger LOGGER = new ClientLogger(ContainerAppsBuildsImpl.class); + + private final ContainerAppsBuildsClient innerClient; + + private final com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager; + + public ContainerAppsBuildsImpl(ContainerAppsBuildsClient innerClient, + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String containerAppName, + String buildName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, containerAppName, buildName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ContainerAppsBuildResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ContainerAppsBuildResource get(String resourceGroupName, String containerAppName, String buildName) { + ContainerAppsBuildResourceInner inner + = this.serviceClient().get(resourceGroupName, containerAppName, buildName); + if (inner != null) { + return new ContainerAppsBuildResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String containerAppName, String buildName) { + this.serviceClient().delete(resourceGroupName, containerAppName, buildName); + } + + public void delete(String resourceGroupName, String containerAppName, String buildName, Context context) { + this.serviceClient().delete(resourceGroupName, containerAppName, buildName, context); + } + + private ContainerAppsBuildsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsClientImpl.java index fc84088e1a3b..1562abf97ca8 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsClientImpl.java @@ -2057,9 +2057,7 @@ public ContainerAppInner stop(String resourceGroupName, String containerAppName, /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -2087,9 +2085,7 @@ private Mono> listBySubscriptionNextSinglePageA /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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 DefaultErrorResponseErrorException thrown if the request is rejected by server. @@ -2117,9 +2113,7 @@ private Mono> listBySubscriptionNextSinglePageA /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -2147,9 +2141,7 @@ private Mono> listByResourceGroupNextSinglePage /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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 DefaultErrorResponseErrorException thrown if the request is rejected by server. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsDiagnosticsClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsDiagnosticsClientImpl.java index e2c922eaca47..8b7c5209b3d1 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsDiagnosticsClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsDiagnosticsClientImpl.java @@ -842,9 +842,7 @@ public ContainerAppInner getRoot(String resourceGroupName, String containerAppNa /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -871,9 +869,7 @@ private Mono> listDetectorsNextSinglePageAsync(S /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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 DefaultErrorResponseErrorException thrown if the request is rejected by server. @@ -900,9 +896,7 @@ private Mono> listDetectorsNextSinglePageAsync(S /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -929,9 +923,7 @@ private Mono> listRevisionsNextSinglePageAsync(Stri /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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 DefaultErrorResponseErrorException thrown if the request is rejected by server. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsPatchResourceImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsPatchResourceImpl.java new file mode 100644 index 000000000000..da5d66fd22e1 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsPatchResourceImpl.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.appcontainers.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appcontainers.fluent.models.ContainerAppsPatchResourceInner; +import com.azure.resourcemanager.appcontainers.models.ContainerAppsPatchResource; +import com.azure.resourcemanager.appcontainers.models.PatchProperties; + +public final class ContainerAppsPatchResourceImpl implements ContainerAppsPatchResource { + private ContainerAppsPatchResourceInner innerObject; + + private final com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager; + + ContainerAppsPatchResourceImpl(ContainerAppsPatchResourceInner innerObject, + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager 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 PatchProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public ContainerAppsPatchResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsPatchesClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsPatchesClientImpl.java new file mode 100644 index 000000000000..3116fd1df17a --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsPatchesClientImpl.java @@ -0,0 +1,1202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.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.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.appcontainers.fluent.ContainerAppsPatchesClient; +import com.azure.resourcemanager.appcontainers.fluent.models.ContainerAppsPatchResourceInner; +import com.azure.resourcemanager.appcontainers.models.PatchCollection; +import com.azure.resourcemanager.appcontainers.models.PatchSkipConfig; +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 ContainerAppsPatchesClient. + */ +public final class ContainerAppsPatchesClientImpl implements ContainerAppsPatchesClient { + /** + * The proxy service used to perform REST calls. + */ + private final ContainerAppsPatchesService service; + + /** + * The service client containing this operation class. + */ + private final ContainerAppsApiClientImpl client; + + /** + * Initializes an instance of ContainerAppsPatchesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ContainerAppsPatchesClientImpl(ContainerAppsApiClientImpl client) { + this.service = RestProxy.create(ContainerAppsPatchesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerAppsApiClientContainerAppsPatches to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerAppsApiClie") + public interface ContainerAppsPatchesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/patches") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByContainerApp(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/patches/{patchName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, @PathParam("patchName") String patchName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/patches/{patchName}") + @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("containerAppName") String containerAppName, @PathParam("patchName") String patchName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/patches/{patchName}/skipConfig") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> skipConfigure(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, @PathParam("patchName") String patchName, + @BodyParam("application/json") PatchSkipConfig patchSkipConfig, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/patches/{patchName}/apply") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> apply(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, @PathParam("patchName") String patchName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByContainerAppNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List Container Apps Patch resources by ContainerApp. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param filter The filter to apply on the operation. For example, $filter=properties/patchApplyStatus eq + * 'Succeeded'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App patch collection along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByContainerAppSinglePageAsync(String resourceGroupName, String containerAppName, String filter) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByContainerApp(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, filter, accept, context)) + .>map(res -> new 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 Container Apps Patch resources by ContainerApp. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param filter The filter to apply on the operation. For example, $filter=properties/patchApplyStatus eq + * 'Succeeded'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App patch collection along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByContainerAppSinglePageAsync( + String resourceGroupName, String containerAppName, String filter, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByContainerApp(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, containerAppName, filter, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List Container Apps Patch resources by ContainerApp. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param filter The filter to apply on the operation. For example, $filter=properties/patchApplyStatus eq + * 'Succeeded'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App patch collection as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByContainerAppAsync(String resourceGroupName, + String containerAppName, String filter) { + return new PagedFlux<>(() -> listByContainerAppSinglePageAsync(resourceGroupName, containerAppName, filter), + nextLink -> listByContainerAppNextSinglePageAsync(nextLink)); + } + + /** + * List Container Apps Patch resources by ContainerApp. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App patch collection as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByContainerAppAsync(String resourceGroupName, + String containerAppName) { + final String filter = null; + return new PagedFlux<>(() -> listByContainerAppSinglePageAsync(resourceGroupName, containerAppName, filter), + nextLink -> listByContainerAppNextSinglePageAsync(nextLink)); + } + + /** + * List Container Apps Patch resources by ContainerApp. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param filter The filter to apply on the operation. For example, $filter=properties/patchApplyStatus eq + * 'Succeeded'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App patch collection as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByContainerAppAsync(String resourceGroupName, + String containerAppName, String filter, Context context) { + return new PagedFlux<>( + () -> listByContainerAppSinglePageAsync(resourceGroupName, containerAppName, filter, context), + nextLink -> listByContainerAppNextSinglePageAsync(nextLink, context)); + } + + /** + * List Container Apps Patch resources by ContainerApp. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App patch collection as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByContainerApp(String resourceGroupName, + String containerAppName) { + final String filter = null; + return new PagedIterable<>(listByContainerAppAsync(resourceGroupName, containerAppName, filter)); + } + + /** + * List Container Apps Patch resources by ContainerApp. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param filter The filter to apply on the operation. For example, $filter=properties/patchApplyStatus eq + * 'Succeeded'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App patch collection as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByContainerApp(String resourceGroupName, + String containerAppName, String filter, Context context) { + return new PagedIterable<>(listByContainerAppAsync(resourceGroupName, containerAppName, filter, context)); + } + + /** + * Get details for specific Container Apps Patch by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details for specific Container Apps Patch by patch name along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String containerAppName, String patchName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (patchName == null) { + return Mono.error(new IllegalArgumentException("Parameter patchName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, patchName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get details for specific Container Apps Patch by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details for specific Container Apps Patch by patch name along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String containerAppName, String patchName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (patchName == null) { + return Mono.error(new IllegalArgumentException("Parameter patchName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, containerAppName, patchName, accept, context); + } + + /** + * Get details for specific Container Apps Patch by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details for specific Container Apps Patch by patch name on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String containerAppName, + String patchName) { + return getWithResponseAsync(resourceGroupName, containerAppName, patchName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get details for specific Container Apps Patch by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details for specific Container Apps Patch by patch name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String containerAppName, + String patchName, Context context) { + return getWithResponseAsync(resourceGroupName, containerAppName, patchName, context).block(); + } + + /** + * Get details for specific Container Apps Patch by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details for specific Container Apps Patch by patch name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContainerAppsPatchResourceInner get(String resourceGroupName, String containerAppName, String patchName) { + return getWithResponse(resourceGroupName, containerAppName, patchName, Context.NONE).getValue(); + } + + /** + * Delete specific Container Apps Patch by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 containerAppName, + String patchName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (patchName == null) { + return Mono.error(new IllegalArgumentException("Parameter patchName 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, containerAppName, patchName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete specific Container Apps Patch by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 containerAppName, + String patchName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (patchName == null) { + return Mono.error(new IllegalArgumentException("Parameter patchName 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, containerAppName, patchName, accept, context); + } + + /** + * Delete specific Container Apps Patch by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 containerAppName, + String patchName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, containerAppName, patchName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete specific Container Apps Patch by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 containerAppName, + String patchName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, containerAppName, patchName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete specific Container Apps Patch by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked 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 containerAppName, + String patchName) { + return this.beginDeleteAsync(resourceGroupName, containerAppName, patchName).getSyncPoller(); + } + + /** + * Delete specific Container Apps Patch by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked 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 containerAppName, + String patchName, Context context) { + return this.beginDeleteAsync(resourceGroupName, containerAppName, patchName, context).getSyncPoller(); + } + + /** + * Delete specific Container Apps Patch by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 containerAppName, String patchName) { + return beginDeleteAsync(resourceGroupName, containerAppName, patchName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete specific Container Apps Patch by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 containerAppName, String patchName, + Context context) { + return beginDeleteAsync(resourceGroupName, containerAppName, patchName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete specific Container Apps Patch by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 containerAppName, String patchName) { + deleteAsync(resourceGroupName, containerAppName, patchName).block(); + } + + /** + * Delete specific Container Apps Patch by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 containerAppName, String patchName, Context context) { + deleteAsync(resourceGroupName, containerAppName, patchName, context).block(); + } + + /** + * Configure the Container Apps Patch skip option by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param patchSkipConfig Configure patcher to skip a patch or not. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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>> skipConfigureWithResponseAsync(String resourceGroupName, + String containerAppName, String patchName, PatchSkipConfig patchSkipConfig) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (patchName == null) { + return Mono.error(new IllegalArgumentException("Parameter patchName is required and cannot be null.")); + } + if (patchSkipConfig == null) { + return Mono + .error(new IllegalArgumentException("Parameter patchSkipConfig is required and cannot be null.")); + } else { + patchSkipConfig.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.skipConfigure(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, patchName, patchSkipConfig, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Configure the Container Apps Patch skip option by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param patchSkipConfig Configure patcher to skip a patch or not. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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>> skipConfigureWithResponseAsync(String resourceGroupName, + String containerAppName, String patchName, PatchSkipConfig patchSkipConfig, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (patchName == null) { + return Mono.error(new IllegalArgumentException("Parameter patchName is required and cannot be null.")); + } + if (patchSkipConfig == null) { + return Mono + .error(new IllegalArgumentException("Parameter patchSkipConfig is required and cannot be null.")); + } else { + patchSkipConfig.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.skipConfigure(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, patchName, patchSkipConfig, accept, + context); + } + + /** + * Configure the Container Apps Patch skip option by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param patchSkipConfig Configure patcher to skip a patch or not. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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> beginSkipConfigureAsync(String resourceGroupName, + String containerAppName, String patchName, PatchSkipConfig patchSkipConfig) { + Mono>> mono + = skipConfigureWithResponseAsync(resourceGroupName, containerAppName, patchName, patchSkipConfig); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Configure the Container Apps Patch skip option by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param patchSkipConfig Configure patcher to skip a patch or not. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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> beginSkipConfigureAsync(String resourceGroupName, + String containerAppName, String patchName, PatchSkipConfig patchSkipConfig, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = skipConfigureWithResponseAsync(resourceGroupName, containerAppName, patchName, patchSkipConfig, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Configure the Container Apps Patch skip option by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param patchSkipConfig Configure patcher to skip a patch or not. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked 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> beginSkipConfigure(String resourceGroupName, String containerAppName, + String patchName, PatchSkipConfig patchSkipConfig) { + return this.beginSkipConfigureAsync(resourceGroupName, containerAppName, patchName, patchSkipConfig) + .getSyncPoller(); + } + + /** + * Configure the Container Apps Patch skip option by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param patchSkipConfig Configure patcher to skip a patch or not. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked 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> beginSkipConfigure(String resourceGroupName, String containerAppName, + String patchName, PatchSkipConfig patchSkipConfig, Context context) { + return this.beginSkipConfigureAsync(resourceGroupName, containerAppName, patchName, patchSkipConfig, context) + .getSyncPoller(); + } + + /** + * Configure the Container Apps Patch skip option by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param patchSkipConfig Configure patcher to skip a patch or not. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 skipConfigureAsync(String resourceGroupName, String containerAppName, String patchName, + PatchSkipConfig patchSkipConfig) { + return beginSkipConfigureAsync(resourceGroupName, containerAppName, patchName, patchSkipConfig).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Configure the Container Apps Patch skip option by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param patchSkipConfig Configure patcher to skip a patch or not. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 skipConfigureAsync(String resourceGroupName, String containerAppName, String patchName, + PatchSkipConfig patchSkipConfig, Context context) { + return beginSkipConfigureAsync(resourceGroupName, containerAppName, patchName, patchSkipConfig, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Configure the Container Apps Patch skip option by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param patchSkipConfig Configure patcher to skip a patch or not. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 skipConfigure(String resourceGroupName, String containerAppName, String patchName, + PatchSkipConfig patchSkipConfig) { + skipConfigureAsync(resourceGroupName, containerAppName, patchName, patchSkipConfig).block(); + } + + /** + * Configure the Container Apps Patch skip option by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param patchSkipConfig Configure patcher to skip a patch or not. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 skipConfigure(String resourceGroupName, String containerAppName, String patchName, + PatchSkipConfig patchSkipConfig, Context context) { + skipConfigureAsync(resourceGroupName, containerAppName, patchName, patchSkipConfig, context).block(); + } + + /** + * Apply a Container Apps Patch resource with patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App Patch along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> applyWithResponseAsync(String resourceGroupName, String containerAppName, + String patchName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (patchName == null) { + return Mono.error(new IllegalArgumentException("Parameter patchName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.apply(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, patchName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Apply a Container Apps Patch resource with patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App Patch along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> applyWithResponseAsync(String resourceGroupName, String containerAppName, + String patchName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (patchName == null) { + return Mono.error(new IllegalArgumentException("Parameter patchName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.apply(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, containerAppName, patchName, accept, context); + } + + /** + * Apply a Container Apps Patch resource with patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of container App Patch. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ContainerAppsPatchResourceInner> + beginApplyAsync(String resourceGroupName, String containerAppName, String patchName) { + Mono>> mono = applyWithResponseAsync(resourceGroupName, containerAppName, patchName); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ContainerAppsPatchResourceInner.class, ContainerAppsPatchResourceInner.class, + this.client.getContext()); + } + + /** + * Apply a Container Apps Patch resource with patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of container App Patch. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ContainerAppsPatchResourceInner> + beginApplyAsync(String resourceGroupName, String containerAppName, String patchName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = applyWithResponseAsync(resourceGroupName, containerAppName, patchName, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ContainerAppsPatchResourceInner.class, ContainerAppsPatchResourceInner.class, + context); + } + + /** + * Apply a Container Apps Patch resource with patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of container App Patch. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ContainerAppsPatchResourceInner> + beginApply(String resourceGroupName, String containerAppName, String patchName) { + return this.beginApplyAsync(resourceGroupName, containerAppName, patchName).getSyncPoller(); + } + + /** + * Apply a Container Apps Patch resource with patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of container App Patch. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ContainerAppsPatchResourceInner> + beginApply(String resourceGroupName, String containerAppName, String patchName, Context context) { + return this.beginApplyAsync(resourceGroupName, containerAppName, patchName, context).getSyncPoller(); + } + + /** + * Apply a Container Apps Patch resource with patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App Patch on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono applyAsync(String resourceGroupName, String containerAppName, + String patchName) { + return beginApplyAsync(resourceGroupName, containerAppName, patchName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Apply a Container Apps Patch resource with patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App Patch on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono applyAsync(String resourceGroupName, String containerAppName, + String patchName, Context context) { + return beginApplyAsync(resourceGroupName, containerAppName, patchName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Apply a Container Apps Patch resource with patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App Patch. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContainerAppsPatchResourceInner apply(String resourceGroupName, String containerAppName, String patchName) { + return applyAsync(resourceGroupName, containerAppName, patchName).block(); + } + + /** + * Apply a Container Apps Patch resource with patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App Patch. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContainerAppsPatchResourceInner apply(String resourceGroupName, String containerAppName, String patchName, + Context context) { + return applyAsync(resourceGroupName, containerAppName, patchName, 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 container App patch collection along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByContainerAppNextSinglePageAsync(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.listByContainerAppNext(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 container App patch collection along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByContainerAppNextSinglePageAsync(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.listByContainerAppNext(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/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsPatchesImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsPatchesImpl.java new file mode 100644 index 000000000000..e37f354e487c --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsPatchesImpl.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.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.appcontainers.fluent.ContainerAppsPatchesClient; +import com.azure.resourcemanager.appcontainers.fluent.models.ContainerAppsPatchResourceInner; +import com.azure.resourcemanager.appcontainers.models.ContainerAppsPatches; +import com.azure.resourcemanager.appcontainers.models.ContainerAppsPatchResource; +import com.azure.resourcemanager.appcontainers.models.PatchSkipConfig; + +public final class ContainerAppsPatchesImpl implements ContainerAppsPatches { + private static final ClientLogger LOGGER = new ClientLogger(ContainerAppsPatchesImpl.class); + + private final ContainerAppsPatchesClient innerClient; + + private final com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager; + + public ContainerAppsPatchesImpl(ContainerAppsPatchesClient innerClient, + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByContainerApp(String resourceGroupName, + String containerAppName) { + PagedIterable inner + = this.serviceClient().listByContainerApp(resourceGroupName, containerAppName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ContainerAppsPatchResourceImpl(inner1, this.manager())); + } + + public PagedIterable listByContainerApp(String resourceGroupName, + String containerAppName, String filter, Context context) { + PagedIterable inner + = this.serviceClient().listByContainerApp(resourceGroupName, containerAppName, filter, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ContainerAppsPatchResourceImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String containerAppName, + String patchName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, containerAppName, patchName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ContainerAppsPatchResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ContainerAppsPatchResource get(String resourceGroupName, String containerAppName, String patchName) { + ContainerAppsPatchResourceInner inner + = this.serviceClient().get(resourceGroupName, containerAppName, patchName); + if (inner != null) { + return new ContainerAppsPatchResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String containerAppName, String patchName) { + this.serviceClient().delete(resourceGroupName, containerAppName, patchName); + } + + public void delete(String resourceGroupName, String containerAppName, String patchName, Context context) { + this.serviceClient().delete(resourceGroupName, containerAppName, patchName, context); + } + + public void skipConfigure(String resourceGroupName, String containerAppName, String patchName, + PatchSkipConfig patchSkipConfig) { + this.serviceClient().skipConfigure(resourceGroupName, containerAppName, patchName, patchSkipConfig); + } + + public void skipConfigure(String resourceGroupName, String containerAppName, String patchName, + PatchSkipConfig patchSkipConfig, Context context) { + this.serviceClient().skipConfigure(resourceGroupName, containerAppName, patchName, patchSkipConfig, context); + } + + public ContainerAppsPatchResource apply(String resourceGroupName, String containerAppName, String patchName) { + ContainerAppsPatchResourceInner inner + = this.serviceClient().apply(resourceGroupName, containerAppName, patchName); + if (inner != null) { + return new ContainerAppsPatchResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public ContainerAppsPatchResource apply(String resourceGroupName, String containerAppName, String patchName, + Context context) { + ContainerAppsPatchResourceInner inner + = this.serviceClient().apply(resourceGroupName, containerAppName, patchName, context); + if (inner != null) { + return new ContainerAppsPatchResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + private ContainerAppsPatchesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsRevisionReplicasClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsRevisionReplicasClientImpl.java index 1e8b67b9cbfa..c61df0a2fa31 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsRevisionReplicasClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsRevisionReplicasClientImpl.java @@ -52,8 +52,8 @@ public final class ContainerAppsRevisionReplicasClientImpl implements ContainerA } /** - * The interface defining all the services for ContainerAppsApiClientContainerAppsRevisionReplicas to be used by - * the proxy service to perform REST calls. + * The interface defining all the services for ContainerAppsApiClientContainerAppsRevisionReplicas to be used by the + * proxy service to perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "ContainerAppsApiClie") diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsRevisionReplicasImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsRevisionReplicasImpl.java index d4af3bac90f6..78840c5e4e64 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsRevisionReplicasImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsRevisionReplicasImpl.java @@ -30,8 +30,8 @@ public ContainerAppsRevisionReplicasImpl(ContainerAppsRevisionReplicasClient inn public Response getReplicaWithResponse(String resourceGroupName, String containerAppName, String revisionName, String replicaName, Context context) { - Response inner = this.serviceClient().getReplicaWithResponse(resourceGroupName, containerAppName, - revisionName, replicaName, context); + Response inner = this.serviceClient() + .getReplicaWithResponse(resourceGroupName, containerAppName, revisionName, replicaName, context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new ReplicaImpl(inner.getValue(), this.manager())); diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsRevisionsClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsRevisionsClientImpl.java index 9603ed5f754c..2feed7a78502 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsRevisionsClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsRevisionsClientImpl.java @@ -817,9 +817,7 @@ public void restartRevision(String resourceGroupName, String containerAppName, S /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -846,9 +844,7 @@ private Mono> listRevisionsNextSinglePageAsync(Stri /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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 DefaultErrorResponseErrorException thrown if the request is rejected by server. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsRevisionsImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsRevisionsImpl.java index 2f77c0175db5..c882280ca305 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsRevisionsImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsRevisionsImpl.java @@ -62,8 +62,8 @@ public Revision getRevision(String resourceGroupName, String containerAppName, S public Response activateRevisionWithResponse(String resourceGroupName, String containerAppName, String revisionName, Context context) { - return this.serviceClient().activateRevisionWithResponse(resourceGroupName, containerAppName, revisionName, - context); + return this.serviceClient() + .activateRevisionWithResponse(resourceGroupName, containerAppName, revisionName, context); } public void activateRevision(String resourceGroupName, String containerAppName, String revisionName) { @@ -72,8 +72,8 @@ public void activateRevision(String resourceGroupName, String containerAppName, public Response deactivateRevisionWithResponse(String resourceGroupName, String containerAppName, String revisionName, Context context) { - return this.serviceClient().deactivateRevisionWithResponse(resourceGroupName, containerAppName, revisionName, - context); + return this.serviceClient() + .deactivateRevisionWithResponse(resourceGroupName, containerAppName, revisionName, context); } public void deactivateRevision(String resourceGroupName, String containerAppName, String revisionName) { @@ -82,8 +82,8 @@ public void deactivateRevision(String resourceGroupName, String containerAppName public Response restartRevisionWithResponse(String resourceGroupName, String containerAppName, String revisionName, Context context) { - return this.serviceClient().restartRevisionWithResponse(resourceGroupName, containerAppName, revisionName, - context); + return this.serviceClient() + .restartRevisionWithResponse(resourceGroupName, containerAppName, revisionName, context); } public void restartRevision(String resourceGroupName, String containerAppName, String revisionName) { diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsSessionPoolsClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsSessionPoolsClientImpl.java new file mode 100644 index 000000000000..e929403abe0f --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsSessionPoolsClientImpl.java @@ -0,0 +1,1358 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.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.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.appcontainers.fluent.ContainerAppsSessionPoolsClient; +import com.azure.resourcemanager.appcontainers.fluent.models.SessionPoolInner; +import com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException; +import com.azure.resourcemanager.appcontainers.models.SessionPoolCollection; +import com.azure.resourcemanager.appcontainers.models.SessionPoolUpdatableProperties; +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 ContainerAppsSessionPoolsClient. + */ +public final class ContainerAppsSessionPoolsClientImpl implements ContainerAppsSessionPoolsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ContainerAppsSessionPoolsService service; + + /** + * The service client containing this operation class. + */ + private final ContainerAppsApiClientImpl client; + + /** + * Initializes an instance of ContainerAppsSessionPoolsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ContainerAppsSessionPoolsClientImpl(ContainerAppsApiClientImpl client) { + this.service = RestProxy.create(ContainerAppsSessionPoolsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerAppsApiClientContainerAppsSessionPools to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerAppsApiClie") + public interface ContainerAppsSessionPoolsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.App/sessionPools") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/sessionPools") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/sessionPools/{sessionPoolName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sessionPoolName") String sessionPoolName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/sessionPools/{sessionPoolName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sessionPoolName") String sessionPoolName, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") SessionPoolInner sessionPoolEnvelope, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/sessionPools/{sessionPoolName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono>> update(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sessionPoolName") String sessionPoolName, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") SessionPoolUpdatableProperties sessionPoolEnvelope, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/sessionPools/{sessionPoolName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sessionPoolName") String sessionPoolName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.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(DefaultErrorResponseErrorException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get the session pools in a given subscription. + * + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the session pools in a given subscription 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.getSubscriptionId(), + 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())); + } + + /** + * Get the session pools in a given subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the session pools in a given subscription 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.getSubscriptionId(), this.client.getApiVersion(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the session pools in a given subscription. + * + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the session pools in a given subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Get the session pools in a given subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the session pools in a given subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Get the session pools in a given subscription. + * + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the session pools in a given subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Get the session pools in a given subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the session pools in a given subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the session pools in a given resource group of a subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the session pools in a given resource group of a subscription 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.getSubscriptionId(), resourceGroupName, 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())); + } + + /** + * Get the session pools in a given resource group of a subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the session pools in a given resource group of a subscription 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.getSubscriptionId(), resourceGroupName, + this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the session pools in a given resource group of a subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the session pools in a given resource group of a subscription as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Get the session pools in a given resource group of a subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the session pools in a given resource group of a subscription 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)); + } + + /** + * Get the session pools in a given resource group of a subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the session pools in a given resource group of a subscription as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Get the session pools in a given resource group of a subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the session pools in a given resource group of a subscription as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get the properties of a session pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a session pool along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String sessionPoolName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sessionPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sessionPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, sessionPoolName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the properties of a session pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a session pool along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String sessionPoolName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sessionPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sessionPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + sessionPoolName, this.client.getApiVersion(), accept, context); + } + + /** + * Get the properties of a session pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a session pool on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String sessionPoolName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, sessionPoolName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the properties of a session pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a session pool along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String sessionPoolName, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, sessionPoolName, context).block(); + } + + /** + * Get the properties of a session pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a session pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SessionPoolInner getByResourceGroup(String resourceGroupName, String sessionPoolName) { + return getByResourceGroupWithResponse(resourceGroupName, sessionPoolName, Context.NONE).getValue(); + } + + /** + * Create or update a session pool. + * + * Create or update a session pool with the given properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param sessionPoolEnvelope Properties used to create a session pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App session pool along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String sessionPoolName, SessionPoolInner sessionPoolEnvelope) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sessionPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sessionPoolName is required and cannot be null.")); + } + if (sessionPoolEnvelope == null) { + return Mono + .error(new IllegalArgumentException("Parameter sessionPoolEnvelope is required and cannot be null.")); + } else { + sessionPoolEnvelope.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, sessionPoolName, this.client.getApiVersion(), sessionPoolEnvelope, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a session pool. + * + * Create or update a session pool with the given properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param sessionPoolEnvelope Properties used to create a session pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App session pool along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String sessionPoolName, SessionPoolInner sessionPoolEnvelope, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sessionPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sessionPoolName is required and cannot be null.")); + } + if (sessionPoolEnvelope == null) { + return Mono + .error(new IllegalArgumentException("Parameter sessionPoolEnvelope is required and cannot be null.")); + } else { + sessionPoolEnvelope.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + sessionPoolName, this.client.getApiVersion(), sessionPoolEnvelope, accept, context); + } + + /** + * Create or update a session pool. + * + * Create or update a session pool with the given properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param sessionPoolEnvelope Properties used to create a session pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of container App session pool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SessionPoolInner> beginCreateOrUpdateAsync( + String resourceGroupName, String sessionPoolName, SessionPoolInner sessionPoolEnvelope) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, sessionPoolName, sessionPoolEnvelope); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + SessionPoolInner.class, SessionPoolInner.class, this.client.getContext()); + } + + /** + * Create or update a session pool. + * + * Create or update a session pool with the given properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param sessionPoolEnvelope Properties used to create a session pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of container App session pool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SessionPoolInner> beginCreateOrUpdateAsync( + String resourceGroupName, String sessionPoolName, SessionPoolInner sessionPoolEnvelope, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, sessionPoolName, sessionPoolEnvelope, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + SessionPoolInner.class, SessionPoolInner.class, context); + } + + /** + * Create or update a session pool. + * + * Create or update a session pool with the given properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param sessionPoolEnvelope Properties used to create a session pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of container App session pool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SessionPoolInner> beginCreateOrUpdate(String resourceGroupName, + String sessionPoolName, SessionPoolInner sessionPoolEnvelope) { + return this.beginCreateOrUpdateAsync(resourceGroupName, sessionPoolName, sessionPoolEnvelope).getSyncPoller(); + } + + /** + * Create or update a session pool. + * + * Create or update a session pool with the given properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param sessionPoolEnvelope Properties used to create a session pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of container App session pool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SessionPoolInner> beginCreateOrUpdate(String resourceGroupName, + String sessionPoolName, SessionPoolInner sessionPoolEnvelope, Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, sessionPoolName, sessionPoolEnvelope, context) + .getSyncPoller(); + } + + /** + * Create or update a session pool. + * + * Create or update a session pool with the given properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param sessionPoolEnvelope Properties used to create a session pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App session pool on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String sessionPoolName, + SessionPoolInner sessionPoolEnvelope) { + return beginCreateOrUpdateAsync(resourceGroupName, sessionPoolName, sessionPoolEnvelope).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a session pool. + * + * Create or update a session pool with the given properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param sessionPoolEnvelope Properties used to create a session pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App session pool on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String sessionPoolName, + SessionPoolInner sessionPoolEnvelope, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, sessionPoolName, sessionPoolEnvelope, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a session pool. + * + * Create or update a session pool with the given properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param sessionPoolEnvelope Properties used to create a session pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App session pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SessionPoolInner createOrUpdate(String resourceGroupName, String sessionPoolName, + SessionPoolInner sessionPoolEnvelope) { + return createOrUpdateAsync(resourceGroupName, sessionPoolName, sessionPoolEnvelope).block(); + } + + /** + * Create or update a session pool. + * + * Create or update a session pool with the given properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param sessionPoolEnvelope Properties used to create a session pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App session pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SessionPoolInner createOrUpdate(String resourceGroupName, String sessionPoolName, + SessionPoolInner sessionPoolEnvelope, Context context) { + return createOrUpdateAsync(resourceGroupName, sessionPoolName, sessionPoolEnvelope, context).block(); + } + + /** + * Update properties of a session pool + * + * Patches a session pool using JSON merge patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param sessionPoolEnvelope Properties used to create a session pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App session pool along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String sessionPoolName, + SessionPoolUpdatableProperties sessionPoolEnvelope) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sessionPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sessionPoolName is required and cannot be null.")); + } + if (sessionPoolEnvelope == null) { + return Mono + .error(new IllegalArgumentException("Parameter sessionPoolEnvelope is required and cannot be null.")); + } else { + sessionPoolEnvelope.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, sessionPoolName, this.client.getApiVersion(), sessionPoolEnvelope, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update properties of a session pool + * + * Patches a session pool using JSON merge patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param sessionPoolEnvelope Properties used to create a session pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App session pool along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String sessionPoolName, + SessionPoolUpdatableProperties sessionPoolEnvelope, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sessionPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sessionPoolName is required and cannot be null.")); + } + if (sessionPoolEnvelope == null) { + return Mono + .error(new IllegalArgumentException("Parameter sessionPoolEnvelope is required and cannot be null.")); + } else { + sessionPoolEnvelope.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + sessionPoolName, this.client.getApiVersion(), sessionPoolEnvelope, accept, context); + } + + /** + * Update properties of a session pool + * + * Patches a session pool using JSON merge patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param sessionPoolEnvelope Properties used to create a session pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of container App session pool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SessionPoolInner> beginUpdateAsync(String resourceGroupName, + String sessionPoolName, SessionPoolUpdatableProperties sessionPoolEnvelope) { + Mono>> mono + = updateWithResponseAsync(resourceGroupName, sessionPoolName, sessionPoolEnvelope); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + SessionPoolInner.class, SessionPoolInner.class, this.client.getContext()); + } + + /** + * Update properties of a session pool + * + * Patches a session pool using JSON merge patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param sessionPoolEnvelope Properties used to create a session pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of container App session pool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SessionPoolInner> beginUpdateAsync(String resourceGroupName, + String sessionPoolName, SessionPoolUpdatableProperties sessionPoolEnvelope, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = updateWithResponseAsync(resourceGroupName, sessionPoolName, sessionPoolEnvelope, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + SessionPoolInner.class, SessionPoolInner.class, context); + } + + /** + * Update properties of a session pool + * + * Patches a session pool using JSON merge patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param sessionPoolEnvelope Properties used to create a session pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of container App session pool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SessionPoolInner> beginUpdate(String resourceGroupName, + String sessionPoolName, SessionPoolUpdatableProperties sessionPoolEnvelope) { + return this.beginUpdateAsync(resourceGroupName, sessionPoolName, sessionPoolEnvelope).getSyncPoller(); + } + + /** + * Update properties of a session pool + * + * Patches a session pool using JSON merge patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param sessionPoolEnvelope Properties used to create a session pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of container App session pool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SessionPoolInner> beginUpdate(String resourceGroupName, + String sessionPoolName, SessionPoolUpdatableProperties sessionPoolEnvelope, Context context) { + return this.beginUpdateAsync(resourceGroupName, sessionPoolName, sessionPoolEnvelope, context).getSyncPoller(); + } + + /** + * Update properties of a session pool + * + * Patches a session pool using JSON merge patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param sessionPoolEnvelope Properties used to create a session pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App session pool on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String sessionPoolName, + SessionPoolUpdatableProperties sessionPoolEnvelope) { + return beginUpdateAsync(resourceGroupName, sessionPoolName, sessionPoolEnvelope).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update properties of a session pool + * + * Patches a session pool using JSON merge patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param sessionPoolEnvelope Properties used to create a session pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App session pool on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String sessionPoolName, + SessionPoolUpdatableProperties sessionPoolEnvelope, Context context) { + return beginUpdateAsync(resourceGroupName, sessionPoolName, sessionPoolEnvelope, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update properties of a session pool + * + * Patches a session pool using JSON merge patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param sessionPoolEnvelope Properties used to create a session pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App session pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SessionPoolInner update(String resourceGroupName, String sessionPoolName, + SessionPoolUpdatableProperties sessionPoolEnvelope) { + return updateAsync(resourceGroupName, sessionPoolName, sessionPoolEnvelope).block(); + } + + /** + * Update properties of a session pool + * + * Patches a session pool using JSON merge patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param sessionPoolEnvelope Properties used to create a session pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App session pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SessionPoolInner update(String resourceGroupName, String sessionPoolName, + SessionPoolUpdatableProperties sessionPoolEnvelope, Context context) { + return updateAsync(resourceGroupName, sessionPoolName, sessionPoolEnvelope, context).block(); + } + + /** + * Delete a session pool. + * + * Delete the session pool with the given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown 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 sessionPoolName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sessionPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sessionPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, sessionPoolName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a session pool. + * + * Delete the session pool with the given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown 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 sessionPoolName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sessionPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sessionPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + sessionPoolName, this.client.getApiVersion(), accept, context); + } + + /** + * Delete a session pool. + * + * Delete the session pool with the given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is 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 sessionPoolName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, sessionPoolName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a session pool. + * + * Delete the session pool with the given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is 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 sessionPoolName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, sessionPoolName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a session pool. + * + * Delete the session pool with the given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked 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 sessionPoolName) { + return this.beginDeleteAsync(resourceGroupName, sessionPoolName).getSyncPoller(); + } + + /** + * Delete a session pool. + * + * Delete the session pool with the given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked 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 sessionPoolName, + Context context) { + return this.beginDeleteAsync(resourceGroupName, sessionPoolName, context).getSyncPoller(); + } + + /** + * Delete a session pool. + * + * Delete the session pool with the given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException 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 sessionPoolName) { + return beginDeleteAsync(resourceGroupName, sessionPoolName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a session pool. + * + * Delete the session pool with the given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException 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 sessionPoolName, Context context) { + return beginDeleteAsync(resourceGroupName, sessionPoolName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a session pool. + * + * Delete the session pool with the given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if 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 sessionPoolName) { + deleteAsync(resourceGroupName, sessionPoolName).block(); + } + + /** + * Delete a session pool. + * + * Delete the session pool with the given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if 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 sessionPoolName, Context context) { + deleteAsync(resourceGroupName, sessionPoolName, 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 DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return session pool collection Azure resource 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 DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return session pool collection Azure resource 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 DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return session pool collection Azure resource 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 DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return session pool collection Azure resource 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/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsSessionPoolsImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsSessionPoolsImpl.java new file mode 100644 index 000000000000..d2d3a49315af --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsSessionPoolsImpl.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.appcontainers.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.appcontainers.fluent.ContainerAppsSessionPoolsClient; +import com.azure.resourcemanager.appcontainers.fluent.models.SessionPoolInner; +import com.azure.resourcemanager.appcontainers.models.ContainerAppsSessionPools; +import com.azure.resourcemanager.appcontainers.models.SessionPool; + +public final class ContainerAppsSessionPoolsImpl implements ContainerAppsSessionPools { + private static final ClientLogger LOGGER = new ClientLogger(ContainerAppsSessionPoolsImpl.class); + + private final ContainerAppsSessionPoolsClient innerClient; + + private final com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager; + + public ContainerAppsSessionPoolsImpl(ContainerAppsSessionPoolsClient innerClient, + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SessionPoolImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SessionPoolImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SessionPoolImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SessionPoolImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String sessionPoolName, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, sessionPoolName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SessionPoolImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SessionPool getByResourceGroup(String resourceGroupName, String sessionPoolName) { + SessionPoolInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, sessionPoolName); + if (inner != null) { + return new SessionPoolImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String sessionPoolName) { + this.serviceClient().delete(resourceGroupName, sessionPoolName); + } + + public void delete(String resourceGroupName, String sessionPoolName, Context context) { + this.serviceClient().delete(resourceGroupName, sessionPoolName, context); + } + + public SessionPool 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 sessionPoolName = ResourceManagerUtils.getValueFromIdByName(id, "sessionPools"); + if (sessionPoolName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sessionPools'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, sessionPoolName, 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 sessionPoolName = ResourceManagerUtils.getValueFromIdByName(id, "sessionPools"); + if (sessionPoolName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sessionPools'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, sessionPoolName, 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 sessionPoolName = ResourceManagerUtils.getValueFromIdByName(id, "sessionPools"); + if (sessionPoolName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sessionPools'.", id))); + } + this.delete(resourceGroupName, sessionPoolName, 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 sessionPoolName = ResourceManagerUtils.getValueFromIdByName(id, "sessionPools"); + if (sessionPoolName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sessionPools'.", id))); + } + this.delete(resourceGroupName, sessionPoolName, context); + } + + private ContainerAppsSessionPoolsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager() { + return this.serviceManager; + } + + public SessionPoolImpl define(String name) { + return new SessionPoolImpl(name, this.manager()); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsSourceControlsClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsSourceControlsClientImpl.java index f2afb95f6217..d3602c2f77aa 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsSourceControlsClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsSourceControlsClientImpl.java @@ -584,8 +584,10 @@ public SyncPoller, SourceControlInner> beginCreat @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, SourceControlInner> beginCreateOrUpdate(String resourceGroupName, String containerAppName, String sourceControlName, SourceControlInner sourceControlEnvelope, Context context) { - return this.beginCreateOrUpdateAsync(resourceGroupName, containerAppName, sourceControlName, - sourceControlEnvelope, context).getSyncPoller(); + return this + .beginCreateOrUpdateAsync(resourceGroupName, containerAppName, sourceControlName, sourceControlEnvelope, + context) + .getSyncPoller(); } /** @@ -604,7 +606,8 @@ public SyncPoller, SourceControlInner> beginCreat private Mono createOrUpdateAsync(String resourceGroupName, String containerAppName, String sourceControlName, SourceControlInner sourceControlEnvelope) { return beginCreateOrUpdateAsync(resourceGroupName, containerAppName, sourceControlName, sourceControlEnvelope) - .last().flatMap(this.client::getLroFinalResultOrError); + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -895,9 +898,7 @@ public void delete(String resourceGroupName, String containerAppName, String sou /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -925,9 +926,7 @@ private Mono> listByContainerAppNextSinglePage /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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 DefaultErrorResponseErrorException thrown if the request is rejected by server. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprComponentImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprComponentImpl.java index d460f9e1331a..011522485f37 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprComponentImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprComponentImpl.java @@ -119,16 +119,20 @@ public DaprComponentImpl withExistingConnectedEnvironment(String resourceGroupNa } public DaprComponent create() { - this.innerObject - = serviceManager.serviceClient().getConnectedEnvironmentsDaprComponents().createOrUpdateWithResponse( - resourceGroupName, connectedEnvironmentName, componentName, this.innerModel(), Context.NONE).getValue(); + this.innerObject = serviceManager.serviceClient() + .getConnectedEnvironmentsDaprComponents() + .createOrUpdateWithResponse(resourceGroupName, connectedEnvironmentName, componentName, this.innerModel(), + Context.NONE) + .getValue(); return this; } public DaprComponent create(Context context) { - this.innerObject - = serviceManager.serviceClient().getConnectedEnvironmentsDaprComponents().createOrUpdateWithResponse( - resourceGroupName, connectedEnvironmentName, componentName, this.innerModel(), context).getValue(); + this.innerObject = serviceManager.serviceClient() + .getConnectedEnvironmentsDaprComponents() + .createOrUpdateWithResponse(resourceGroupName, connectedEnvironmentName, componentName, this.innerModel(), + context) + .getValue(); return this; } @@ -143,16 +147,20 @@ public DaprComponentImpl update() { } public DaprComponent apply() { - this.innerObject - = serviceManager.serviceClient().getConnectedEnvironmentsDaprComponents().createOrUpdateWithResponse( - resourceGroupName, connectedEnvironmentName, componentName, this.innerModel(), Context.NONE).getValue(); + this.innerObject = serviceManager.serviceClient() + .getConnectedEnvironmentsDaprComponents() + .createOrUpdateWithResponse(resourceGroupName, connectedEnvironmentName, componentName, this.innerModel(), + Context.NONE) + .getValue(); return this; } public DaprComponent apply(Context context) { - this.innerObject - = serviceManager.serviceClient().getConnectedEnvironmentsDaprComponents().createOrUpdateWithResponse( - resourceGroupName, connectedEnvironmentName, componentName, this.innerModel(), context).getValue(); + this.innerObject = serviceManager.serviceClient() + .getConnectedEnvironmentsDaprComponents() + .createOrUpdateWithResponse(resourceGroupName, connectedEnvironmentName, componentName, this.innerModel(), + context) + .getValue(); return this; } @@ -167,25 +175,29 @@ public DaprComponent apply(Context context) { } public DaprComponent refresh() { - this.innerObject = serviceManager.serviceClient().getConnectedEnvironmentsDaprComponents() - .getWithResponse(resourceGroupName, connectedEnvironmentName, componentName, Context.NONE).getValue(); + this.innerObject = serviceManager.serviceClient() + .getConnectedEnvironmentsDaprComponents() + .getWithResponse(resourceGroupName, connectedEnvironmentName, componentName, Context.NONE) + .getValue(); return this; } public DaprComponent refresh(Context context) { - this.innerObject = serviceManager.serviceClient().getConnectedEnvironmentsDaprComponents() - .getWithResponse(resourceGroupName, connectedEnvironmentName, componentName, context).getValue(); + this.innerObject = serviceManager.serviceClient() + .getConnectedEnvironmentsDaprComponents() + .getWithResponse(resourceGroupName, connectedEnvironmentName, componentName, context) + .getValue(); return this; } public Response listSecretsWithResponse(Context context) { - return serviceManager.connectedEnvironmentsDaprComponents().listSecretsWithResponse(resourceGroupName, - connectedEnvironmentName, componentName, context); + return serviceManager.connectedEnvironmentsDaprComponents() + .listSecretsWithResponse(resourceGroupName, connectedEnvironmentName, componentName, context); } public DaprSecretsCollection listSecrets() { - return serviceManager.connectedEnvironmentsDaprComponents().listSecrets(resourceGroupName, - connectedEnvironmentName, componentName); + return serviceManager.connectedEnvironmentsDaprComponents() + .listSecrets(resourceGroupName, connectedEnvironmentName, componentName); } public DaprComponentImpl withComponentType(String componentType) { diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprComponentResiliencyPoliciesClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprComponentResiliencyPoliciesClientImpl.java index fbda276a308c..24a68f487a40 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprComponentResiliencyPoliciesClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprComponentResiliencyPoliciesClientImpl.java @@ -755,9 +755,7 @@ public void delete(String resourceGroupName, String environmentName, String comp /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -783,9 +781,7 @@ private Mono> listNextSinglePa /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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 DefaultErrorResponseErrorException thrown if the request is rejected by server. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprComponentResiliencyPoliciesImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprComponentResiliencyPoliciesImpl.java index 03620b7c4656..112e635dd578 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprComponentResiliencyPoliciesImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprComponentResiliencyPoliciesImpl.java @@ -68,8 +68,8 @@ public DaprComponentResiliencyPolicy get(String resourceGroupName, String enviro public Response deleteWithResponse(String resourceGroupName, String environmentName, String componentName, String name, Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, environmentName, componentName, name, - context); + return this.serviceClient() + .deleteWithResponse(resourceGroupName, environmentName, componentName, name, context); } public void delete(String resourceGroupName, String environmentName, String componentName, String name) { diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprComponentResiliencyPolicyImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprComponentResiliencyPolicyImpl.java index cbf400cbf242..0e62331b7cff 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprComponentResiliencyPolicyImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprComponentResiliencyPolicyImpl.java @@ -69,16 +69,20 @@ public DaprComponentResiliencyPolicyImpl withExistingDaprComponent(String resour } public DaprComponentResiliencyPolicy create() { - this.innerObject - = serviceManager.serviceClient().getDaprComponentResiliencyPolicies().createOrUpdateWithResponse( - resourceGroupName, environmentName, componentName, name, this.innerModel(), Context.NONE).getValue(); + this.innerObject = serviceManager.serviceClient() + .getDaprComponentResiliencyPolicies() + .createOrUpdateWithResponse(resourceGroupName, environmentName, componentName, name, this.innerModel(), + Context.NONE) + .getValue(); return this; } public DaprComponentResiliencyPolicy create(Context context) { - this.innerObject - = serviceManager.serviceClient().getDaprComponentResiliencyPolicies().createOrUpdateWithResponse( - resourceGroupName, environmentName, componentName, name, this.innerModel(), context).getValue(); + this.innerObject = serviceManager.serviceClient() + .getDaprComponentResiliencyPolicies() + .createOrUpdateWithResponse(resourceGroupName, environmentName, componentName, name, this.innerModel(), + context) + .getValue(); return this; } @@ -94,16 +98,20 @@ public DaprComponentResiliencyPolicyImpl update() { } public DaprComponentResiliencyPolicy apply() { - this.innerObject - = serviceManager.serviceClient().getDaprComponentResiliencyPolicies().createOrUpdateWithResponse( - resourceGroupName, environmentName, componentName, name, this.innerModel(), Context.NONE).getValue(); + this.innerObject = serviceManager.serviceClient() + .getDaprComponentResiliencyPolicies() + .createOrUpdateWithResponse(resourceGroupName, environmentName, componentName, name, this.innerModel(), + Context.NONE) + .getValue(); return this; } public DaprComponentResiliencyPolicy apply(Context context) { - this.innerObject - = serviceManager.serviceClient().getDaprComponentResiliencyPolicies().createOrUpdateWithResponse( - resourceGroupName, environmentName, componentName, name, this.innerModel(), context).getValue(); + this.innerObject = serviceManager.serviceClient() + .getDaprComponentResiliencyPolicies() + .createOrUpdateWithResponse(resourceGroupName, environmentName, componentName, name, this.innerModel(), + context) + .getValue(); return this; } @@ -118,14 +126,18 @@ public DaprComponentResiliencyPolicy apply(Context context) { } public DaprComponentResiliencyPolicy refresh() { - this.innerObject = serviceManager.serviceClient().getDaprComponentResiliencyPolicies() - .getWithResponse(resourceGroupName, environmentName, componentName, name, Context.NONE).getValue(); + this.innerObject = serviceManager.serviceClient() + .getDaprComponentResiliencyPolicies() + .getWithResponse(resourceGroupName, environmentName, componentName, name, Context.NONE) + .getValue(); return this; } public DaprComponentResiliencyPolicy refresh(Context context) { - this.innerObject = serviceManager.serviceClient().getDaprComponentResiliencyPolicies() - .getWithResponse(resourceGroupName, environmentName, componentName, name, context).getValue(); + this.innerObject = serviceManager.serviceClient() + .getDaprComponentResiliencyPolicies() + .getWithResponse(resourceGroupName, environmentName, componentName, name, context) + .getValue(); return this; } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprComponentsClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprComponentsClientImpl.java index 0a9d6b7f9547..84cdaec379e0 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprComponentsClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprComponentsClientImpl.java @@ -843,9 +843,7 @@ public DaprSecretsCollectionInner listSecrets(String resourceGroupName, String e /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -870,9 +868,7 @@ private Mono> listNextSinglePageAsync(String n /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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 DefaultErrorResponseErrorException thrown if the request is rejected by server. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprComponentsImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprComponentsImpl.java index 1e94a6c8e32f..e08035e86f85 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprComponentsImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprComponentsImpl.java @@ -63,8 +63,9 @@ public DaprComponent get(String resourceGroupName, String environmentName, Strin public Response createOrUpdateWithResponse(String resourceGroupName, String environmentName, String componentName, DaprComponentInner daprComponentEnvelope, Context context) { - Response inner = this.serviceClient().createOrUpdateWithResponse(resourceGroupName, - environmentName, componentName, daprComponentEnvelope, context); + Response inner = this.serviceClient() + .createOrUpdateWithResponse(resourceGroupName, environmentName, componentName, daprComponentEnvelope, + context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new DaprComponentImpl(inner.getValue(), this.manager())); @@ -75,8 +76,8 @@ public Response createOrUpdateWithResponse(String resourceGroupNa public DaprComponent createOrUpdate(String resourceGroupName, String environmentName, String componentName, DaprComponentInner daprComponentEnvelope) { - DaprComponentInner inner = this.serviceClient().createOrUpdate(resourceGroupName, environmentName, - componentName, daprComponentEnvelope); + DaprComponentInner inner = this.serviceClient() + .createOrUpdate(resourceGroupName, environmentName, componentName, daprComponentEnvelope); if (inner != null) { return new DaprComponentImpl(inner, this.manager()); } else { diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprSubscriptionImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprSubscriptionImpl.java index b503f52d86b1..daee523a614a 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprSubscriptionImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprSubscriptionImpl.java @@ -99,14 +99,16 @@ public DaprSubscriptionImpl withExistingManagedEnvironment(String resourceGroupN } public DaprSubscription create() { - this.innerObject = serviceManager.serviceClient().getDaprSubscriptions() + this.innerObject = serviceManager.serviceClient() + .getDaprSubscriptions() .createOrUpdateWithResponse(resourceGroupName, environmentName, name, this.innerModel(), Context.NONE) .getValue(); return this; } public DaprSubscription create(Context context) { - this.innerObject = serviceManager.serviceClient().getDaprSubscriptions() + this.innerObject = serviceManager.serviceClient() + .getDaprSubscriptions() .createOrUpdateWithResponse(resourceGroupName, environmentName, name, this.innerModel(), context) .getValue(); return this; @@ -123,14 +125,16 @@ public DaprSubscriptionImpl update() { } public DaprSubscription apply() { - this.innerObject = serviceManager.serviceClient().getDaprSubscriptions() + this.innerObject = serviceManager.serviceClient() + .getDaprSubscriptions() .createOrUpdateWithResponse(resourceGroupName, environmentName, name, this.innerModel(), Context.NONE) .getValue(); return this; } public DaprSubscription apply(Context context) { - this.innerObject = serviceManager.serviceClient().getDaprSubscriptions() + this.innerObject = serviceManager.serviceClient() + .getDaprSubscriptions() .createOrUpdateWithResponse(resourceGroupName, environmentName, name, this.innerModel(), context) .getValue(); return this; @@ -146,14 +150,18 @@ public DaprSubscription apply(Context context) { } public DaprSubscription refresh() { - this.innerObject = serviceManager.serviceClient().getDaprSubscriptions() - .getWithResponse(resourceGroupName, environmentName, name, Context.NONE).getValue(); + this.innerObject = serviceManager.serviceClient() + .getDaprSubscriptions() + .getWithResponse(resourceGroupName, environmentName, name, Context.NONE) + .getValue(); return this; } public DaprSubscription refresh(Context context) { - this.innerObject = serviceManager.serviceClient().getDaprSubscriptions() - .getWithResponse(resourceGroupName, environmentName, name, context).getValue(); + this.innerObject = serviceManager.serviceClient() + .getDaprSubscriptions() + .getWithResponse(resourceGroupName, environmentName, name, context) + .getValue(); return this; } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprSubscriptionsClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprSubscriptionsClientImpl.java index d56c8586a2b9..9971195dff6e 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprSubscriptionsClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprSubscriptionsClientImpl.java @@ -697,9 +697,7 @@ public void delete(String resourceGroupName, String environmentName, String name /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -725,9 +723,7 @@ private Mono> listNextSinglePageAsync(Strin /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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 DefaultErrorResponseErrorException thrown if the request is rejected by server. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DotNetComponentImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DotNetComponentImpl.java index c575a5b205e3..f6049ff1496b 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DotNetComponentImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DotNetComponentImpl.java @@ -87,14 +87,16 @@ public DotNetComponentImpl withExistingManagedEnvironment(String resourceGroupNa } public DotNetComponent create() { - this.innerObject = serviceManager.serviceClient().getDotNetComponents().createOrUpdate(resourceGroupName, - environmentName, name, this.innerModel(), Context.NONE); + this.innerObject = serviceManager.serviceClient() + .getDotNetComponents() + .createOrUpdate(resourceGroupName, environmentName, name, this.innerModel(), Context.NONE); return this; } public DotNetComponent create(Context context) { - this.innerObject = serviceManager.serviceClient().getDotNetComponents().createOrUpdate(resourceGroupName, - environmentName, name, this.innerModel(), context); + this.innerObject = serviceManager.serviceClient() + .getDotNetComponents() + .createOrUpdate(resourceGroupName, environmentName, name, this.innerModel(), context); return this; } @@ -109,14 +111,16 @@ public DotNetComponentImpl update() { } public DotNetComponent apply() { - this.innerObject = serviceManager.serviceClient().getDotNetComponents().update(resourceGroupName, - environmentName, name, this.innerModel(), Context.NONE); + this.innerObject = serviceManager.serviceClient() + .getDotNetComponents() + .update(resourceGroupName, environmentName, name, this.innerModel(), Context.NONE); return this; } public DotNetComponent apply(Context context) { - this.innerObject = serviceManager.serviceClient().getDotNetComponents().update(resourceGroupName, - environmentName, name, this.innerModel(), context); + this.innerObject = serviceManager.serviceClient() + .getDotNetComponents() + .update(resourceGroupName, environmentName, name, this.innerModel(), context); return this; } @@ -130,14 +134,18 @@ public DotNetComponent apply(Context context) { } public DotNetComponent refresh() { - this.innerObject = serviceManager.serviceClient().getDotNetComponents() - .getWithResponse(resourceGroupName, environmentName, name, Context.NONE).getValue(); + this.innerObject = serviceManager.serviceClient() + .getDotNetComponents() + .getWithResponse(resourceGroupName, environmentName, name, Context.NONE) + .getValue(); return this; } public DotNetComponent refresh(Context context) { - this.innerObject = serviceManager.serviceClient().getDotNetComponents() - .getWithResponse(resourceGroupName, environmentName, name, context).getValue(); + this.innerObject = serviceManager.serviceClient() + .getDotNetComponents() + .getWithResponse(resourceGroupName, environmentName, name, context) + .getValue(); return this; } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DotNetComponentsClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DotNetComponentsClientImpl.java index 33b02f2c79cf..4b764f94ed6c 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DotNetComponentsClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DotNetComponentsClientImpl.java @@ -641,7 +641,8 @@ private Mono createOrUpdateAsync(String resourceGroupName, private Mono createOrUpdateAsync(String resourceGroupName, String environmentName, String name, DotNetComponentInner dotNetComponentEnvelope, Context context) { return beginCreateOrUpdateAsync(resourceGroupName, environmentName, name, dotNetComponentEnvelope, context) - .last().flatMap(this.client::getLroFinalResultOrError); + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1184,9 +1185,7 @@ public void delete(String resourceGroupName, String environmentName, String name /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. @@ -1211,9 +1210,7 @@ private Mono> listNextSinglePageAsync(String /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/FunctionsExtensionsClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/FunctionsExtensionsClientImpl.java new file mode 100644 index 000000000000..5843c01b5c77 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/FunctionsExtensionsClientImpl.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.appcontainers.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.appcontainers.fluent.FunctionsExtensionsClient; +import com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in FunctionsExtensionsClient. + */ +public final class FunctionsExtensionsClientImpl implements FunctionsExtensionsClient { + /** + * The proxy service used to perform REST calls. + */ + private final FunctionsExtensionsService service; + + /** + * The service client containing this operation class. + */ + private final ContainerAppsApiClientImpl client; + + /** + * Initializes an instance of FunctionsExtensionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + FunctionsExtensionsClientImpl(ContainerAppsApiClientImpl client) { + this.service = RestProxy.create(FunctionsExtensionsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerAppsApiClientFunctionsExtensions to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerAppsApiClie") + public interface FunctionsExtensionsService { + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/revisions/{revisionName}/providers/Microsoft.App/functions/{functionAppName}/invoke") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> invokeFunctionsHost(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, @PathParam("revisionName") String revisionName, + @PathParam("functionAppName") String functionAppName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Proxies a Functions host call to the function app backed by the container app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param revisionName Name of the Container App Revision, the parent resource. + * @param functionAppName Name of the Function App, the extension resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> invokeFunctionsHostWithResponseAsync(String resourceGroupName, + String containerAppName, String revisionName, String functionAppName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (revisionName == null) { + return Mono.error(new IllegalArgumentException("Parameter revisionName is required and cannot be null.")); + } + if (functionAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter functionAppName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.invokeFunctionsHost(this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, revisionName, functionAppName, + this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Proxies a Functions host call to the function app backed by the container app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param revisionName Name of the Container App Revision, the parent resource. + * @param functionAppName Name of the Function App, the extension resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> invokeFunctionsHostWithResponseAsync(String resourceGroupName, + String containerAppName, String revisionName, String functionAppName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (revisionName == null) { + return Mono.error(new IllegalArgumentException("Parameter revisionName is required and cannot be null.")); + } + if (functionAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter functionAppName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.invokeFunctionsHost(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, containerAppName, revisionName, functionAppName, this.client.getApiVersion(), accept, + context); + } + + /** + * Proxies a Functions host call to the function app backed by the container app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param revisionName Name of the Container App Revision, the parent resource. + * @param functionAppName Name of the Function App, the extension resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono invokeFunctionsHostAsync(String resourceGroupName, String containerAppName, + String revisionName, String functionAppName) { + return invokeFunctionsHostWithResponseAsync(resourceGroupName, containerAppName, revisionName, functionAppName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Proxies a Functions host call to the function app backed by the container app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param revisionName Name of the Container App Revision, the parent resource. + * @param functionAppName Name of the Function App, the extension resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response invokeFunctionsHostWithResponse(String resourceGroupName, String containerAppName, + String revisionName, String functionAppName, Context context) { + return invokeFunctionsHostWithResponseAsync(resourceGroupName, containerAppName, revisionName, functionAppName, + context).block(); + } + + /** + * Proxies a Functions host call to the function app backed by the container app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param revisionName Name of the Container App Revision, the parent resource. + * @param functionAppName Name of the Function App, the extension resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public String invokeFunctionsHost(String resourceGroupName, String containerAppName, String revisionName, + String functionAppName) { + return invokeFunctionsHostWithResponse(resourceGroupName, containerAppName, revisionName, functionAppName, + Context.NONE).getValue(); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/FunctionsExtensionsImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/FunctionsExtensionsImpl.java new file mode 100644 index 000000000000..8db782ad9313 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/FunctionsExtensionsImpl.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.appcontainers.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appcontainers.fluent.FunctionsExtensionsClient; +import com.azure.resourcemanager.appcontainers.models.FunctionsExtensions; + +public final class FunctionsExtensionsImpl implements FunctionsExtensions { + private static final ClientLogger LOGGER = new ClientLogger(FunctionsExtensionsImpl.class); + + private final FunctionsExtensionsClient innerClient; + + private final com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager; + + public FunctionsExtensionsImpl(FunctionsExtensionsClient innerClient, + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response invokeFunctionsHostWithResponse(String resourceGroupName, String containerAppName, + String revisionName, String functionAppName, Context context) { + return this.serviceClient() + .invokeFunctionsHostWithResponse(resourceGroupName, containerAppName, revisionName, functionAppName, + context); + } + + public String invokeFunctionsHost(String resourceGroupName, String containerAppName, String revisionName, + String functionAppName) { + return this.serviceClient() + .invokeFunctionsHost(resourceGroupName, containerAppName, revisionName, functionAppName); + } + + private FunctionsExtensionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JavaComponentImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JavaComponentImpl.java index 66398fe94215..e061b5f4d088 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JavaComponentImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JavaComponentImpl.java @@ -8,12 +8,7 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.appcontainers.fluent.models.JavaComponentInner; import com.azure.resourcemanager.appcontainers.models.JavaComponent; -import com.azure.resourcemanager.appcontainers.models.JavaComponentConfigurationProperty; -import com.azure.resourcemanager.appcontainers.models.JavaComponentProvisioningState; -import com.azure.resourcemanager.appcontainers.models.JavaComponentServiceBind; -import com.azure.resourcemanager.appcontainers.models.JavaComponentType; -import java.util.Collections; -import java.util.List; +import com.azure.resourcemanager.appcontainers.models.JavaComponentProperties; public final class JavaComponentImpl implements JavaComponent, JavaComponent.Definition, JavaComponent.Update { private JavaComponentInner innerObject; @@ -32,34 +27,12 @@ public String type() { return this.innerModel().type(); } - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public JavaComponentType componentType() { - return this.innerModel().componentType(); - } - - public JavaComponentProvisioningState provisioningState() { - return this.innerModel().provisioningState(); - } - - public List configurations() { - List inner = this.innerModel().configurations(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } + public JavaComponentProperties properties() { + return this.innerModel().properties(); } - public List serviceBinds() { - List inner = this.innerModel().serviceBinds(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } + public SystemData systemData() { + return this.innerModel().systemData(); } public String resourceGroupName() { @@ -87,14 +60,16 @@ public JavaComponentImpl withExistingManagedEnvironment(String resourceGroupName } public JavaComponent create() { - this.innerObject = serviceManager.serviceClient().getJavaComponents().createOrUpdate(resourceGroupName, - environmentName, name, this.innerModel(), Context.NONE); + this.innerObject = serviceManager.serviceClient() + .getJavaComponents() + .createOrUpdate(resourceGroupName, environmentName, name, this.innerModel(), Context.NONE); return this; } public JavaComponent create(Context context) { - this.innerObject = serviceManager.serviceClient().getJavaComponents().createOrUpdate(resourceGroupName, - environmentName, name, this.innerModel(), context); + this.innerObject = serviceManager.serviceClient() + .getJavaComponents() + .createOrUpdate(resourceGroupName, environmentName, name, this.innerModel(), context); return this; } @@ -109,14 +84,16 @@ public JavaComponentImpl update() { } public JavaComponent apply() { - this.innerObject = serviceManager.serviceClient().getJavaComponents().update(resourceGroupName, environmentName, - name, this.innerModel(), Context.NONE); + this.innerObject = serviceManager.serviceClient() + .getJavaComponents() + .update(resourceGroupName, environmentName, name, this.innerModel(), Context.NONE); return this; } public JavaComponent apply(Context context) { - this.innerObject = serviceManager.serviceClient().getJavaComponents().update(resourceGroupName, environmentName, - name, this.innerModel(), context); + this.innerObject = serviceManager.serviceClient() + .getJavaComponents() + .update(resourceGroupName, environmentName, name, this.innerModel(), context); return this; } @@ -130,29 +107,23 @@ public JavaComponent apply(Context context) { } public JavaComponent refresh() { - this.innerObject = serviceManager.serviceClient().getJavaComponents() - .getWithResponse(resourceGroupName, environmentName, name, Context.NONE).getValue(); + this.innerObject = serviceManager.serviceClient() + .getJavaComponents() + .getWithResponse(resourceGroupName, environmentName, name, Context.NONE) + .getValue(); return this; } public JavaComponent refresh(Context context) { - this.innerObject = serviceManager.serviceClient().getJavaComponents() - .getWithResponse(resourceGroupName, environmentName, name, context).getValue(); - return this; - } - - public JavaComponentImpl withComponentType(JavaComponentType componentType) { - this.innerModel().withComponentType(componentType); - return this; - } - - public JavaComponentImpl withConfigurations(List configurations) { - this.innerModel().withConfigurations(configurations); + this.innerObject = serviceManager.serviceClient() + .getJavaComponents() + .getWithResponse(resourceGroupName, environmentName, name, context) + .getValue(); return this; } - public JavaComponentImpl withServiceBinds(List serviceBinds) { - this.innerModel().withServiceBinds(serviceBinds); + public JavaComponentImpl withProperties(JavaComponentProperties properties) { + this.innerModel().withProperties(properties); return this; } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JavaComponentsClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JavaComponentsClientImpl.java index 60ad7023f66a..9c7add9910d6 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JavaComponentsClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JavaComponentsClientImpl.java @@ -1181,9 +1181,7 @@ public void delete(String resourceGroupName, String environmentName, String name /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. @@ -1208,9 +1206,7 @@ private Mono> listNextSinglePageAsync(String n /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobExecutionImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobExecutionImpl.java index a763cde3740e..48488c9bbf21 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobExecutionImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobExecutionImpl.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.appcontainers.implementation; import com.azure.resourcemanager.appcontainers.fluent.models.JobExecutionInner; +import com.azure.resourcemanager.appcontainers.models.ExecutionStatus; import com.azure.resourcemanager.appcontainers.models.JobExecution; import com.azure.resourcemanager.appcontainers.models.JobExecutionRunningState; import com.azure.resourcemanager.appcontainers.models.JobExecutionTemplate; @@ -49,6 +50,10 @@ public JobExecutionTemplate template() { return this.innerModel().template(); } + public ExecutionStatus detailedStatus() { + return this.innerModel().detailedStatus(); + } + public JobExecutionInner innerModel() { return this.innerObject; } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobImpl.java index 73af308a860d..7cca6a2825b9 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobImpl.java @@ -132,14 +132,16 @@ public JobImpl withExistingResourceGroup(String resourceGroupName) { } public Job create() { - this.innerObject = serviceManager.serviceClient().getJobs().createOrUpdate(resourceGroupName, jobName, - this.innerModel(), Context.NONE); + this.innerObject = serviceManager.serviceClient() + .getJobs() + .createOrUpdate(resourceGroupName, jobName, this.innerModel(), Context.NONE); return this; } public Job create(Context context) { - this.innerObject = serviceManager.serviceClient().getJobs().createOrUpdate(resourceGroupName, jobName, - this.innerModel(), context); + this.innerObject = serviceManager.serviceClient() + .getJobs() + .createOrUpdate(resourceGroupName, jobName, this.innerModel(), context); return this; } @@ -155,8 +157,9 @@ public JobImpl update() { } public Job apply() { - this.innerObject = serviceManager.serviceClient().getJobs().update(resourceGroupName, jobName, - updateJobEnvelope, Context.NONE); + this.innerObject = serviceManager.serviceClient() + .getJobs() + .update(resourceGroupName, jobName, updateJobEnvelope, Context.NONE); return this; } @@ -174,14 +177,18 @@ public Job apply(Context context) { } public Job refresh() { - this.innerObject = serviceManager.serviceClient().getJobs() - .getByResourceGroupWithResponse(resourceGroupName, jobName, Context.NONE).getValue(); + this.innerObject = serviceManager.serviceClient() + .getJobs() + .getByResourceGroupWithResponse(resourceGroupName, jobName, Context.NONE) + .getValue(); return this; } public Job refresh(Context context) { - this.innerObject = serviceManager.serviceClient().getJobs() - .getByResourceGroupWithResponse(resourceGroupName, jobName, context).getValue(); + this.innerObject = serviceManager.serviceClient() + .getJobs() + .getByResourceGroupWithResponse(resourceGroupName, jobName, context) + .getValue(); return this; } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobsClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobsClientImpl.java index e8a3e69f1368..5bde6aeadb24 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobsClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobsClientImpl.java @@ -72,8 +72,8 @@ public final class JobsClientImpl implements JobsClient { } /** - * The interface defining all the services for ContainerAppsApiClientJobs to be used by the proxy service to - * perform REST calls. + * The interface defining all the services for ContainerAppsApiClientJobs to be used by the proxy service to perform + * REST calls. */ @Host("{$host}") @ServiceInterface(name = "ContainerAppsApiClie") @@ -200,6 +200,14 @@ Mono> listSecrets(@HostParam("$host") String @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, @PathParam("jobName") String jobName, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> listDetectorsNext( + @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 }) @@ -227,11 +235,11 @@ Mono> listByResourceGroupNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of diagnostics for a Container App Job along with {@link Response} on successful completion of - * {@link Mono}. + * @return the list of diagnostics for a Container App Job along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listDetectorsWithResponseAsync(String resourceGroupName, + private Mono> listDetectorsSinglePageAsync(String resourceGroupName, String jobName) { if (this.client.getEndpoint() == null) { return Mono.error( @@ -252,6 +260,8 @@ private Mono> listDetectorsWithResponseAsyn return FluxUtil .withContext(context -> service.listDetectors(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, jobName, 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())); } @@ -266,12 +276,12 @@ private Mono> listDetectorsWithResponseAsyn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of diagnostics for a Container App Job along with {@link Response} on successful completion of - * {@link Mono}. + * @return the list of diagnostics for a Container App Job along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listDetectorsWithResponseAsync(String resourceGroupName, - String jobName, Context context) { + private Mono> listDetectorsSinglePageAsync(String resourceGroupName, String jobName, + Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -289,8 +299,11 @@ private Mono> listDetectorsWithResponseAsyn } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listDetectors(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - jobName, this.client.getApiVersion(), accept, context); + return service + .listDetectors(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, jobName, + this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** @@ -303,12 +316,12 @@ private Mono> listDetectorsWithResponseAsyn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of diagnostics for a Container App Job on successful completion of {@link Mono}. + * @return the list of diagnostics for a Container App Job as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listDetectorsAsync(String resourceGroupName, String jobName) { - return listDetectorsWithResponseAsync(resourceGroupName, jobName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listDetectorsAsync(String resourceGroupName, String jobName) { + return new PagedFlux<>(() -> listDetectorsSinglePageAsync(resourceGroupName, jobName), + nextLink -> listDetectorsNextSinglePageAsync(nextLink)); } /** @@ -322,12 +335,12 @@ private Mono listDetectorsAsync(String resourceGroup * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of diagnostics for a Container App Job along with {@link Response}. + * @return the list of diagnostics for a Container App Job as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listDetectorsWithResponse(String resourceGroupName, String jobName, - Context context) { - return listDetectorsWithResponseAsync(resourceGroupName, jobName, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listDetectorsAsync(String resourceGroupName, String jobName, Context context) { + return new PagedFlux<>(() -> listDetectorsSinglePageAsync(resourceGroupName, jobName, context), + nextLink -> listDetectorsNextSinglePageAsync(nextLink, context)); } /** @@ -340,11 +353,29 @@ public Response listDetectorsWithResponse(String res * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of diagnostics for a Container App Job. + * @return the list of diagnostics for a Container App Job as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DiagnosticsCollectionInner listDetectors(String resourceGroupName, String jobName) { - return listDetectorsWithResponse(resourceGroupName, jobName, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDetectors(String resourceGroupName, String jobName) { + return new PagedIterable<>(listDetectorsAsync(resourceGroupName, jobName)); + } + + /** + * Get the list of diagnostics for a given Container App Job. + * + * Get the list of diagnostics for a Container App Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Job Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of diagnostics for a Container App Job as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDetectors(String resourceGroupName, String jobName, Context context) { + return new PagedIterable<>(listDetectorsAsync(resourceGroupName, jobName, context)); } /** @@ -2470,9 +2501,61 @@ public JobSecretsCollectionInner listSecrets(String resourceGroupName, String jo /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return diagnostics data collection for a resource along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listDetectorsNextSinglePageAsync(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.listDetectorsNext(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 DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return diagnostics data collection for a resource along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listDetectorsNextSinglePageAsync(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.listDetectorsNext(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. * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -2500,9 +2583,7 @@ private Mono> listBySubscriptionNextSinglePageAsync(Stri /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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 DefaultErrorResponseErrorException thrown if the request is rejected by server. @@ -2529,9 +2610,7 @@ private Mono> listBySubscriptionNextSinglePageAsync(Stri /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -2559,9 +2638,7 @@ private Mono> listByResourceGroupNextSinglePageAsync(Str /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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 DefaultErrorResponseErrorException thrown if the request is rejected by server. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobsExecutionsClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobsExecutionsClientImpl.java index 4712b36b0514..24dc36286952 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobsExecutionsClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobsExecutionsClientImpl.java @@ -250,9 +250,7 @@ public PagedIterable list(String resourceGroupName, String jo /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -278,9 +276,7 @@ private Mono> listNextSinglePageAsync(String ne /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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 DefaultErrorResponseErrorException thrown if the request is rejected by server. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobsImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobsImpl.java index 2ec3b5f9e57f..f4543f7928e6 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobsImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobsImpl.java @@ -11,19 +11,17 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.appcontainers.fluent.JobsClient; import com.azure.resourcemanager.appcontainers.fluent.models.ContainerAppJobExecutionsInner; -import com.azure.resourcemanager.appcontainers.fluent.models.DiagnosticsCollectionInner; import com.azure.resourcemanager.appcontainers.fluent.models.DiagnosticsInner; import com.azure.resourcemanager.appcontainers.fluent.models.JobExecutionBaseInner; import com.azure.resourcemanager.appcontainers.fluent.models.JobInner; import com.azure.resourcemanager.appcontainers.fluent.models.JobSecretsCollectionInner; import com.azure.resourcemanager.appcontainers.models.ContainerAppJobExecutions; import com.azure.resourcemanager.appcontainers.models.Diagnostics; -import com.azure.resourcemanager.appcontainers.models.DiagnosticsCollection; import com.azure.resourcemanager.appcontainers.models.Job; import com.azure.resourcemanager.appcontainers.models.JobExecutionBase; import com.azure.resourcemanager.appcontainers.models.JobExecutionTemplate; -import com.azure.resourcemanager.appcontainers.models.JobSecretsCollection; import com.azure.resourcemanager.appcontainers.models.Jobs; +import com.azure.resourcemanager.appcontainers.models.JobSecretsCollection; public final class JobsImpl implements Jobs { private static final ClientLogger LOGGER = new ClientLogger(JobsImpl.class); @@ -38,25 +36,14 @@ public JobsImpl(JobsClient innerClient, this.serviceManager = serviceManager; } - public Response listDetectorsWithResponse(String resourceGroupName, String jobName, - Context context) { - Response inner - = this.serviceClient().listDetectorsWithResponse(resourceGroupName, jobName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new DiagnosticsCollectionImpl(inner.getValue(), this.manager())); - } else { - return null; - } + public PagedIterable listDetectors(String resourceGroupName, String jobName) { + PagedIterable inner = this.serviceClient().listDetectors(resourceGroupName, jobName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DiagnosticsImpl(inner1, this.manager())); } - public DiagnosticsCollection listDetectors(String resourceGroupName, String jobName) { - DiagnosticsCollectionInner inner = this.serviceClient().listDetectors(resourceGroupName, jobName); - if (inner != null) { - return new DiagnosticsCollectionImpl(inner, this.manager()); - } else { - return null; - } + public PagedIterable listDetectors(String resourceGroupName, String jobName, Context context) { + PagedIterable inner = this.serviceClient().listDetectors(resourceGroupName, jobName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DiagnosticsImpl(inner1, this.manager())); } public Response getDetectorWithResponse(String resourceGroupName, String jobName, String detectorName, diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/LogicAppImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/LogicAppImpl.java new file mode 100644 index 000000000000..101a332d0e4e --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/LogicAppImpl.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.appcontainers.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appcontainers.fluent.models.LogicAppInner; +import com.azure.resourcemanager.appcontainers.models.LogicApp; +import com.azure.resourcemanager.appcontainers.models.WorkflowArtifacts; +import com.azure.resourcemanager.appcontainers.models.WorkflowEnvelope; + +public final class LogicAppImpl implements LogicApp, LogicApp.Definition, LogicApp.Update { + private LogicAppInner innerObject; + + private final com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public Object properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public LogicAppInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String containerAppName; + + private String logicAppName; + + public LogicAppImpl withExistingContainerApp(String resourceGroupName, String containerAppName) { + this.resourceGroupName = resourceGroupName; + this.containerAppName = containerAppName; + return this; + } + + public LogicApp create() { + this.innerObject = serviceManager.serviceClient() + .getLogicApps() + .createOrUpdateWithResponse(resourceGroupName, containerAppName, logicAppName, this.innerModel(), + Context.NONE) + .getValue(); + return this; + } + + public LogicApp create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getLogicApps() + .createOrUpdateWithResponse(resourceGroupName, containerAppName, logicAppName, this.innerModel(), context) + .getValue(); + return this; + } + + LogicAppImpl(String name, com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerObject = new LogicAppInner(); + this.serviceManager = serviceManager; + this.logicAppName = name; + } + + public LogicAppImpl update() { + return this; + } + + public LogicApp apply() { + this.innerObject = serviceManager.serviceClient() + .getLogicApps() + .createOrUpdateWithResponse(resourceGroupName, containerAppName, logicAppName, this.innerModel(), + Context.NONE) + .getValue(); + return this; + } + + public LogicApp apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getLogicApps() + .createOrUpdateWithResponse(resourceGroupName, containerAppName, logicAppName, this.innerModel(), context) + .getValue(); + return this; + } + + LogicAppImpl(LogicAppInner innerObject, + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.containerAppName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "containerApps"); + this.logicAppName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "logicApps"); + } + + public LogicApp refresh() { + this.innerObject = serviceManager.serviceClient() + .getLogicApps() + .getWithResponse(resourceGroupName, containerAppName, logicAppName, Context.NONE) + .getValue(); + return this; + } + + public LogicApp refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getLogicApps() + .getWithResponse(resourceGroupName, containerAppName, logicAppName, context) + .getValue(); + return this; + } + + public Response deployWorkflowArtifactsWithResponse(WorkflowArtifacts workflowArtifacts, Context context) { + return serviceManager.logicApps() + .deployWorkflowArtifactsWithResponse(resourceGroupName, containerAppName, logicAppName, workflowArtifacts, + context); + } + + public void deployWorkflowArtifacts() { + serviceManager.logicApps().deployWorkflowArtifacts(resourceGroupName, containerAppName, logicAppName); + } + + public Response listWorkflowsConnectionsWithResponse(Context context) { + return serviceManager.logicApps() + .listWorkflowsConnectionsWithResponse(resourceGroupName, containerAppName, logicAppName, context); + } + + public WorkflowEnvelope listWorkflowsConnections() { + return serviceManager.logicApps().listWorkflowsConnections(resourceGroupName, containerAppName, logicAppName); + } + + public LogicAppImpl withProperties(Object properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/LogicAppsClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/LogicAppsClientImpl.java new file mode 100644 index 000000000000..8c6c8f39a707 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/LogicAppsClientImpl.java @@ -0,0 +1,1386 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.appcontainers.fluent.LogicAppsClient; +import com.azure.resourcemanager.appcontainers.fluent.models.LogicAppInner; +import com.azure.resourcemanager.appcontainers.fluent.models.WorkflowEnvelopeInner; +import com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException; +import com.azure.resourcemanager.appcontainers.models.LogicAppsProxyMethod; +import com.azure.resourcemanager.appcontainers.models.WorkflowArtifacts; +import com.azure.resourcemanager.appcontainers.models.WorkflowEnvelopeCollection; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in LogicAppsClient. + */ +public final class LogicAppsClientImpl implements LogicAppsClient { + /** + * The proxy service used to perform REST calls. + */ + private final LogicAppsService service; + + /** + * The service client containing this operation class. + */ + private final ContainerAppsApiClientImpl client; + + /** + * Initializes an instance of LogicAppsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LogicAppsClientImpl(ContainerAppsApiClientImpl client) { + this.service + = RestProxy.create(LogicAppsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerAppsApiClientLogicApps to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerAppsApiClie") + public interface LogicAppsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, @PathParam("logicAppName") String logicAppName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, @PathParam("logicAppName") String logicAppName, + @QueryParam("api-version") String apiVersion, @BodyParam("application/json") LogicAppInner resource, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> delete(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, @PathParam("logicAppName") String logicAppName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName}/workflows") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> listWorkflows(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, @PathParam("logicAppName") String logicAppName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName}/workflows/{workflowName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> getWorkflow(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, @PathParam("logicAppName") String logicAppName, + @PathParam("workflowName") String workflowName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName}/deployWorkflowArtifacts") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> deployWorkflowArtifacts(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, @PathParam("logicAppName") String logicAppName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") WorkflowArtifacts workflowArtifacts, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName}/listWorkflowsConnections") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> listWorkflowsConnections(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, @PathParam("logicAppName") String logicAppName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName}/invoke") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> invoke(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, @PathParam("logicAppName") String logicAppName, + @HeaderParam("x-ms-logicApps-proxy-path") String xMsLogicAppsProxyPath, + @HeaderParam("x-ms-logicApps-proxy-method") LogicAppsProxyMethod xMsLogicAppsProxyMethod, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> listWorkflowsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets a logic app extension resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a logic app extension resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String containerAppName, + String logicAppName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (logicAppName == null) { + return Mono.error(new IllegalArgumentException("Parameter logicAppName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, containerAppName, logicAppName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a logic app extension resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a logic app extension resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String containerAppName, + String logicAppName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (logicAppName == null) { + return Mono.error(new IllegalArgumentException("Parameter logicAppName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + containerAppName, logicAppName, this.client.getApiVersion(), accept, context); + } + + /** + * Gets a logic app extension resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a logic app extension resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String containerAppName, String logicAppName) { + return getWithResponseAsync(resourceGroupName, containerAppName, logicAppName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a logic app extension resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a logic app extension resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String containerAppName, + String logicAppName, Context context) { + return getWithResponseAsync(resourceGroupName, containerAppName, logicAppName, context).block(); + } + + /** + * Gets a logic app extension resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a logic app extension resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LogicAppInner get(String resourceGroupName, String containerAppName, String logicAppName) { + return getWithResponse(resourceGroupName, containerAppName, logicAppName, Context.NONE).getValue(); + } + + /** + * Create or update a Logic App extension resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param resource Logic app resource properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a logic app extension resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String containerAppName, String logicAppName, LogicAppInner 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 (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (logicAppName == null) { + return Mono.error(new IllegalArgumentException("Parameter logicAppName 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.getSubscriptionId(), + resourceGroupName, containerAppName, logicAppName, this.client.getApiVersion(), resource, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a Logic App extension resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param resource Logic app resource properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a logic app extension resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String containerAppName, String logicAppName, LogicAppInner 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 (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (logicAppName == null) { + return Mono.error(new IllegalArgumentException("Parameter logicAppName 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.getSubscriptionId(), resourceGroupName, + containerAppName, logicAppName, this.client.getApiVersion(), resource, accept, context); + } + + /** + * Create or update a Logic App extension resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param resource Logic app resource properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a logic app extension resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String containerAppName, + String logicAppName, LogicAppInner resource) { + return createOrUpdateWithResponseAsync(resourceGroupName, containerAppName, logicAppName, resource) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Create or update a Logic App extension resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param resource Logic app resource properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a logic app extension resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String resourceGroupName, String containerAppName, + String logicAppName, LogicAppInner resource, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, containerAppName, logicAppName, resource, context) + .block(); + } + + /** + * Create or update a Logic App extension resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param resource Logic app resource properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a logic app extension resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LogicAppInner createOrUpdate(String resourceGroupName, String containerAppName, String logicAppName, + LogicAppInner resource) { + return createOrUpdateWithResponse(resourceGroupName, containerAppName, logicAppName, resource, Context.NONE) + .getValue(); + } + + /** + * Deletes a Logic App extension resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown 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 containerAppName, + String logicAppName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (logicAppName == null) { + return Mono.error(new IllegalArgumentException("Parameter logicAppName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, containerAppName, logicAppName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a Logic App extension resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown 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 containerAppName, + String logicAppName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (logicAppName == null) { + return Mono.error(new IllegalArgumentException("Parameter logicAppName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + containerAppName, logicAppName, this.client.getApiVersion(), accept, context); + } + + /** + * Deletes a Logic App extension resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException 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 containerAppName, String logicAppName) { + return deleteWithResponseAsync(resourceGroupName, containerAppName, logicAppName) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Deletes a Logic App extension resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String containerAppName, String logicAppName, + Context context) { + return deleteWithResponseAsync(resourceGroupName, containerAppName, logicAppName, context).block(); + } + + /** + * Deletes a Logic App extension resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if 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 containerAppName, String logicAppName) { + deleteWithResponse(resourceGroupName, containerAppName, logicAppName, Context.NONE); + } + + /** + * List the workflows for a logic app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of workflow information elements along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWorkflowsSinglePageAsync(String resourceGroupName, + String containerAppName, String logicAppName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (logicAppName == null) { + return Mono.error(new IllegalArgumentException("Parameter logicAppName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listWorkflows(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, containerAppName, logicAppName, 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 workflows for a logic app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of workflow information elements along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWorkflowsSinglePageAsync(String resourceGroupName, + String containerAppName, String logicAppName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (logicAppName == null) { + return Mono.error(new IllegalArgumentException("Parameter logicAppName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listWorkflows(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + containerAppName, logicAppName, this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List the workflows for a logic app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of workflow information elements as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listWorkflowsAsync(String resourceGroupName, String containerAppName, + String logicAppName) { + return new PagedFlux<>(() -> listWorkflowsSinglePageAsync(resourceGroupName, containerAppName, logicAppName), + nextLink -> listWorkflowsNextSinglePageAsync(nextLink)); + } + + /** + * List the workflows for a logic app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of workflow information elements as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listWorkflowsAsync(String resourceGroupName, String containerAppName, + String logicAppName, Context context) { + return new PagedFlux<>( + () -> listWorkflowsSinglePageAsync(resourceGroupName, containerAppName, logicAppName, context), + nextLink -> listWorkflowsNextSinglePageAsync(nextLink, context)); + } + + /** + * List the workflows for a logic app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of workflow information elements as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listWorkflows(String resourceGroupName, String containerAppName, + String logicAppName) { + return new PagedIterable<>(listWorkflowsAsync(resourceGroupName, containerAppName, logicAppName)); + } + + /** + * List the workflows for a logic app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of workflow information elements as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listWorkflows(String resourceGroupName, String containerAppName, + String logicAppName, Context context) { + return new PagedIterable<>(listWorkflowsAsync(resourceGroupName, containerAppName, logicAppName, context)); + } + + /** + * Get workflow information by its name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param workflowName Workflow name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workflow information by its name along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWorkflowWithResponseAsync(String resourceGroupName, + String containerAppName, String logicAppName, String workflowName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (logicAppName == null) { + return Mono.error(new IllegalArgumentException("Parameter logicAppName is required and cannot be null.")); + } + if (workflowName == null) { + return Mono.error(new IllegalArgumentException("Parameter workflowName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getWorkflow(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, containerAppName, logicAppName, workflowName, this.client.getApiVersion(), accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get workflow information by its name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param workflowName Workflow name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workflow information by its name along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWorkflowWithResponseAsync(String resourceGroupName, + String containerAppName, String logicAppName, String workflowName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (logicAppName == null) { + return Mono.error(new IllegalArgumentException("Parameter logicAppName is required and cannot be null.")); + } + if (workflowName == null) { + return Mono.error(new IllegalArgumentException("Parameter workflowName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getWorkflow(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + containerAppName, logicAppName, workflowName, this.client.getApiVersion(), accept, context); + } + + /** + * Get workflow information by its name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param workflowName Workflow name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workflow information by its name on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWorkflowAsync(String resourceGroupName, String containerAppName, + String logicAppName, String workflowName) { + return getWorkflowWithResponseAsync(resourceGroupName, containerAppName, logicAppName, workflowName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get workflow information by its name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param workflowName Workflow name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workflow information by its name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWorkflowWithResponse(String resourceGroupName, String containerAppName, + String logicAppName, String workflowName, Context context) { + return getWorkflowWithResponseAsync(resourceGroupName, containerAppName, logicAppName, workflowName, context) + .block(); + } + + /** + * Get workflow information by its name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param workflowName Workflow name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workflow information by its name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkflowEnvelopeInner getWorkflow(String resourceGroupName, String containerAppName, String logicAppName, + String workflowName) { + return getWorkflowWithResponse(resourceGroupName, containerAppName, logicAppName, workflowName, Context.NONE) + .getValue(); + } + + /** + * Creates or updates the artifacts for the logic app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param workflowArtifacts Application settings and files of the workflow. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown 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> deployWorkflowArtifactsWithResponseAsync(String resourceGroupName, + String containerAppName, String logicAppName, WorkflowArtifacts workflowArtifacts) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (logicAppName == null) { + return Mono.error(new IllegalArgumentException("Parameter logicAppName is required and cannot be null.")); + } + if (workflowArtifacts != null) { + workflowArtifacts.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.deployWorkflowArtifacts(this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, logicAppName, + this.client.getApiVersion(), workflowArtifacts, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates the artifacts for the logic app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param workflowArtifacts Application settings and files of the workflow. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown 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> deployWorkflowArtifactsWithResponseAsync(String resourceGroupName, + String containerAppName, String logicAppName, WorkflowArtifacts workflowArtifacts, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (logicAppName == null) { + return Mono.error(new IllegalArgumentException("Parameter logicAppName is required and cannot be null.")); + } + if (workflowArtifacts != null) { + workflowArtifacts.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.deployWorkflowArtifacts(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, containerAppName, logicAppName, this.client.getApiVersion(), workflowArtifacts, accept, + context); + } + + /** + * Creates or updates the artifacts for the logic app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException 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 deployWorkflowArtifactsAsync(String resourceGroupName, String containerAppName, + String logicAppName) { + final WorkflowArtifacts workflowArtifacts = null; + return deployWorkflowArtifactsWithResponseAsync(resourceGroupName, containerAppName, logicAppName, + workflowArtifacts).flatMap(ignored -> Mono.empty()); + } + + /** + * Creates or updates the artifacts for the logic app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param workflowArtifacts Application settings and files of the workflow. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deployWorkflowArtifactsWithResponse(String resourceGroupName, String containerAppName, + String logicAppName, WorkflowArtifacts workflowArtifacts, Context context) { + return deployWorkflowArtifactsWithResponseAsync(resourceGroupName, containerAppName, logicAppName, + workflowArtifacts, context).block(); + } + + /** + * Creates or updates the artifacts for the logic app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if 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 deployWorkflowArtifacts(String resourceGroupName, String containerAppName, String logicAppName) { + final WorkflowArtifacts workflowArtifacts = null; + deployWorkflowArtifactsWithResponse(resourceGroupName, containerAppName, logicAppName, workflowArtifacts, + Context.NONE); + } + + /** + * Gets logic app's connections. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return logic app's connections along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWorkflowsConnectionsWithResponseAsync(String resourceGroupName, + String containerAppName, String logicAppName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (logicAppName == null) { + return Mono.error(new IllegalArgumentException("Parameter logicAppName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listWorkflowsConnections(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, containerAppName, logicAppName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets logic app's connections. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return logic app's connections along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWorkflowsConnectionsWithResponseAsync(String resourceGroupName, + String containerAppName, String logicAppName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (logicAppName == null) { + return Mono.error(new IllegalArgumentException("Parameter logicAppName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listWorkflowsConnections(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, containerAppName, logicAppName, this.client.getApiVersion(), accept, context); + } + + /** + * Gets logic app's connections. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return logic app's connections on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listWorkflowsConnectionsAsync(String resourceGroupName, String containerAppName, + String logicAppName) { + return listWorkflowsConnectionsWithResponseAsync(resourceGroupName, containerAppName, logicAppName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets logic app's connections. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return logic app's connections along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWorkflowsConnectionsWithResponse(String resourceGroupName, + String containerAppName, String logicAppName, Context context) { + return listWorkflowsConnectionsWithResponseAsync(resourceGroupName, containerAppName, logicAppName, context) + .block(); + } + + /** + * Gets logic app's connections. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return logic app's connections. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkflowEnvelopeInner listWorkflowsConnections(String resourceGroupName, String containerAppName, + String logicAppName) { + return listWorkflowsConnectionsWithResponse(resourceGroupName, containerAppName, logicAppName, Context.NONE) + .getValue(); + } + + /** + * Proxies a the API call to the logic app backed by the container app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the LogicApp App, the extension resource. + * @param xMsLogicAppsProxyPath The proxy path for the API call. + * @param xMsLogicAppsProxyMethod The proxy method for the API call. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> invokeWithResponseAsync(String resourceGroupName, String containerAppName, + String logicAppName, String xMsLogicAppsProxyPath, LogicAppsProxyMethod xMsLogicAppsProxyMethod) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (logicAppName == null) { + return Mono.error(new IllegalArgumentException("Parameter logicAppName is required and cannot be null.")); + } + if (xMsLogicAppsProxyPath == null) { + return Mono + .error(new IllegalArgumentException("Parameter xMsLogicAppsProxyPath is required and cannot be null.")); + } + if (xMsLogicAppsProxyMethod == null) { + return Mono.error( + new IllegalArgumentException("Parameter xMsLogicAppsProxyMethod is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.invoke(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, containerAppName, logicAppName, xMsLogicAppsProxyPath, xMsLogicAppsProxyMethod, + this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Proxies a the API call to the logic app backed by the container app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the LogicApp App, the extension resource. + * @param xMsLogicAppsProxyPath The proxy path for the API call. + * @param xMsLogicAppsProxyMethod The proxy method for the API call. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> invokeWithResponseAsync(String resourceGroupName, String containerAppName, + String logicAppName, String xMsLogicAppsProxyPath, LogicAppsProxyMethod xMsLogicAppsProxyMethod, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (logicAppName == null) { + return Mono.error(new IllegalArgumentException("Parameter logicAppName is required and cannot be null.")); + } + if (xMsLogicAppsProxyPath == null) { + return Mono + .error(new IllegalArgumentException("Parameter xMsLogicAppsProxyPath is required and cannot be null.")); + } + if (xMsLogicAppsProxyMethod == null) { + return Mono.error( + new IllegalArgumentException("Parameter xMsLogicAppsProxyMethod is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.invoke(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + containerAppName, logicAppName, xMsLogicAppsProxyPath, xMsLogicAppsProxyMethod, this.client.getApiVersion(), + accept, context); + } + + /** + * Proxies a the API call to the logic app backed by the container app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the LogicApp App, the extension resource. + * @param xMsLogicAppsProxyPath The proxy path for the API call. + * @param xMsLogicAppsProxyMethod The proxy method for the API call. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono invokeAsync(String resourceGroupName, String containerAppName, String logicAppName, + String xMsLogicAppsProxyPath, LogicAppsProxyMethod xMsLogicAppsProxyMethod) { + return invokeWithResponseAsync(resourceGroupName, containerAppName, logicAppName, xMsLogicAppsProxyPath, + xMsLogicAppsProxyMethod).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Proxies a the API call to the logic app backed by the container app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the LogicApp App, the extension resource. + * @param xMsLogicAppsProxyPath The proxy path for the API call. + * @param xMsLogicAppsProxyMethod The proxy method for the API call. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response invokeWithResponse(String resourceGroupName, String containerAppName, String logicAppName, + String xMsLogicAppsProxyPath, LogicAppsProxyMethod xMsLogicAppsProxyMethod, Context context) { + return invokeWithResponseAsync(resourceGroupName, containerAppName, logicAppName, xMsLogicAppsProxyPath, + xMsLogicAppsProxyMethod, context).block(); + } + + /** + * Proxies a the API call to the logic app backed by the container app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the LogicApp App, the extension resource. + * @param xMsLogicAppsProxyPath The proxy path for the API call. + * @param xMsLogicAppsProxyMethod The proxy method for the API call. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Object invoke(String resourceGroupName, String containerAppName, String logicAppName, + String xMsLogicAppsProxyPath, LogicAppsProxyMethod xMsLogicAppsProxyMethod) { + return invokeWithResponse(resourceGroupName, containerAppName, logicAppName, xMsLogicAppsProxyPath, + xMsLogicAppsProxyMethod, Context.NONE).getValue(); + } + + /** + * 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 DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of workflow information elements along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWorkflowsNextSinglePageAsync(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.listWorkflowsNext(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 DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of workflow information elements along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWorkflowsNextSinglePageAsync(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.listWorkflowsNext(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/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/LogicAppsImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/LogicAppsImpl.java new file mode 100644 index 000000000000..80699ff512c1 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/LogicAppsImpl.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.appcontainers.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.appcontainers.fluent.LogicAppsClient; +import com.azure.resourcemanager.appcontainers.fluent.models.LogicAppInner; +import com.azure.resourcemanager.appcontainers.fluent.models.WorkflowEnvelopeInner; +import com.azure.resourcemanager.appcontainers.models.LogicApp; +import com.azure.resourcemanager.appcontainers.models.LogicApps; +import com.azure.resourcemanager.appcontainers.models.LogicAppsProxyMethod; +import com.azure.resourcemanager.appcontainers.models.WorkflowArtifacts; +import com.azure.resourcemanager.appcontainers.models.WorkflowEnvelope; + +public final class LogicAppsImpl implements LogicApps { + private static final ClientLogger LOGGER = new ClientLogger(LogicAppsImpl.class); + + private final LogicAppsClient innerClient; + + private final com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager; + + public LogicAppsImpl(LogicAppsClient innerClient, + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String containerAppName, String logicAppName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, containerAppName, logicAppName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new LogicAppImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public LogicApp get(String resourceGroupName, String containerAppName, String logicAppName) { + LogicAppInner inner = this.serviceClient().get(resourceGroupName, containerAppName, logicAppName); + if (inner != null) { + return new LogicAppImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteWithResponse(String resourceGroupName, String containerAppName, String logicAppName, + Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, containerAppName, logicAppName, context); + } + + public void delete(String resourceGroupName, String containerAppName, String logicAppName) { + this.serviceClient().delete(resourceGroupName, containerAppName, logicAppName); + } + + public PagedIterable listWorkflows(String resourceGroupName, String containerAppName, + String logicAppName) { + PagedIterable inner + = this.serviceClient().listWorkflows(resourceGroupName, containerAppName, logicAppName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new WorkflowEnvelopeImpl(inner1, this.manager())); + } + + public PagedIterable listWorkflows(String resourceGroupName, String containerAppName, + String logicAppName, Context context) { + PagedIterable inner + = this.serviceClient().listWorkflows(resourceGroupName, containerAppName, logicAppName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new WorkflowEnvelopeImpl(inner1, this.manager())); + } + + public Response getWorkflowWithResponse(String resourceGroupName, String containerAppName, + String logicAppName, String workflowName, Context context) { + Response inner = this.serviceClient() + .getWorkflowWithResponse(resourceGroupName, containerAppName, logicAppName, workflowName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new WorkflowEnvelopeImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public WorkflowEnvelope getWorkflow(String resourceGroupName, String containerAppName, String logicAppName, + String workflowName) { + WorkflowEnvelopeInner inner + = this.serviceClient().getWorkflow(resourceGroupName, containerAppName, logicAppName, workflowName); + if (inner != null) { + return new WorkflowEnvelopeImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deployWorkflowArtifactsWithResponse(String resourceGroupName, String containerAppName, + String logicAppName, WorkflowArtifacts workflowArtifacts, Context context) { + return this.serviceClient() + .deployWorkflowArtifactsWithResponse(resourceGroupName, containerAppName, logicAppName, workflowArtifacts, + context); + } + + public void deployWorkflowArtifacts(String resourceGroupName, String containerAppName, String logicAppName) { + this.serviceClient().deployWorkflowArtifacts(resourceGroupName, containerAppName, logicAppName); + } + + public Response listWorkflowsConnectionsWithResponse(String resourceGroupName, + String containerAppName, String logicAppName, Context context) { + Response inner = this.serviceClient() + .listWorkflowsConnectionsWithResponse(resourceGroupName, containerAppName, logicAppName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new WorkflowEnvelopeImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public WorkflowEnvelope listWorkflowsConnections(String resourceGroupName, String containerAppName, + String logicAppName) { + WorkflowEnvelopeInner inner + = this.serviceClient().listWorkflowsConnections(resourceGroupName, containerAppName, logicAppName); + if (inner != null) { + return new WorkflowEnvelopeImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response invokeWithResponse(String resourceGroupName, String containerAppName, String logicAppName, + String xMsLogicAppsProxyPath, LogicAppsProxyMethod xMsLogicAppsProxyMethod, Context context) { + return this.serviceClient() + .invokeWithResponse(resourceGroupName, containerAppName, logicAppName, xMsLogicAppsProxyPath, + xMsLogicAppsProxyMethod, context); + } + + public Object invoke(String resourceGroupName, String containerAppName, String logicAppName, + String xMsLogicAppsProxyPath, LogicAppsProxyMethod xMsLogicAppsProxyMethod) { + return this.serviceClient() + .invoke(resourceGroupName, containerAppName, logicAppName, xMsLogicAppsProxyPath, xMsLogicAppsProxyMethod); + } + + public LogicApp 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 containerAppName = ResourceManagerUtils.getValueFromIdByName(id, "containerApps"); + if (containerAppName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'containerApps'.", id))); + } + String logicAppName = ResourceManagerUtils.getValueFromIdByName(id, "logicApps"); + if (logicAppName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'logicApps'.", id))); + } + return this.getWithResponse(resourceGroupName, containerAppName, logicAppName, 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 containerAppName = ResourceManagerUtils.getValueFromIdByName(id, "containerApps"); + if (containerAppName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'containerApps'.", id))); + } + String logicAppName = ResourceManagerUtils.getValueFromIdByName(id, "logicApps"); + if (logicAppName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'logicApps'.", id))); + } + return this.getWithResponse(resourceGroupName, containerAppName, logicAppName, 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 containerAppName = ResourceManagerUtils.getValueFromIdByName(id, "containerApps"); + if (containerAppName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'containerApps'.", id))); + } + String logicAppName = ResourceManagerUtils.getValueFromIdByName(id, "logicApps"); + if (logicAppName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'logicApps'.", id))); + } + this.deleteWithResponse(resourceGroupName, containerAppName, logicAppName, Context.NONE); + } + + public Response 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 containerAppName = ResourceManagerUtils.getValueFromIdByName(id, "containerApps"); + if (containerAppName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'containerApps'.", id))); + } + String logicAppName = ResourceManagerUtils.getValueFromIdByName(id, "logicApps"); + if (logicAppName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'logicApps'.", id))); + } + return this.deleteWithResponse(resourceGroupName, containerAppName, logicAppName, context); + } + + private LogicAppsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager() { + return this.serviceManager; + } + + public LogicAppImpl define(String name) { + return new LogicAppImpl(name, this.manager()); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedCertificateImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedCertificateImpl.java index 56dda0044379..4c9c56e75a7f 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedCertificateImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedCertificateImpl.java @@ -88,14 +88,17 @@ public ManagedCertificateImpl withExistingManagedEnvironment(String resourceGrou } public ManagedCertificate create() { - this.innerObject = serviceManager.serviceClient().getManagedCertificates().createOrUpdate(resourceGroupName, - environmentName, managedCertificateName, this.innerModel(), Context.NONE); + this.innerObject = serviceManager.serviceClient() + .getManagedCertificates() + .createOrUpdate(resourceGroupName, environmentName, managedCertificateName, this.innerModel(), + Context.NONE); return this; } public ManagedCertificate create(Context context) { - this.innerObject = serviceManager.serviceClient().getManagedCertificates().createOrUpdate(resourceGroupName, - environmentName, managedCertificateName, this.innerModel(), context); + this.innerObject = serviceManager.serviceClient() + .getManagedCertificates() + .createOrUpdate(resourceGroupName, environmentName, managedCertificateName, this.innerModel(), context); return this; } @@ -112,14 +115,20 @@ public ManagedCertificateImpl update() { } public ManagedCertificate apply() { - this.innerObject = serviceManager.serviceClient().getManagedCertificates().updateWithResponse(resourceGroupName, - environmentName, managedCertificateName, updateManagedCertificateEnvelope, Context.NONE).getValue(); + this.innerObject = serviceManager.serviceClient() + .getManagedCertificates() + .updateWithResponse(resourceGroupName, environmentName, managedCertificateName, + updateManagedCertificateEnvelope, Context.NONE) + .getValue(); return this; } public ManagedCertificate apply(Context context) { - this.innerObject = serviceManager.serviceClient().getManagedCertificates().updateWithResponse(resourceGroupName, - environmentName, managedCertificateName, updateManagedCertificateEnvelope, context).getValue(); + this.innerObject = serviceManager.serviceClient() + .getManagedCertificates() + .updateWithResponse(resourceGroupName, environmentName, managedCertificateName, + updateManagedCertificateEnvelope, context) + .getValue(); return this; } @@ -134,14 +143,18 @@ public ManagedCertificate apply(Context context) { } public ManagedCertificate refresh() { - this.innerObject = serviceManager.serviceClient().getManagedCertificates() - .getWithResponse(resourceGroupName, environmentName, managedCertificateName, Context.NONE).getValue(); + this.innerObject = serviceManager.serviceClient() + .getManagedCertificates() + .getWithResponse(resourceGroupName, environmentName, managedCertificateName, Context.NONE) + .getValue(); return this; } public ManagedCertificate refresh(Context context) { - this.innerObject = serviceManager.serviceClient().getManagedCertificates() - .getWithResponse(resourceGroupName, environmentName, managedCertificateName, context).getValue(); + this.innerObject = serviceManager.serviceClient() + .getManagedCertificates() + .getWithResponse(resourceGroupName, environmentName, managedCertificateName, context) + .getValue(); return this; } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedCertificatesClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedCertificatesClientImpl.java index 2f82424fccd4..9a50cf3da9a3 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedCertificatesClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedCertificatesClientImpl.java @@ -466,8 +466,10 @@ private PollerFlux, ManagedCertificateInner> public SyncPoller, ManagedCertificateInner> beginCreateOrUpdate(String resourceGroupName, String environmentName, String managedCertificateName) { final ManagedCertificateInner managedCertificateEnvelope = null; - return this.beginCreateOrUpdateAsync(resourceGroupName, environmentName, managedCertificateName, - managedCertificateEnvelope).getSyncPoller(); + return this + .beginCreateOrUpdateAsync(resourceGroupName, environmentName, managedCertificateName, + managedCertificateEnvelope) + .getSyncPoller(); } /** @@ -489,8 +491,10 @@ private PollerFlux, ManagedCertificateInner> public SyncPoller, ManagedCertificateInner> beginCreateOrUpdate( String resourceGroupName, String environmentName, String managedCertificateName, ManagedCertificateInner managedCertificateEnvelope, Context context) { - return this.beginCreateOrUpdateAsync(resourceGroupName, environmentName, managedCertificateName, - managedCertificateEnvelope, context).getSyncPoller(); + return this + .beginCreateOrUpdateAsync(resourceGroupName, environmentName, managedCertificateName, + managedCertificateEnvelope, context) + .getSyncPoller(); } /** @@ -1050,9 +1054,7 @@ public PagedIterable list(String resourceGroupName, Str /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1078,9 +1080,7 @@ private Mono> listNextSinglePageAsync(Str /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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 DefaultErrorResponseErrorException thrown if the request is rejected by server. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedCertificatesImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedCertificatesImpl.java index cfdb8c2361cc..3f5344d87c4d 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedCertificatesImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedCertificatesImpl.java @@ -51,8 +51,8 @@ public ManagedCertificate get(String resourceGroupName, String environmentName, public Response deleteWithResponse(String resourceGroupName, String environmentName, String managedCertificateName, Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, environmentName, managedCertificateName, - context); + return this.serviceClient() + .deleteWithResponse(resourceGroupName, environmentName, managedCertificateName, context); } public void delete(String resourceGroupName, String environmentName, String managedCertificateName) { diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentDiagnosticsClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentDiagnosticsClientImpl.java index f0b8491e223a..5205db636ec4 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentDiagnosticsClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentDiagnosticsClientImpl.java @@ -52,8 +52,8 @@ public final class ManagedEnvironmentDiagnosticsClientImpl implements ManagedEnv } /** - * The interface defining all the services for ContainerAppsApiClientManagedEnvironmentDiagnostics to be used by - * the proxy service to perform REST calls. + * The interface defining all the services for ContainerAppsApiClientManagedEnvironmentDiagnostics to be used by the + * proxy service to perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "ContainerAppsApiClie") diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentImpl.java index 9a5213f6b0bf..ac1df30cdd61 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentImpl.java @@ -9,6 +9,7 @@ import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.appcontainers.fluent.models.ManagedEnvironmentInner; +import com.azure.resourcemanager.appcontainers.fluent.models.PrivateEndpointConnectionInner; import com.azure.resourcemanager.appcontainers.models.AppInsightsConfiguration; import com.azure.resourcemanager.appcontainers.models.AppLogsConfiguration; import com.azure.resourcemanager.appcontainers.models.CustomDomainConfiguration; @@ -18,13 +19,17 @@ import com.azure.resourcemanager.appcontainers.models.KedaConfiguration; import com.azure.resourcemanager.appcontainers.models.ManagedEnvironment; import com.azure.resourcemanager.appcontainers.models.ManagedEnvironmentPropertiesPeerAuthentication; +import com.azure.resourcemanager.appcontainers.models.ManagedEnvironmentPropertiesPeerTrafficConfiguration; import com.azure.resourcemanager.appcontainers.models.ManagedServiceIdentity; import com.azure.resourcemanager.appcontainers.models.OpenTelemetryConfiguration; +import com.azure.resourcemanager.appcontainers.models.PrivateEndpointConnection; +import com.azure.resourcemanager.appcontainers.models.PublicNetworkAccess; import com.azure.resourcemanager.appcontainers.models.VnetConfiguration; import com.azure.resourcemanager.appcontainers.models.WorkloadProfile; import java.util.Collections; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; public final class ManagedEnvironmentImpl implements ManagedEnvironment, ManagedEnvironment.Definition, ManagedEnvironment.Update { @@ -146,6 +151,25 @@ public ManagedEnvironmentPropertiesPeerAuthentication peerAuthentication() { return this.innerModel().peerAuthentication(); } + public ManagedEnvironmentPropertiesPeerTrafficConfiguration peerTrafficConfiguration() { + return this.innerModel().peerTrafficConfiguration(); + } + + public List privateEndpointConnections() { + List inner = this.innerModel().privateEndpointConnections(); + if (inner != null) { + return Collections.unmodifiableList(inner.stream() + .map(inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public PublicNetworkAccess publicNetworkAccess() { + return this.innerModel().publicNetworkAccess(); + } + public Region region() { return Region.fromName(this.regionName()); } @@ -176,14 +200,16 @@ public ManagedEnvironmentImpl withExistingResourceGroup(String resourceGroupName } public ManagedEnvironment create() { - this.innerObject = serviceManager.serviceClient().getManagedEnvironments().createOrUpdate(resourceGroupName, - environmentName, this.innerModel(), Context.NONE); + this.innerObject = serviceManager.serviceClient() + .getManagedEnvironments() + .createOrUpdate(resourceGroupName, environmentName, this.innerModel(), Context.NONE); return this; } public ManagedEnvironment create(Context context) { - this.innerObject = serviceManager.serviceClient().getManagedEnvironments().createOrUpdate(resourceGroupName, - environmentName, this.innerModel(), context); + this.innerObject = serviceManager.serviceClient() + .getManagedEnvironments() + .createOrUpdate(resourceGroupName, environmentName, this.innerModel(), context); return this; } @@ -199,14 +225,16 @@ public ManagedEnvironmentImpl update() { } public ManagedEnvironment apply() { - this.innerObject = serviceManager.serviceClient().getManagedEnvironments().update(resourceGroupName, - environmentName, this.innerModel(), Context.NONE); + this.innerObject = serviceManager.serviceClient() + .getManagedEnvironments() + .update(resourceGroupName, environmentName, this.innerModel(), Context.NONE); return this; } public ManagedEnvironment apply(Context context) { - this.innerObject = serviceManager.serviceClient().getManagedEnvironments().update(resourceGroupName, - environmentName, this.innerModel(), context); + this.innerObject = serviceManager.serviceClient() + .getManagedEnvironments() + .update(resourceGroupName, environmentName, this.innerModel(), context); return this; } @@ -219,20 +247,24 @@ public ManagedEnvironment apply(Context context) { } public ManagedEnvironment refresh() { - this.innerObject = serviceManager.serviceClient().getManagedEnvironments() - .getByResourceGroupWithResponse(resourceGroupName, environmentName, Context.NONE).getValue(); + this.innerObject = serviceManager.serviceClient() + .getManagedEnvironments() + .getByResourceGroupWithResponse(resourceGroupName, environmentName, Context.NONE) + .getValue(); return this; } public ManagedEnvironment refresh(Context context) { - this.innerObject = serviceManager.serviceClient().getManagedEnvironments() - .getByResourceGroupWithResponse(resourceGroupName, environmentName, context).getValue(); + this.innerObject = serviceManager.serviceClient() + .getManagedEnvironments() + .getByResourceGroupWithResponse(resourceGroupName, environmentName, context) + .getValue(); return this; } public Response getAuthTokenWithResponse(Context context) { - return serviceManager.managedEnvironments().getAuthTokenWithResponse(resourceGroupName, environmentName, - context); + return serviceManager.managedEnvironments() + .getAuthTokenWithResponse(resourceGroupName, environmentName, context); } public EnvironmentAuthToken getAuthToken() { @@ -330,4 +362,15 @@ public ManagedEnvironmentImpl withInfrastructureResourceGroup(String infrastruct this.innerModel().withPeerAuthentication(peerAuthentication); return this; } + + public ManagedEnvironmentImpl + withPeerTrafficConfiguration(ManagedEnvironmentPropertiesPeerTrafficConfiguration peerTrafficConfiguration) { + this.innerModel().withPeerTrafficConfiguration(peerTrafficConfiguration); + return this; + } + + public ManagedEnvironmentImpl withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + this.innerModel().withPublicNetworkAccess(publicNetworkAccess); + return this; + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentPrivateEndpointConnectionsClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentPrivateEndpointConnectionsClientImpl.java new file mode 100644 index 000000000000..fda1c378f6b1 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentPrivateEndpointConnectionsClientImpl.java @@ -0,0 +1,1000 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.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.appcontainers.fluent.ManagedEnvironmentPrivateEndpointConnectionsClient; +import com.azure.resourcemanager.appcontainers.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.appcontainers.models.PrivateEndpointConnectionListResult; +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 + * ManagedEnvironmentPrivateEndpointConnectionsClient. + */ +public final class ManagedEnvironmentPrivateEndpointConnectionsClientImpl + implements ManagedEnvironmentPrivateEndpointConnectionsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ManagedEnvironmentPrivateEndpointConnectionsService service; + + /** + * The service client containing this operation class. + */ + private final ContainerAppsApiClientImpl client; + + /** + * Initializes an instance of ManagedEnvironmentPrivateEndpointConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ManagedEnvironmentPrivateEndpointConnectionsClientImpl(ContainerAppsApiClientImpl client) { + this.service = RestProxy.create(ManagedEnvironmentPrivateEndpointConnectionsService.class, + client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerAppsApiClientManagedEnvironmentPrivateEndpointConnections to + * be used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerAppsApiClie") + public interface ManagedEnvironmentPrivateEndpointConnectionsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/privateEndpointConnections") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("environmentName") String environmentName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("environmentName") String environmentName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("environmentName") String environmentName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") PrivateEndpointConnectionInner privateEndpointConnectionEnvelope, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("environmentName") String environmentName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @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 private endpoint connections for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connection associated with the specified resource along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String environmentName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, environmentName, 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 private endpoint connections for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connection associated with the specified resource along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String environmentName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, environmentName, + this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List private endpoint connections for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connection associated with the specified resource as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String environmentName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, environmentName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List private endpoint connections for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connection associated with the specified resource as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String environmentName, + Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, environmentName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List private endpoint connections for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connection associated with the specified resource as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String environmentName) { + return new PagedIterable<>(listAsync(resourceGroupName, environmentName)); + } + + /** + * List private endpoint connections for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connection associated with the specified resource as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String environmentName, + Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, environmentName, context)); + } + + /** + * Get a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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 private endpoint connection for a given managed environment along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String environmentName, String privateEndpointConnectionName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + environmentName, privateEndpointConnectionName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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 private endpoint connection for a given managed environment along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String environmentName, String privateEndpointConnectionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + environmentName, privateEndpointConnectionName, this.client.getApiVersion(), accept, context); + } + + /** + * Get a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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 private endpoint connection for a given managed environment on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String environmentName, + String privateEndpointConnectionName) { + return getWithResponseAsync(resourceGroupName, environmentName, privateEndpointConnectionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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 private endpoint connection for a given managed environment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String environmentName, + String privateEndpointConnectionName, Context context) { + return getWithResponseAsync(resourceGroupName, environmentName, privateEndpointConnectionName, context).block(); + } + + /** + * Get a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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 private endpoint connection for a given managed environment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner get(String resourceGroupName, String environmentName, + String privateEndpointConnectionName) { + return getWithResponse(resourceGroupName, environmentName, privateEndpointConnectionName, Context.NONE) + .getValue(); + } + + /** + * Update the state of a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param privateEndpointConnectionEnvelope The resource of private endpoint and its properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String environmentName, String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnectionEnvelope) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + if (privateEndpointConnectionEnvelope == null) { + return Mono.error(new IllegalArgumentException( + "Parameter privateEndpointConnectionEnvelope is required and cannot be null.")); + } else { + privateEndpointConnectionEnvelope.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, environmentName, privateEndpointConnectionName, this.client.getApiVersion(), + privateEndpointConnectionEnvelope, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update the state of a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param privateEndpointConnectionEnvelope The resource of private endpoint and its properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String environmentName, String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnectionEnvelope, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + if (privateEndpointConnectionEnvelope == null) { + return Mono.error(new IllegalArgumentException( + "Parameter privateEndpointConnectionEnvelope is required and cannot be null.")); + } else { + privateEndpointConnectionEnvelope.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + environmentName, privateEndpointConnectionName, this.client.getApiVersion(), + privateEndpointConnectionEnvelope, accept, context); + } + + /** + * Update the state of a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param privateEndpointConnectionEnvelope The resource of private endpoint and its properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PrivateEndpointConnectionInner> + beginCreateOrUpdateAsync(String resourceGroupName, String environmentName, String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnectionEnvelope) { + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, environmentName, + privateEndpointConnectionName, privateEndpointConnectionEnvelope); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), PrivateEndpointConnectionInner.class, PrivateEndpointConnectionInner.class, + this.client.getContext()); + } + + /** + * Update the state of a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param privateEndpointConnectionEnvelope The resource of private endpoint and its properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PrivateEndpointConnectionInner> + beginCreateOrUpdateAsync(String resourceGroupName, String environmentName, String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnectionEnvelope, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, environmentName, + privateEndpointConnectionName, privateEndpointConnectionEnvelope, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), PrivateEndpointConnectionInner.class, PrivateEndpointConnectionInner.class, + context); + } + + /** + * Update the state of a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param privateEndpointConnectionEnvelope The resource of private endpoint and its properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( + String resourceGroupName, String environmentName, String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnectionEnvelope) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, environmentName, privateEndpointConnectionName, + privateEndpointConnectionEnvelope) + .getSyncPoller(); + } + + /** + * Update the state of a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param privateEndpointConnectionEnvelope The resource of private endpoint and its properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( + String resourceGroupName, String environmentName, String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnectionEnvelope, Context context) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, environmentName, privateEndpointConnectionName, + privateEndpointConnectionEnvelope, context) + .getSyncPoller(); + } + + /** + * Update the state of a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param privateEndpointConnectionEnvelope The resource of private endpoint and its properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String environmentName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnectionEnvelope) { + return beginCreateOrUpdateAsync(resourceGroupName, environmentName, privateEndpointConnectionName, + privateEndpointConnectionEnvelope).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update the state of a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param privateEndpointConnectionEnvelope The resource of private endpoint and its properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String environmentName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnectionEnvelope, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, environmentName, privateEndpointConnectionName, + privateEndpointConnectionEnvelope, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update the state of a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param privateEndpointConnectionEnvelope The resource of private endpoint and its properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner createOrUpdate(String resourceGroupName, String environmentName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnectionEnvelope) { + return createOrUpdateAsync(resourceGroupName, environmentName, privateEndpointConnectionName, + privateEndpointConnectionEnvelope).block(); + } + + /** + * Update the state of a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param privateEndpointConnectionEnvelope The resource of private endpoint and its properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner createOrUpdate(String resourceGroupName, String environmentName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnectionEnvelope, + Context context) { + return createOrUpdateAsync(resourceGroupName, environmentName, privateEndpointConnectionName, + privateEndpointConnectionEnvelope, context).block(); + } + + /** + * Delete a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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 resourceGroupName, String environmentName, + String privateEndpointConnectionName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + environmentName, privateEndpointConnectionName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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 resourceGroupName, String environmentName, + String privateEndpointConnectionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + environmentName, privateEndpointConnectionName, this.client.getApiVersion(), accept, context); + } + + /** + * Delete a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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 resourceGroupName, String environmentName, + String privateEndpointConnectionName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, environmentName, privateEndpointConnectionName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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 resourceGroupName, String environmentName, + String privateEndpointConnectionName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, environmentName, privateEndpointConnectionName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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 resourceGroupName, String environmentName, + String privateEndpointConnectionName) { + return this.beginDeleteAsync(resourceGroupName, environmentName, privateEndpointConnectionName).getSyncPoller(); + } + + /** + * Delete a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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 resourceGroupName, String environmentName, + String privateEndpointConnectionName, Context context) { + return this.beginDeleteAsync(resourceGroupName, environmentName, privateEndpointConnectionName, context) + .getSyncPoller(); + } + + /** + * Delete a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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 resourceGroupName, String environmentName, + String privateEndpointConnectionName) { + return beginDeleteAsync(resourceGroupName, environmentName, privateEndpointConnectionName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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 resourceGroupName, String environmentName, + String privateEndpointConnectionName, Context context) { + return beginDeleteAsync(resourceGroupName, environmentName, privateEndpointConnectionName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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 resourceGroupName, String environmentName, String privateEndpointConnectionName) { + deleteAsync(resourceGroupName, environmentName, privateEndpointConnectionName).block(); + } + + /** + * Delete a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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 resourceGroupName, String environmentName, String privateEndpointConnectionName, + Context context) { + deleteAsync(resourceGroupName, environmentName, privateEndpointConnectionName, 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 list of private endpoint connection associated with the specified resource 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 list of private endpoint connection associated with the specified resource 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/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentPrivateEndpointConnectionsImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentPrivateEndpointConnectionsImpl.java new file mode 100644 index 000000000000..225993918b6c --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentPrivateEndpointConnectionsImpl.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.appcontainers.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.appcontainers.fluent.ManagedEnvironmentPrivateEndpointConnectionsClient; +import com.azure.resourcemanager.appcontainers.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.appcontainers.models.ManagedEnvironmentPrivateEndpointConnections; +import com.azure.resourcemanager.appcontainers.models.PrivateEndpointConnection; + +public final class ManagedEnvironmentPrivateEndpointConnectionsImpl + implements ManagedEnvironmentPrivateEndpointConnections { + private static final ClientLogger LOGGER = new ClientLogger(ManagedEnvironmentPrivateEndpointConnectionsImpl.class); + + private final ManagedEnvironmentPrivateEndpointConnectionsClient innerClient; + + private final com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager; + + public ManagedEnvironmentPrivateEndpointConnectionsImpl( + ManagedEnvironmentPrivateEndpointConnectionsClient innerClient, + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String environmentName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, environmentName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String environmentName, + Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, environmentName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String environmentName, + String privateEndpointConnectionName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, environmentName, privateEndpointConnectionName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new PrivateEndpointConnectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PrivateEndpointConnection get(String resourceGroupName, String environmentName, + String privateEndpointConnectionName) { + PrivateEndpointConnectionInner inner + = this.serviceClient().get(resourceGroupName, environmentName, privateEndpointConnectionName); + if (inner != null) { + return new PrivateEndpointConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String environmentName, String privateEndpointConnectionName) { + this.serviceClient().delete(resourceGroupName, environmentName, privateEndpointConnectionName); + } + + public void delete(String resourceGroupName, String environmentName, String privateEndpointConnectionName, + Context context) { + this.serviceClient().delete(resourceGroupName, environmentName, privateEndpointConnectionName, context); + } + + public PrivateEndpointConnection 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 environmentName = ResourceManagerUtils.getValueFromIdByName(id, "managedEnvironments"); + if (environmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managedEnvironments'.", id))); + } + String privateEndpointConnectionName + = ResourceManagerUtils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", id))); + } + return this.getWithResponse(resourceGroupName, environmentName, privateEndpointConnectionName, 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 environmentName = ResourceManagerUtils.getValueFromIdByName(id, "managedEnvironments"); + if (environmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managedEnvironments'.", id))); + } + String privateEndpointConnectionName + = ResourceManagerUtils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", id))); + } + return this.getWithResponse(resourceGroupName, environmentName, privateEndpointConnectionName, 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 environmentName = ResourceManagerUtils.getValueFromIdByName(id, "managedEnvironments"); + if (environmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managedEnvironments'.", id))); + } + String privateEndpointConnectionName + = ResourceManagerUtils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", id))); + } + this.delete(resourceGroupName, environmentName, privateEndpointConnectionName, 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 environmentName = ResourceManagerUtils.getValueFromIdByName(id, "managedEnvironments"); + if (environmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managedEnvironments'.", id))); + } + String privateEndpointConnectionName + = ResourceManagerUtils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", id))); + } + this.delete(resourceGroupName, environmentName, privateEndpointConnectionName, context); + } + + private ManagedEnvironmentPrivateEndpointConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager() { + return this.serviceManager; + } + + public PrivateEndpointConnectionImpl define(String name) { + return new PrivateEndpointConnectionImpl(name, this.manager()); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentPrivateLinkResourcesClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentPrivateLinkResourcesClientImpl.java new file mode 100644 index 000000000000..0c3f4e3e83b2 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentPrivateLinkResourcesClientImpl.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.appcontainers.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.appcontainers.fluent.ManagedEnvironmentPrivateLinkResourcesClient; +import com.azure.resourcemanager.appcontainers.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.appcontainers.models.PrivateLinkResourceListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * ManagedEnvironmentPrivateLinkResourcesClient. + */ +public final class ManagedEnvironmentPrivateLinkResourcesClientImpl + implements ManagedEnvironmentPrivateLinkResourcesClient { + /** + * The proxy service used to perform REST calls. + */ + private final ManagedEnvironmentPrivateLinkResourcesService service; + + /** + * The service client containing this operation class. + */ + private final ContainerAppsApiClientImpl client; + + /** + * Initializes an instance of ManagedEnvironmentPrivateLinkResourcesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ManagedEnvironmentPrivateLinkResourcesClientImpl(ContainerAppsApiClientImpl client) { + this.service = RestProxy.create(ManagedEnvironmentPrivateLinkResourcesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerAppsApiClientManagedEnvironmentPrivateLinkResources to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerAppsApiClie") + public interface ManagedEnvironmentPrivateLinkResourcesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/privateLinkResources") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("environmentName") String environmentName, @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 private link resources for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 private link resources along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String environmentName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, environmentName, 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 private link resources for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 private link resources along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String environmentName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, environmentName, + this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List private link resources for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 private link resources as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String environmentName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, environmentName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List private link resources for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 private link resources as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String environmentName, + Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, environmentName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List private link resources for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 private link resources as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String environmentName) { + return new PagedIterable<>(listAsync(resourceGroupName, environmentName)); + } + + /** + * List private link resources for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 private link resources as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String environmentName, + Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, environmentName, 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 private link resources 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 private link resources 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/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentPrivateLinkResourcesImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentPrivateLinkResourcesImpl.java new file mode 100644 index 000000000000..34a753a0e7d7 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentPrivateLinkResourcesImpl.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.appcontainers.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.appcontainers.fluent.ManagedEnvironmentPrivateLinkResourcesClient; +import com.azure.resourcemanager.appcontainers.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.appcontainers.models.ManagedEnvironmentPrivateLinkResources; +import com.azure.resourcemanager.appcontainers.models.PrivateLinkResource; + +public final class ManagedEnvironmentPrivateLinkResourcesImpl implements ManagedEnvironmentPrivateLinkResources { + private static final ClientLogger LOGGER = new ClientLogger(ManagedEnvironmentPrivateLinkResourcesImpl.class); + + private final ManagedEnvironmentPrivateLinkResourcesClient innerClient; + + private final com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager; + + public ManagedEnvironmentPrivateLinkResourcesImpl(ManagedEnvironmentPrivateLinkResourcesClient innerClient, + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String environmentName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, environmentName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String environmentName, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, environmentName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); + } + + private ManagedEnvironmentPrivateLinkResourcesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentStorageImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentStorageImpl.java index fb765ed16d53..79142fceb10b 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentStorageImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentStorageImpl.java @@ -62,13 +62,17 @@ public ManagedEnvironmentStorageImpl withExistingManagedEnvironment(String resou } public ManagedEnvironmentStorage create() { - this.innerObject = serviceManager.serviceClient().getManagedEnvironmentsStorages().createOrUpdateWithResponse( - resourceGroupName, environmentName, storageName, this.innerModel(), Context.NONE).getValue(); + this.innerObject = serviceManager.serviceClient() + .getManagedEnvironmentsStorages() + .createOrUpdateWithResponse(resourceGroupName, environmentName, storageName, this.innerModel(), + Context.NONE) + .getValue(); return this; } public ManagedEnvironmentStorage create(Context context) { - this.innerObject = serviceManager.serviceClient().getManagedEnvironmentsStorages() + this.innerObject = serviceManager.serviceClient() + .getManagedEnvironmentsStorages() .createOrUpdateWithResponse(resourceGroupName, environmentName, storageName, this.innerModel(), context) .getValue(); return this; @@ -86,13 +90,17 @@ public ManagedEnvironmentStorageImpl update() { } public ManagedEnvironmentStorage apply() { - this.innerObject = serviceManager.serviceClient().getManagedEnvironmentsStorages().createOrUpdateWithResponse( - resourceGroupName, environmentName, storageName, this.innerModel(), Context.NONE).getValue(); + this.innerObject = serviceManager.serviceClient() + .getManagedEnvironmentsStorages() + .createOrUpdateWithResponse(resourceGroupName, environmentName, storageName, this.innerModel(), + Context.NONE) + .getValue(); return this; } public ManagedEnvironmentStorage apply(Context context) { - this.innerObject = serviceManager.serviceClient().getManagedEnvironmentsStorages() + this.innerObject = serviceManager.serviceClient() + .getManagedEnvironmentsStorages() .createOrUpdateWithResponse(resourceGroupName, environmentName, storageName, this.innerModel(), context) .getValue(); return this; @@ -108,14 +116,18 @@ public ManagedEnvironmentStorage apply(Context context) { } public ManagedEnvironmentStorage refresh() { - this.innerObject = serviceManager.serviceClient().getManagedEnvironmentsStorages() - .getWithResponse(resourceGroupName, environmentName, storageName, Context.NONE).getValue(); + this.innerObject = serviceManager.serviceClient() + .getManagedEnvironmentsStorages() + .getWithResponse(resourceGroupName, environmentName, storageName, Context.NONE) + .getValue(); return this; } public ManagedEnvironmentStorage refresh(Context context) { - this.innerObject = serviceManager.serviceClient().getManagedEnvironmentsStorages() - .getWithResponse(resourceGroupName, environmentName, storageName, context).getValue(); + this.innerObject = serviceManager.serviceClient() + .getManagedEnvironmentsStorages() + .getWithResponse(resourceGroupName, environmentName, storageName, context) + .getValue(); return this; } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentStoragesCollectionImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentStoragesCollectionImpl.java index 4a37a11ebfed..b277fae73421 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentStoragesCollectionImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentStoragesCollectionImpl.java @@ -27,7 +27,8 @@ public List value() { List inner = this.innerModel().value(); if (inner != null) { return Collections.unmodifiableList(inner.stream() - .map(inner1 -> new ManagedEnvironmentStorageImpl(inner1, this.manager())).collect(Collectors.toList())); + .map(inner1 -> new ManagedEnvironmentStorageImpl(inner1, this.manager())) + .collect(Collectors.toList())); } else { return Collections.emptyList(); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentUsagesClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentUsagesClientImpl.java index c9e4fdceb164..5e1d74286442 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentUsagesClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentUsagesClientImpl.java @@ -229,9 +229,7 @@ public PagedIterable list(String resourceGroupName, String environme /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -256,9 +254,7 @@ private Mono> listNextSinglePageAsync(String nextLink) /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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 DefaultErrorResponseErrorException thrown if the request is rejected by server. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentsClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentsClientImpl.java index d1d0a06f943d..39ba476664d5 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentsClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentsClientImpl.java @@ -1612,9 +1612,7 @@ public PagedIterable listWorkloadProfileStates(Strin /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1641,9 +1639,7 @@ private Mono> listBySubscriptionNextSingl /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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 DefaultErrorResponseErrorException thrown if the request is rejected by server. @@ -1670,9 +1666,7 @@ private Mono> listBySubscriptionNextSingl /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1699,9 +1693,7 @@ private Mono> listByResourceGroupNextSing /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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 DefaultErrorResponseErrorException thrown if the request is rejected by server. @@ -1728,9 +1720,7 @@ private Mono> listByResourceGroupNextSing /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1759,9 +1749,7 @@ private Mono> listByResourceGroupNextSing /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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 DefaultErrorResponseErrorException thrown if the request is rejected by server. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentsStoragesImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentsStoragesImpl.java index 0912a5938a1b..94436fc275f4 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentsStoragesImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentsStoragesImpl.java @@ -11,9 +11,9 @@ import com.azure.resourcemanager.appcontainers.fluent.ManagedEnvironmentsStoragesClient; import com.azure.resourcemanager.appcontainers.fluent.models.ManagedEnvironmentStorageInner; import com.azure.resourcemanager.appcontainers.fluent.models.ManagedEnvironmentStoragesCollectionInner; +import com.azure.resourcemanager.appcontainers.models.ManagedEnvironmentsStorages; import com.azure.resourcemanager.appcontainers.models.ManagedEnvironmentStorage; import com.azure.resourcemanager.appcontainers.models.ManagedEnvironmentStoragesCollection; -import com.azure.resourcemanager.appcontainers.models.ManagedEnvironmentsStorages; public final class ManagedEnvironmentsStoragesImpl implements ManagedEnvironmentsStorages { private static final ClientLogger LOGGER = new ClientLogger(ManagedEnvironmentsStoragesImpl.class); diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/NamespacesImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/NamespacesImpl.java index 91183b68a218..46629bb05737 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/NamespacesImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/NamespacesImpl.java @@ -29,8 +29,9 @@ public NamespacesImpl(NamespacesClient innerClient, public Response checkNameAvailabilityWithResponse(String resourceGroupName, String environmentName, CheckNameAvailabilityRequest checkNameAvailabilityRequest, Context context) { - Response inner = this.serviceClient().checkNameAvailabilityWithResponse( - resourceGroupName, environmentName, checkNameAvailabilityRequest, context); + Response inner = this.serviceClient() + .checkNameAvailabilityWithResponse(resourceGroupName, environmentName, checkNameAvailabilityRequest, + context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new CheckNameAvailabilityResponseImpl(inner.getValue(), this.manager())); @@ -41,8 +42,8 @@ public Response checkNameAvailabilityWithResponse public CheckNameAvailabilityResponse checkNameAvailability(String resourceGroupName, String environmentName, CheckNameAvailabilityRequest checkNameAvailabilityRequest) { - CheckNameAvailabilityResponseInner inner = this.serviceClient().checkNameAvailability(resourceGroupName, - environmentName, checkNameAvailabilityRequest); + CheckNameAvailabilityResponseInner inner = this.serviceClient() + .checkNameAvailability(resourceGroupName, environmentName, checkNameAvailabilityRequest); if (inner != null) { return new CheckNameAvailabilityResponseImpl(inner, this.manager()); } else { diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/OperationsClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/OperationsClientImpl.java index 6d5969c5049e..c69363cc11e6 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/OperationsClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/OperationsClientImpl.java @@ -179,9 +179,7 @@ public PagedIterable list(Context context) { /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -207,9 +205,7 @@ private Mono> listNextSinglePageAsync(String /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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 DefaultErrorResponseErrorException thrown if the request is rejected by server. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/PrivateEndpointConnectionImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/PrivateEndpointConnectionImpl.java new file mode 100644 index 000000000000..0f307d007854 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/PrivateEndpointConnectionImpl.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.appcontainers.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appcontainers.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.appcontainers.models.PrivateEndpoint; +import com.azure.resourcemanager.appcontainers.models.PrivateEndpointConnection; +import com.azure.resourcemanager.appcontainers.models.PrivateEndpointConnectionProvisioningState; +import com.azure.resourcemanager.appcontainers.models.PrivateLinkServiceConnectionState; +import java.util.Collections; +import java.util.List; + +public final class PrivateEndpointConnectionImpl + implements PrivateEndpointConnection, PrivateEndpointConnection.Definition, PrivateEndpointConnection.Update { + private PrivateEndpointConnectionInner innerObject; + + private final com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public List groupIds() { + List inner = this.innerModel().groupIds(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public PrivateEndpoint privateEndpoint() { + return this.innerModel().privateEndpoint(); + } + + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.innerModel().privateLinkServiceConnectionState(); + } + + public PrivateEndpointConnectionProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public PrivateEndpointConnectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String environmentName; + + private String privateEndpointConnectionName; + + public PrivateEndpointConnectionImpl withExistingManagedEnvironment(String resourceGroupName, + String environmentName) { + this.resourceGroupName = resourceGroupName; + this.environmentName = environmentName; + return this; + } + + public PrivateEndpointConnection create() { + this.innerObject = serviceManager.serviceClient() + .getManagedEnvironmentPrivateEndpointConnections() + .createOrUpdate(resourceGroupName, environmentName, privateEndpointConnectionName, this.innerModel(), + Context.NONE); + return this; + } + + public PrivateEndpointConnection create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getManagedEnvironmentPrivateEndpointConnections() + .createOrUpdate(resourceGroupName, environmentName, privateEndpointConnectionName, this.innerModel(), + context); + return this; + } + + PrivateEndpointConnectionImpl(String name, + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerObject = new PrivateEndpointConnectionInner(); + this.serviceManager = serviceManager; + this.privateEndpointConnectionName = name; + } + + public PrivateEndpointConnectionImpl update() { + return this; + } + + public PrivateEndpointConnection apply() { + this.innerObject = serviceManager.serviceClient() + .getManagedEnvironmentPrivateEndpointConnections() + .createOrUpdate(resourceGroupName, environmentName, privateEndpointConnectionName, this.innerModel(), + Context.NONE); + return this; + } + + public PrivateEndpointConnection apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getManagedEnvironmentPrivateEndpointConnections() + .createOrUpdate(resourceGroupName, environmentName, privateEndpointConnectionName, this.innerModel(), + context); + return this; + } + + PrivateEndpointConnectionImpl(PrivateEndpointConnectionInner innerObject, + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.environmentName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "managedEnvironments"); + this.privateEndpointConnectionName + = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "privateEndpointConnections"); + } + + public PrivateEndpointConnection refresh() { + this.innerObject = serviceManager.serviceClient() + .getManagedEnvironmentPrivateEndpointConnections() + .getWithResponse(resourceGroupName, environmentName, privateEndpointConnectionName, Context.NONE) + .getValue(); + return this; + } + + public PrivateEndpointConnection refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getManagedEnvironmentPrivateEndpointConnections() + .getWithResponse(resourceGroupName, environmentName, privateEndpointConnectionName, context) + .getValue(); + return this; + } + + public PrivateEndpointConnectionImpl withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.innerModel().withPrivateEndpoint(privateEndpoint); + return this; + } + + public PrivateEndpointConnectionImpl + withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + this.innerModel().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); + return this; + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/PrivateLinkResourceImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/PrivateLinkResourceImpl.java new file mode 100644 index 000000000000..29bb3c4ededb --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/PrivateLinkResourceImpl.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.appcontainers.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appcontainers.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.appcontainers.models.PrivateLinkResource; +import java.util.Collections; +import java.util.List; + +public final class PrivateLinkResourceImpl implements PrivateLinkResource { + private PrivateLinkResourceInner innerObject; + + private final com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager; + + PrivateLinkResourceImpl(PrivateLinkResourceInner innerObject, + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager 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 SystemData systemData() { + return this.innerModel().systemData(); + } + + public String groupId() { + return this.innerModel().groupId(); + } + + public List requiredMembers() { + List inner = this.innerModel().requiredMembers(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List requiredZoneNames() { + List inner = this.innerModel().requiredZoneNames(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public PrivateLinkResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ResourceManagerUtils.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ResourceManagerUtils.java index 94a651ce19fa..0a2ed7b73eef 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ResourceManagerUtils.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ResourceManagerUtils.java @@ -41,7 +41,6 @@ static String getValueFromIdByName(String id, String name) { } } return null; - } static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { @@ -75,7 +74,6 @@ static String getValueFromIdByParameterName(String id, String pathTemplate, Stri } } return null; - } static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/SessionPoolImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/SessionPoolImpl.java new file mode 100644 index 000000000000..a37b9bcc471e --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/SessionPoolImpl.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.appcontainers.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appcontainers.fluent.models.SessionPoolInner; +import com.azure.resourcemanager.appcontainers.models.ContainerType; +import com.azure.resourcemanager.appcontainers.models.CustomContainerTemplate; +import com.azure.resourcemanager.appcontainers.models.DynamicPoolConfiguration; +import com.azure.resourcemanager.appcontainers.models.PoolManagementType; +import com.azure.resourcemanager.appcontainers.models.ScaleConfiguration; +import com.azure.resourcemanager.appcontainers.models.SessionNetworkConfiguration; +import com.azure.resourcemanager.appcontainers.models.SessionPool; +import com.azure.resourcemanager.appcontainers.models.SessionPoolProvisioningState; +import com.azure.resourcemanager.appcontainers.models.SessionPoolSecret; +import com.azure.resourcemanager.appcontainers.models.SessionPoolUpdatableProperties; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class SessionPoolImpl implements SessionPool, SessionPool.Definition, SessionPool.Update { + private SessionPoolInner innerObject; + + private final com.azure.resourcemanager.appcontainers.ContainerAppsApiManager 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 SystemData systemData() { + return this.innerModel().systemData(); + } + + public String environmentId() { + return this.innerModel().environmentId(); + } + + public ContainerType containerType() { + return this.innerModel().containerType(); + } + + public PoolManagementType poolManagementType() { + return this.innerModel().poolManagementType(); + } + + public Integer nodeCount() { + return this.innerModel().nodeCount(); + } + + public ScaleConfiguration scaleConfiguration() { + return this.innerModel().scaleConfiguration(); + } + + public List secrets() { + List inner = this.innerModel().secrets(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public DynamicPoolConfiguration dynamicPoolConfiguration() { + return this.innerModel().dynamicPoolConfiguration(); + } + + public CustomContainerTemplate customContainerTemplate() { + return this.innerModel().customContainerTemplate(); + } + + public SessionNetworkConfiguration sessionNetworkConfiguration() { + return this.innerModel().sessionNetworkConfiguration(); + } + + public String poolManagementEndpoint() { + return this.innerModel().poolManagementEndpoint(); + } + + public SessionPoolProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public SessionPoolInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String sessionPoolName; + + private SessionPoolUpdatableProperties updateSessionPoolEnvelope; + + public SessionPoolImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public SessionPool create() { + this.innerObject = serviceManager.serviceClient() + .getContainerAppsSessionPools() + .createOrUpdate(resourceGroupName, sessionPoolName, this.innerModel(), Context.NONE); + return this; + } + + public SessionPool create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getContainerAppsSessionPools() + .createOrUpdate(resourceGroupName, sessionPoolName, this.innerModel(), context); + return this; + } + + SessionPoolImpl(String name, com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerObject = new SessionPoolInner(); + this.serviceManager = serviceManager; + this.sessionPoolName = name; + } + + public SessionPoolImpl update() { + this.updateSessionPoolEnvelope = new SessionPoolUpdatableProperties(); + return this; + } + + public SessionPool apply() { + this.innerObject = serviceManager.serviceClient() + .getContainerAppsSessionPools() + .update(resourceGroupName, sessionPoolName, updateSessionPoolEnvelope, Context.NONE); + return this; + } + + public SessionPool apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getContainerAppsSessionPools() + .update(resourceGroupName, sessionPoolName, updateSessionPoolEnvelope, context); + return this; + } + + SessionPoolImpl(SessionPoolInner innerObject, + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.sessionPoolName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "sessionPools"); + } + + public SessionPool refresh() { + this.innerObject = serviceManager.serviceClient() + .getContainerAppsSessionPools() + .getByResourceGroupWithResponse(resourceGroupName, sessionPoolName, Context.NONE) + .getValue(); + return this; + } + + public SessionPool refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getContainerAppsSessionPools() + .getByResourceGroupWithResponse(resourceGroupName, sessionPoolName, context) + .getValue(); + return this; + } + + public SessionPoolImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public SessionPoolImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public SessionPoolImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public SessionPoolImpl withEnvironmentId(String environmentId) { + this.innerModel().withEnvironmentId(environmentId); + return this; + } + + public SessionPoolImpl withContainerType(ContainerType containerType) { + this.innerModel().withContainerType(containerType); + return this; + } + + public SessionPoolImpl withPoolManagementType(PoolManagementType poolManagementType) { + this.innerModel().withPoolManagementType(poolManagementType); + return this; + } + + public SessionPoolImpl withScaleConfiguration(ScaleConfiguration scaleConfiguration) { + if (isInCreateMode()) { + this.innerModel().withScaleConfiguration(scaleConfiguration); + return this; + } else { + this.updateSessionPoolEnvelope.withScaleConfiguration(scaleConfiguration); + return this; + } + } + + public SessionPoolImpl withSecrets(List secrets) { + if (isInCreateMode()) { + this.innerModel().withSecrets(secrets); + return this; + } else { + this.updateSessionPoolEnvelope.withSecrets(secrets); + return this; + } + } + + public SessionPoolImpl withDynamicPoolConfiguration(DynamicPoolConfiguration dynamicPoolConfiguration) { + if (isInCreateMode()) { + this.innerModel().withDynamicPoolConfiguration(dynamicPoolConfiguration); + return this; + } else { + this.updateSessionPoolEnvelope.withDynamicPoolConfiguration(dynamicPoolConfiguration); + return this; + } + } + + public SessionPoolImpl withCustomContainerTemplate(CustomContainerTemplate customContainerTemplate) { + if (isInCreateMode()) { + this.innerModel().withCustomContainerTemplate(customContainerTemplate); + return this; + } else { + this.updateSessionPoolEnvelope.withCustomContainerTemplate(customContainerTemplate); + return this; + } + } + + public SessionPoolImpl withSessionNetworkConfiguration(SessionNetworkConfiguration sessionNetworkConfiguration) { + if (isInCreateMode()) { + this.innerModel().withSessionNetworkConfiguration(sessionNetworkConfiguration); + return this; + } else { + this.updateSessionPoolEnvelope.withSessionNetworkConfiguration(sessionNetworkConfiguration); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/SourceControlImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/SourceControlImpl.java index 432fbc9bdb43..49070a189996 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/SourceControlImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/SourceControlImpl.java @@ -73,13 +73,15 @@ public SourceControlImpl withExistingContainerApp(String resourceGroupName, Stri } public SourceControl create() { - this.innerObject = serviceManager.serviceClient().getContainerAppsSourceControls() + this.innerObject = serviceManager.serviceClient() + .getContainerAppsSourceControls() .createOrUpdate(resourceGroupName, containerAppName, sourceControlName, this.innerModel(), Context.NONE); return this; } public SourceControl create(Context context) { - this.innerObject = serviceManager.serviceClient().getContainerAppsSourceControls() + this.innerObject = serviceManager.serviceClient() + .getContainerAppsSourceControls() .createOrUpdate(resourceGroupName, containerAppName, sourceControlName, this.innerModel(), context); return this; } @@ -95,13 +97,15 @@ public SourceControlImpl update() { } public SourceControl apply() { - this.innerObject = serviceManager.serviceClient().getContainerAppsSourceControls() + this.innerObject = serviceManager.serviceClient() + .getContainerAppsSourceControls() .createOrUpdate(resourceGroupName, containerAppName, sourceControlName, this.innerModel(), Context.NONE); return this; } public SourceControl apply(Context context) { - this.innerObject = serviceManager.serviceClient().getContainerAppsSourceControls() + this.innerObject = serviceManager.serviceClient() + .getContainerAppsSourceControls() .createOrUpdate(resourceGroupName, containerAppName, sourceControlName, this.innerModel(), context); return this; } @@ -116,14 +120,18 @@ public SourceControl apply(Context context) { } public SourceControl refresh() { - this.innerObject = serviceManager.serviceClient().getContainerAppsSourceControls() - .getWithResponse(resourceGroupName, containerAppName, sourceControlName, Context.NONE).getValue(); + this.innerObject = serviceManager.serviceClient() + .getContainerAppsSourceControls() + .getWithResponse(resourceGroupName, containerAppName, sourceControlName, Context.NONE) + .getValue(); return this; } public SourceControl refresh(Context context) { - this.innerObject = serviceManager.serviceClient().getContainerAppsSourceControls() - .getWithResponse(resourceGroupName, containerAppName, sourceControlName, context).getValue(); + this.innerObject = serviceManager.serviceClient() + .getContainerAppsSourceControls() + .getWithResponse(resourceGroupName, containerAppName, sourceControlName, context) + .getValue(); return this; } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/UsagesClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/UsagesClientImpl.java index e24dcfce4166..29f150947f51 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/UsagesClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/UsagesClientImpl.java @@ -208,9 +208,7 @@ public PagedIterable list(String location, Context context) { /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -235,9 +233,7 @@ private Mono> listNextSinglePageAsync(String nextLink) /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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 DefaultErrorResponseErrorException thrown if the request is rejected by server. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/WorkflowEnvelopeImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/WorkflowEnvelopeImpl.java new file mode 100644 index 000000000000..2da06b74375d --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/WorkflowEnvelopeImpl.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.appcontainers.implementation; + +import com.azure.resourcemanager.appcontainers.fluent.models.WorkflowEnvelopeInner; +import com.azure.resourcemanager.appcontainers.models.WorkflowEnvelope; +import com.azure.resourcemanager.appcontainers.models.WorkflowEnvelopeProperties; + +public final class WorkflowEnvelopeImpl implements WorkflowEnvelope { + private WorkflowEnvelopeInner innerObject; + + private final com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager; + + WorkflowEnvelopeImpl(WorkflowEnvelopeInner innerObject, + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager 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 String kind() { + return this.innerModel().kind(); + } + + public String location() { + return this.innerModel().location(); + } + + public WorkflowEnvelopeProperties properties() { + return this.innerModel().properties(); + } + + public WorkflowEnvelopeInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/package-info.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/package-info.java index 4afb39fb5652..d5c81f00f20c 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/package-info.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/package-info.java @@ -4,6 +4,8 @@ /** * Package containing the implementations for ContainerAppsApiClient. - * null. + * Functions is an extension resource to revisions and the api listed is used to proxy the call from Web RP to the + * function app's host process, this api is not exposed to users and only Web RP is allowed to invoke functions + * extension resource. */ package com.azure.resourcemanager.appcontainers.implementation; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AccessMode.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AccessMode.java index 852bec4dd599..8a43d1bcc430 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AccessMode.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AccessMode.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public AccessMode() { * @param name a name to look for. * @return the corresponding AccessMode. */ - @JsonCreator public static AccessMode fromString(String name) { return fromString(name, AccessMode.class); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Action.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Action.java index a6e094ef55ee..283d4c572536 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Action.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Action.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public Action() { * @param name a name to look for. * @return the corresponding Action. */ - @JsonCreator public static Action fromString(String name) { return fromString(name, Action.class); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ActiveRevisionsMode.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ActiveRevisionsMode.java index 1423db539a9a..f0ca43bde5e2 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ActiveRevisionsMode.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ActiveRevisionsMode.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -40,7 +39,6 @@ public ActiveRevisionsMode() { * @param name a name to look for. * @return the corresponding ActiveRevisionsMode. */ - @JsonCreator public static ActiveRevisionsMode fromString(String name) { return fromString(name, ActiveRevisionsMode.class); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Affinity.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Affinity.java index cab5ae672ceb..795068245527 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Affinity.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Affinity.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public Affinity() { * @param name a name to look for. * @return the corresponding Affinity. */ - @JsonCreator public static Affinity fromString(String name) { return fromString(name, Affinity.class); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AllowedAudiencesValidation.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AllowedAudiencesValidation.java index 4f3646099c37..a62eb3cfbcc7 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AllowedAudiencesValidation.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AllowedAudiencesValidation.java @@ -5,18 +5,21 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.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; /** * The configuration settings of the Allowed Audiences validation flow. */ @Fluent -public final class AllowedAudiencesValidation { +public final class AllowedAudiencesValidation implements JsonSerializable { /* * The configuration settings of the allowed list of audiences from which to validate the JWT token. */ - @JsonProperty(value = "allowedAudiences") private List allowedAudiences; /** @@ -54,4 +57,42 @@ public AllowedAudiencesValidation withAllowedAudiences(List allowedAudie */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("allowedAudiences", this.allowedAudiences, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AllowedAudiencesValidation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AllowedAudiencesValidation if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AllowedAudiencesValidation. + */ + public static AllowedAudiencesValidation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AllowedAudiencesValidation deserializedAllowedAudiencesValidation = new AllowedAudiencesValidation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("allowedAudiences".equals(fieldName)) { + List allowedAudiences = reader.readArray(reader1 -> reader1.getString()); + deserializedAllowedAudiencesValidation.allowedAudiences = allowedAudiences; + } else { + reader.skipChildren(); + } + } + + return deserializedAllowedAudiencesValidation; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AllowedPrincipals.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AllowedPrincipals.java index 608dbfd51e79..a035f5409891 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AllowedPrincipals.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AllowedPrincipals.java @@ -5,24 +5,26 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.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; /** * The configuration settings of the Azure Active Directory allowed principals. */ @Fluent -public final class AllowedPrincipals { +public final class AllowedPrincipals implements JsonSerializable { /* * The list of the allowed groups. */ - @JsonProperty(value = "groups") private List groups; /* * The list of the allowed identities. */ - @JsonProperty(value = "identities") private List identities; /** @@ -78,4 +80,45 @@ public AllowedPrincipals withIdentities(List identities) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("groups", this.groups, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("identities", this.identities, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AllowedPrincipals from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AllowedPrincipals if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AllowedPrincipals. + */ + public static AllowedPrincipals fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AllowedPrincipals deserializedAllowedPrincipals = new AllowedPrincipals(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("groups".equals(fieldName)) { + List groups = reader.readArray(reader1 -> reader1.getString()); + deserializedAllowedPrincipals.groups = groups; + } else if ("identities".equals(fieldName)) { + List identities = reader.readArray(reader1 -> reader1.getString()); + deserializedAllowedPrincipals.identities = identities; + } else { + reader.skipChildren(); + } + } + + return deserializedAllowedPrincipals; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AppInsightsConfiguration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AppInsightsConfiguration.java index 7a1878f16723..a3d7435c59a8 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AppInsightsConfiguration.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AppInsightsConfiguration.java @@ -5,17 +5,20 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Configuration of Application Insights. */ @Fluent -public final class AppInsightsConfiguration { +public final class AppInsightsConfiguration implements JsonSerializable { /* * Application Insights connection string */ - @JsonProperty(value = "connectionString") private String connectionString; /** @@ -51,4 +54,40 @@ public AppInsightsConfiguration withConnectionString(String connectionString) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("connectionString", this.connectionString); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AppInsightsConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AppInsightsConfiguration if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AppInsightsConfiguration. + */ + public static AppInsightsConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AppInsightsConfiguration deserializedAppInsightsConfiguration = new AppInsightsConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("connectionString".equals(fieldName)) { + deserializedAppInsightsConfiguration.connectionString = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAppInsightsConfiguration; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AppLogsConfiguration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AppLogsConfiguration.java index 4e09302a6818..be296d6dc3b2 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AppLogsConfiguration.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AppLogsConfiguration.java @@ -5,23 +5,25 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Configuration of application logs. */ @Fluent -public final class AppLogsConfiguration { +public final class AppLogsConfiguration implements JsonSerializable { /* * Logs destination, can be 'log-analytics', 'azure-monitor' or 'none' */ - @JsonProperty(value = "destination") private String destination; /* * Log Analytics configuration, must only be provided when destination is configured as 'log-analytics' */ - @JsonProperty(value = "logAnalyticsConfiguration") private LogAnalyticsConfiguration logAnalyticsConfiguration; /** @@ -82,4 +84,44 @@ public void validate() { logAnalyticsConfiguration().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("destination", this.destination); + jsonWriter.writeJsonField("logAnalyticsConfiguration", this.logAnalyticsConfiguration); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AppLogsConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AppLogsConfiguration if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AppLogsConfiguration. + */ + public static AppLogsConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AppLogsConfiguration deserializedAppLogsConfiguration = new AppLogsConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("destination".equals(fieldName)) { + deserializedAppLogsConfiguration.destination = reader.getString(); + } else if ("logAnalyticsConfiguration".equals(fieldName)) { + deserializedAppLogsConfiguration.logAnalyticsConfiguration + = LogAnalyticsConfiguration.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAppLogsConfiguration; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AppProtocol.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AppProtocol.java index c4db82bce2a5..a6a614a5d9cd 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AppProtocol.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AppProtocol.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public AppProtocol() { * @param name a name to look for. * @return the corresponding AppProtocol. */ - @JsonCreator public static AppProtocol fromString(String name) { return fromString(name, AppProtocol.class); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AppRegistration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AppRegistration.java index 103b3dc5d783..dfa87e62fb68 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AppRegistration.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AppRegistration.java @@ -5,23 +5,25 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The configuration settings of the app registration for providers that have app ids and app secrets. */ @Fluent -public final class AppRegistration { +public final class AppRegistration implements JsonSerializable { /* * The App ID of the app used for login. */ - @JsonProperty(value = "appId") private String appId; /* * The app setting name that contains the app secret. */ - @JsonProperty(value = "appSecretSettingName") private String appSecretSettingName; /** @@ -77,4 +79,43 @@ public AppRegistration withAppSecretSettingName(String appSecretSettingName) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("appId", this.appId); + jsonWriter.writeStringField("appSecretSettingName", this.appSecretSettingName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AppRegistration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AppRegistration if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AppRegistration. + */ + public static AppRegistration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AppRegistration deserializedAppRegistration = new AppRegistration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("appId".equals(fieldName)) { + deserializedAppRegistration.appId = reader.getString(); + } else if ("appSecretSettingName".equals(fieldName)) { + deserializedAppRegistration.appSecretSettingName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAppRegistration; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AppResiliencyCollection.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AppResiliencyCollection.java index 89441a8d33bb..66078d3846bd 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AppResiliencyCollection.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AppResiliencyCollection.java @@ -6,25 +6,27 @@ 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.appcontainers.fluent.models.AppResiliencyInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * Collection of AppResiliency policies. */ @Fluent -public final class AppResiliencyCollection { +public final class AppResiliencyCollection implements JsonSerializable { /* * Collection of resources. */ - @JsonProperty(value = "value", required = true) private List value; /* * Link to next page of resources. */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; /** @@ -69,12 +71,52 @@ public String nextLink() { */ public void validate() { if (value() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property value in model AppResiliencyCollection")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model AppResiliencyCollection")); } else { value().forEach(e -> e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(AppResiliencyCollection.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AppResiliencyCollection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AppResiliencyCollection 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 AppResiliencyCollection. + */ + public static AppResiliencyCollection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AppResiliencyCollection deserializedAppResiliencyCollection = new AppResiliencyCollection(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> AppResiliencyInner.fromJson(reader1)); + deserializedAppResiliencyCollection.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedAppResiliencyCollection.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAppResiliencyCollection; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Apple.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Apple.java index 9d31e6c18518..b9068954f4ac 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Apple.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Apple.java @@ -5,30 +5,31 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The configuration settings of the Apple provider. */ @Fluent -public final class Apple { +public final class Apple implements JsonSerializable { /* * false if the Apple provider should not be enabled despite the set registration; otherwise, * true. */ - @JsonProperty(value = "enabled") private Boolean enabled; /* * The configuration settings of the Apple registration. */ - @JsonProperty(value = "registration") private AppleRegistration registration; /* * The configuration settings of the login flow. */ - @JsonProperty(value = "login") private LoginScopes login; /** @@ -112,4 +113,46 @@ public void validate() { login().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeJsonField("registration", this.registration); + jsonWriter.writeJsonField("login", this.login); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Apple from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Apple if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Apple. + */ + public static Apple fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Apple deserializedApple = new Apple(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedApple.enabled = reader.getNullable(JsonReader::getBoolean); + } else if ("registration".equals(fieldName)) { + deserializedApple.registration = AppleRegistration.fromJson(reader); + } else if ("login".equals(fieldName)) { + deserializedApple.login = LoginScopes.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedApple; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AppleRegistration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AppleRegistration.java index 2c98beff6028..b4a6a7f603bc 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AppleRegistration.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AppleRegistration.java @@ -5,23 +5,25 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The configuration settings of the registration for the Apple provider. */ @Fluent -public final class AppleRegistration { +public final class AppleRegistration implements JsonSerializable { /* * The Client ID of the app used for login. */ - @JsonProperty(value = "clientId") private String clientId; /* * The app setting name that contains the client secret. */ - @JsonProperty(value = "clientSecretSettingName") private String clientSecretSettingName; /** @@ -77,4 +79,43 @@ public AppleRegistration withClientSecretSettingName(String clientSecretSettingN */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("clientId", this.clientId); + jsonWriter.writeStringField("clientSecretSettingName", this.clientSecretSettingName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AppleRegistration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AppleRegistration if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AppleRegistration. + */ + public static AppleRegistration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AppleRegistration deserializedAppleRegistration = new AppleRegistration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("clientId".equals(fieldName)) { + deserializedAppleRegistration.clientId = reader.getString(); + } else if ("clientSecretSettingName".equals(fieldName)) { + deserializedAppleRegistration.clientSecretSettingName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAppleRegistration; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Applicability.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Applicability.java index e11f3e143baa..6079b7a34e5d 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Applicability.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Applicability.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public Applicability() { * @param name a name to look for. * @return the corresponding Applicability. */ - @JsonCreator public static Applicability fromString(String name) { return fromString(name, Applicability.class); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AuthConfigCollection.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AuthConfigCollection.java index cb6e133045e8..9de58bc2a77d 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AuthConfigCollection.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AuthConfigCollection.java @@ -6,25 +6,27 @@ 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.appcontainers.fluent.models.AuthConfigInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * AuthConfig collection ARM resource. */ @Fluent -public final class AuthConfigCollection { +public final class AuthConfigCollection implements JsonSerializable { /* * Collection of resources. */ - @JsonProperty(value = "value", required = true) private List value; /* * Link to next page of resources. */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; /** @@ -69,12 +71,52 @@ public String nextLink() { */ public void validate() { if (value() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property value in model AuthConfigCollection")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model AuthConfigCollection")); } else { value().forEach(e -> e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(AuthConfigCollection.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AuthConfigCollection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AuthConfigCollection 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 AuthConfigCollection. + */ + public static AuthConfigCollection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AuthConfigCollection deserializedAuthConfigCollection = new AuthConfigCollection(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> AuthConfigInner.fromJson(reader1)); + deserializedAuthConfigCollection.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedAuthConfigCollection.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAuthConfigCollection; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AuthPlatform.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AuthPlatform.java index 0c477b52f3a7..f4dcd11cb443 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AuthPlatform.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AuthPlatform.java @@ -5,18 +5,21 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The configuration settings of the platform of ContainerApp Service Authentication/Authorization. */ @Fluent -public final class AuthPlatform { +public final class AuthPlatform implements JsonSerializable { /* * true if the Authentication / Authorization feature is enabled for the current app; otherwise, * false. */ - @JsonProperty(value = "enabled") private Boolean enabled; /* @@ -24,7 +27,6 @@ public final class AuthPlatform { * The setting in this value can control the behavior of certain features in the Authentication / Authorization * module. */ - @JsonProperty(value = "runtimeVersion") private String runtimeVersion; /** @@ -88,4 +90,43 @@ public AuthPlatform withRuntimeVersion(String runtimeVersion) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeStringField("runtimeVersion", this.runtimeVersion); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AuthPlatform from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AuthPlatform if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AuthPlatform. + */ + public static AuthPlatform fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AuthPlatform deserializedAuthPlatform = new AuthPlatform(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedAuthPlatform.enabled = reader.getNullable(JsonReader::getBoolean); + } else if ("runtimeVersion".equals(fieldName)) { + deserializedAuthPlatform.runtimeVersion = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAuthPlatform; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AvailableOperations.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AvailableOperations.java index adf507e54f74..6eb3b999e571 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AvailableOperations.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AvailableOperations.java @@ -5,26 +5,28 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.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.appcontainers.fluent.models.OperationDetailInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * Available operations of the service. */ @Fluent -public final class AvailableOperations { +public final class AvailableOperations implements JsonSerializable { /* * Collection of available operation details */ - @JsonProperty(value = "value") private List value; /* * URL client should use to fetch the next page (per server side paging). * It's null for now, added for future use. */ - @JsonProperty(value = "nextLink") private String nextLink; /** @@ -85,4 +87,45 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@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 AvailableOperations from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AvailableOperations if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AvailableOperations. + */ + public static AvailableOperations fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AvailableOperations deserializedAvailableOperations = new AvailableOperations(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> OperationDetailInner.fromJson(reader1)); + deserializedAvailableOperations.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedAvailableOperations.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAvailableOperations; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AvailableWorkloadProfileProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AvailableWorkloadProfileProperties.java index 7985d9a2d615..74b6db89dc2a 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AvailableWorkloadProfileProperties.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AvailableWorkloadProfileProperties.java @@ -5,47 +5,45 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Revision resource specific properties. */ @Fluent -public final class AvailableWorkloadProfileProperties { +public final class AvailableWorkloadProfileProperties implements JsonSerializable { /* * Used to categorize workload profiles. */ - @JsonProperty(value = "category") private String category; /* * indicates whether the profile is default for the location. */ - @JsonProperty(value = "applicability") private Applicability applicability; /* * Number of cores in CPU. */ - @JsonProperty(value = "cores") private Integer cores; /* * Memory in GiB. */ - @JsonProperty(value = "memoryGiB") private Integer memoryGiB; /* * Number of GPUs. */ - @JsonProperty(value = "gpus") private Integer gpus; /* * The everyday name of the workload profile. */ - @JsonProperty(value = "displayName") private String displayName; /** @@ -181,4 +179,57 @@ public AvailableWorkloadProfileProperties withDisplayName(String displayName) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("category", this.category); + jsonWriter.writeStringField("applicability", this.applicability == null ? null : this.applicability.toString()); + jsonWriter.writeNumberField("cores", this.cores); + jsonWriter.writeNumberField("memoryGiB", this.memoryGiB); + jsonWriter.writeNumberField("gpus", this.gpus); + jsonWriter.writeStringField("displayName", this.displayName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AvailableWorkloadProfileProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AvailableWorkloadProfileProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AvailableWorkloadProfileProperties. + */ + public static AvailableWorkloadProfileProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AvailableWorkloadProfileProperties deserializedAvailableWorkloadProfileProperties + = new AvailableWorkloadProfileProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("category".equals(fieldName)) { + deserializedAvailableWorkloadProfileProperties.category = reader.getString(); + } else if ("applicability".equals(fieldName)) { + deserializedAvailableWorkloadProfileProperties.applicability + = Applicability.fromString(reader.getString()); + } else if ("cores".equals(fieldName)) { + deserializedAvailableWorkloadProfileProperties.cores = reader.getNullable(JsonReader::getInt); + } else if ("memoryGiB".equals(fieldName)) { + deserializedAvailableWorkloadProfileProperties.memoryGiB = reader.getNullable(JsonReader::getInt); + } else if ("gpus".equals(fieldName)) { + deserializedAvailableWorkloadProfileProperties.gpus = reader.getNullable(JsonReader::getInt); + } else if ("displayName".equals(fieldName)) { + deserializedAvailableWorkloadProfileProperties.displayName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAvailableWorkloadProfileProperties; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AvailableWorkloadProfilesCollection.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AvailableWorkloadProfilesCollection.java index 78d73b05d570..8a7ad74d96ef 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AvailableWorkloadProfilesCollection.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AvailableWorkloadProfilesCollection.java @@ -6,25 +6,28 @@ 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.appcontainers.fluent.models.AvailableWorkloadProfileInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * Collection of available workload profiles in the location. */ @Fluent -public final class AvailableWorkloadProfilesCollection { +public final class AvailableWorkloadProfilesCollection + implements JsonSerializable { /* * Collection of workload profiles. */ - @JsonProperty(value = "value", required = true) private List value; /* * Link to next page of resources. */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; /** @@ -69,12 +72,55 @@ public String nextLink() { */ public void validate() { if (value() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property value in model AvailableWorkloadProfilesCollection")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model AvailableWorkloadProfilesCollection")); } else { value().forEach(e -> e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(AvailableWorkloadProfilesCollection.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AvailableWorkloadProfilesCollection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AvailableWorkloadProfilesCollection 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 AvailableWorkloadProfilesCollection. + */ + public static AvailableWorkloadProfilesCollection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AvailableWorkloadProfilesCollection deserializedAvailableWorkloadProfilesCollection + = new AvailableWorkloadProfilesCollection(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> AvailableWorkloadProfileInner.fromJson(reader1)); + deserializedAvailableWorkloadProfilesCollection.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedAvailableWorkloadProfilesCollection.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAvailableWorkloadProfilesCollection; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AzureActiveDirectory.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AzureActiveDirectory.java index 4f9eaadb5f71..f25df813cf99 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AzureActiveDirectory.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AzureActiveDirectory.java @@ -5,36 +5,36 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The configuration settings of the Azure Active directory provider. */ @Fluent -public final class AzureActiveDirectory { +public final class AzureActiveDirectory implements JsonSerializable { /* * false if the Azure Active Directory provider should not be enabled despite the set registration; * otherwise, true. */ - @JsonProperty(value = "enabled") private Boolean enabled; /* * The configuration settings of the Azure Active Directory app registration. */ - @JsonProperty(value = "registration") private AzureActiveDirectoryRegistration registration; /* * The configuration settings of the Azure Active Directory login flow. */ - @JsonProperty(value = "login") private AzureActiveDirectoryLogin login; /* * The configuration settings of the Azure Active Directory token validation flow. */ - @JsonProperty(value = "validation") private AzureActiveDirectoryValidation validation; /* @@ -42,7 +42,6 @@ public final class AzureActiveDirectory { * This is an internal flag primarily intended to support the Azure Management Portal. Users should not * read or write to this property. */ - @JsonProperty(value = "isAutoProvisioned") private Boolean isAutoProvisioned; /** @@ -175,4 +174,52 @@ public void validate() { validation().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeJsonField("registration", this.registration); + jsonWriter.writeJsonField("login", this.login); + jsonWriter.writeJsonField("validation", this.validation); + jsonWriter.writeBooleanField("isAutoProvisioned", this.isAutoProvisioned); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureActiveDirectory from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureActiveDirectory if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AzureActiveDirectory. + */ + public static AzureActiveDirectory fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureActiveDirectory deserializedAzureActiveDirectory = new AzureActiveDirectory(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedAzureActiveDirectory.enabled = reader.getNullable(JsonReader::getBoolean); + } else if ("registration".equals(fieldName)) { + deserializedAzureActiveDirectory.registration = AzureActiveDirectoryRegistration.fromJson(reader); + } else if ("login".equals(fieldName)) { + deserializedAzureActiveDirectory.login = AzureActiveDirectoryLogin.fromJson(reader); + } else if ("validation".equals(fieldName)) { + deserializedAzureActiveDirectory.validation = AzureActiveDirectoryValidation.fromJson(reader); + } else if ("isAutoProvisioned".equals(fieldName)) { + deserializedAzureActiveDirectory.isAutoProvisioned = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureActiveDirectory; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AzureActiveDirectoryLogin.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AzureActiveDirectoryLogin.java index 89bc07ad1216..1e1ba1db43d4 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AzureActiveDirectoryLogin.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AzureActiveDirectoryLogin.java @@ -5,26 +5,28 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.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; /** * The configuration settings of the Azure Active Directory login flow. */ @Fluent -public final class AzureActiveDirectoryLogin { +public final class AzureActiveDirectoryLogin implements JsonSerializable { /* * Login parameters to send to the OpenID Connect authorization endpoint when * a user logs in. Each parameter must be in the form "key=value". */ - @JsonProperty(value = "loginParameters") private List loginParameters; /* * true if the www-authenticate provider should be omitted from the request; otherwise, * false. */ - @JsonProperty(value = "disableWWWAuthenticate") private Boolean disableWwwAuthenticate; /** @@ -56,8 +58,8 @@ public AzureActiveDirectoryLogin withLoginParameters(List loginParameter } /** - * Get the disableWwwAuthenticate property: <code>true</code> if the www-authenticate provider should - * be omitted from the request; otherwise, <code>false</code>. + * Get the disableWwwAuthenticate property: <code>true</code> if the www-authenticate provider should be + * omitted from the request; otherwise, <code>false</code>. * * @return the disableWwwAuthenticate value. */ @@ -66,8 +68,8 @@ public Boolean disableWwwAuthenticate() { } /** - * Set the disableWwwAuthenticate property: <code>true</code> if the www-authenticate provider should - * be omitted from the request; otherwise, <code>false</code>. + * Set the disableWwwAuthenticate property: <code>true</code> if the www-authenticate provider should be + * omitted from the request; otherwise, <code>false</code>. * * @param disableWwwAuthenticate the disableWwwAuthenticate value to set. * @return the AzureActiveDirectoryLogin object itself. @@ -84,4 +86,46 @@ public AzureActiveDirectoryLogin withDisableWwwAuthenticate(Boolean disableWwwAu */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("loginParameters", this.loginParameters, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("disableWWWAuthenticate", this.disableWwwAuthenticate); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureActiveDirectoryLogin from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureActiveDirectoryLogin if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AzureActiveDirectoryLogin. + */ + public static AzureActiveDirectoryLogin fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureActiveDirectoryLogin deserializedAzureActiveDirectoryLogin = new AzureActiveDirectoryLogin(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("loginParameters".equals(fieldName)) { + List loginParameters = reader.readArray(reader1 -> reader1.getString()); + deserializedAzureActiveDirectoryLogin.loginParameters = loginParameters; + } else if ("disableWWWAuthenticate".equals(fieldName)) { + deserializedAzureActiveDirectoryLogin.disableWwwAuthenticate + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureActiveDirectoryLogin; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AzureActiveDirectoryRegistration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AzureActiveDirectoryRegistration.java index 12c0102dc6d8..22e06521cfb9 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AzureActiveDirectoryRegistration.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AzureActiveDirectoryRegistration.java @@ -5,13 +5,17 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The configuration settings of the Azure Active Directory app registration. */ @Fluent -public final class AzureActiveDirectoryRegistration { +public final class AzureActiveDirectoryRegistration implements JsonSerializable { /* * The OpenID Connect Issuer URI that represents the entity which issues access tokens for this application. * When using Azure Active Directory, this value is the URI of the directory tenant, e.g. @@ -19,7 +23,6 @@ public final class AzureActiveDirectoryRegistration { * This URI is a case-sensitive identifier for the token issuer. * More information on OpenID Connect Discovery: http://openid.net/specs/openid-connect-discovery-1_0.html */ - @JsonProperty(value = "openIdIssuer") private String openIdIssuer; /* @@ -28,13 +31,11 @@ public final class AzureActiveDirectoryRegistration { * other 3rd party OpenID Connect providers. * More information on OpenID Connect: http://openid.net/specs/openid-connect-core-1_0.html */ - @JsonProperty(value = "clientId") private String clientId; /* * The app setting name that contains the client secret of the relying party application. */ - @JsonProperty(value = "clientSecretSettingName") private String clientSecretSettingName; /* @@ -42,7 +43,6 @@ public final class AzureActiveDirectoryRegistration { * property acts as * a replacement for the Client Secret. It is also optional. */ - @JsonProperty(value = "clientSecretCertificateThumbprint") private String clientSecretCertificateThumbprint; /* @@ -50,7 +50,6 @@ public final class AzureActiveDirectoryRegistration { * signing purposes. This property acts as * a replacement for the Client Secret Certificate Thumbprint. It is also optional. */ - @JsonProperty(value = "clientSecretCertificateSubjectAlternativeName") private String clientSecretCertificateSubjectAlternativeName; /* @@ -58,7 +57,6 @@ public final class AzureActiveDirectoryRegistration { * This property acts as * a replacement for the Client Secret Certificate Thumbprint. It is also optional. */ - @JsonProperty(value = "clientSecretCertificateIssuer") private String clientSecretCertificateIssuer; /** @@ -227,4 +225,58 @@ public AzureActiveDirectoryRegistration withClientSecretCertificateIssuer(String */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("openIdIssuer", this.openIdIssuer); + jsonWriter.writeStringField("clientId", this.clientId); + jsonWriter.writeStringField("clientSecretSettingName", this.clientSecretSettingName); + jsonWriter.writeStringField("clientSecretCertificateThumbprint", this.clientSecretCertificateThumbprint); + jsonWriter.writeStringField("clientSecretCertificateSubjectAlternativeName", + this.clientSecretCertificateSubjectAlternativeName); + jsonWriter.writeStringField("clientSecretCertificateIssuer", this.clientSecretCertificateIssuer); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureActiveDirectoryRegistration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureActiveDirectoryRegistration if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AzureActiveDirectoryRegistration. + */ + public static AzureActiveDirectoryRegistration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureActiveDirectoryRegistration deserializedAzureActiveDirectoryRegistration + = new AzureActiveDirectoryRegistration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("openIdIssuer".equals(fieldName)) { + deserializedAzureActiveDirectoryRegistration.openIdIssuer = reader.getString(); + } else if ("clientId".equals(fieldName)) { + deserializedAzureActiveDirectoryRegistration.clientId = reader.getString(); + } else if ("clientSecretSettingName".equals(fieldName)) { + deserializedAzureActiveDirectoryRegistration.clientSecretSettingName = reader.getString(); + } else if ("clientSecretCertificateThumbprint".equals(fieldName)) { + deserializedAzureActiveDirectoryRegistration.clientSecretCertificateThumbprint = reader.getString(); + } else if ("clientSecretCertificateSubjectAlternativeName".equals(fieldName)) { + deserializedAzureActiveDirectoryRegistration.clientSecretCertificateSubjectAlternativeName + = reader.getString(); + } else if ("clientSecretCertificateIssuer".equals(fieldName)) { + deserializedAzureActiveDirectoryRegistration.clientSecretCertificateIssuer = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureActiveDirectoryRegistration; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AzureActiveDirectoryValidation.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AzureActiveDirectoryValidation.java index 173ceeab4e9c..1bc671179aeb 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AzureActiveDirectoryValidation.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AzureActiveDirectoryValidation.java @@ -5,30 +5,31 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.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; /** * The configuration settings of the Azure Active Directory token validation flow. */ @Fluent -public final class AzureActiveDirectoryValidation { +public final class AzureActiveDirectoryValidation implements JsonSerializable { /* * The configuration settings of the checks that should be made while validating the JWT Claims. */ - @JsonProperty(value = "jwtClaimChecks") private JwtClaimChecks jwtClaimChecks; /* * The list of audiences that can make successful authentication/authorization requests. */ - @JsonProperty(value = "allowedAudiences") private List allowedAudiences; /* * The configuration settings of the default authorization policy. */ - @JsonProperty(value = "defaultAuthorizationPolicy") private DefaultAuthorizationPolicy defaultAuthorizationPolicy; /** @@ -115,4 +116,50 @@ public void validate() { defaultAuthorizationPolicy().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("jwtClaimChecks", this.jwtClaimChecks); + jsonWriter.writeArrayField("allowedAudiences", this.allowedAudiences, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("defaultAuthorizationPolicy", this.defaultAuthorizationPolicy); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureActiveDirectoryValidation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureActiveDirectoryValidation if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AzureActiveDirectoryValidation. + */ + public static AzureActiveDirectoryValidation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureActiveDirectoryValidation deserializedAzureActiveDirectoryValidation + = new AzureActiveDirectoryValidation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("jwtClaimChecks".equals(fieldName)) { + deserializedAzureActiveDirectoryValidation.jwtClaimChecks = JwtClaimChecks.fromJson(reader); + } else if ("allowedAudiences".equals(fieldName)) { + List allowedAudiences = reader.readArray(reader1 -> reader1.getString()); + deserializedAzureActiveDirectoryValidation.allowedAudiences = allowedAudiences; + } else if ("defaultAuthorizationPolicy".equals(fieldName)) { + deserializedAzureActiveDirectoryValidation.defaultAuthorizationPolicy + = DefaultAuthorizationPolicy.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureActiveDirectoryValidation; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AzureCredentials.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AzureCredentials.java index 6e6c7219119e..77df7e871075 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AzureCredentials.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AzureCredentials.java @@ -5,41 +5,40 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Container App credentials. */ @Fluent -public final class AzureCredentials { +public final class AzureCredentials implements JsonSerializable { /* * Client Id. */ - @JsonProperty(value = "clientId") private String clientId; /* * Client Secret. */ - @JsonProperty(value = "clientSecret") private String clientSecret; /* * Tenant Id. */ - @JsonProperty(value = "tenantId") private String tenantId; /* * Kind of auth github does for deploying the template */ - @JsonProperty(value = "kind") private String kind; /* * Subscription Id. */ - @JsonProperty(value = "subscriptionId") private String subscriptionId; /** @@ -155,4 +154,52 @@ public AzureCredentials withSubscriptionId(String subscriptionId) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("clientId", this.clientId); + jsonWriter.writeStringField("clientSecret", this.clientSecret); + jsonWriter.writeStringField("tenantId", this.tenantId); + jsonWriter.writeStringField("kind", this.kind); + jsonWriter.writeStringField("subscriptionId", this.subscriptionId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureCredentials from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureCredentials if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AzureCredentials. + */ + public static AzureCredentials fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureCredentials deserializedAzureCredentials = new AzureCredentials(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("clientId".equals(fieldName)) { + deserializedAzureCredentials.clientId = reader.getString(); + } else if ("clientSecret".equals(fieldName)) { + deserializedAzureCredentials.clientSecret = reader.getString(); + } else if ("tenantId".equals(fieldName)) { + deserializedAzureCredentials.tenantId = reader.getString(); + } else if ("kind".equals(fieldName)) { + deserializedAzureCredentials.kind = reader.getString(); + } else if ("subscriptionId".equals(fieldName)) { + deserializedAzureCredentials.subscriptionId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureCredentials; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AzureFileProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AzureFileProperties.java index 5e5551a79238..0686a9939013 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AzureFileProperties.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AzureFileProperties.java @@ -5,35 +5,35 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Azure File Properties. */ @Fluent -public final class AzureFileProperties { +public final class AzureFileProperties implements JsonSerializable { /* * Storage account name for azure file. */ - @JsonProperty(value = "accountName") private String accountName; /* * Storage account key for azure file. */ - @JsonProperty(value = "accountKey") private String accountKey; /* * Access mode for storage */ - @JsonProperty(value = "accessMode") private AccessMode accessMode; /* * Azure file share name. */ - @JsonProperty(value = "shareName") private String shareName; /** @@ -129,4 +129,49 @@ public AzureFileProperties withShareName(String shareName) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("accountName", this.accountName); + jsonWriter.writeStringField("accountKey", this.accountKey); + jsonWriter.writeStringField("accessMode", this.accessMode == null ? null : this.accessMode.toString()); + jsonWriter.writeStringField("shareName", this.shareName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureFileProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureFileProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AzureFileProperties. + */ + public static AzureFileProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureFileProperties deserializedAzureFileProperties = new AzureFileProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("accountName".equals(fieldName)) { + deserializedAzureFileProperties.accountName = reader.getString(); + } else if ("accountKey".equals(fieldName)) { + deserializedAzureFileProperties.accountKey = reader.getString(); + } else if ("accessMode".equals(fieldName)) { + deserializedAzureFileProperties.accessMode = AccessMode.fromString(reader.getString()); + } else if ("shareName".equals(fieldName)) { + deserializedAzureFileProperties.shareName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureFileProperties; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AzureStaticWebApps.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AzureStaticWebApps.java index 42132f4fac68..eab53181b19d 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AzureStaticWebApps.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AzureStaticWebApps.java @@ -5,24 +5,26 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The configuration settings of the Azure Static Web Apps provider. */ @Fluent -public final class AzureStaticWebApps { +public final class AzureStaticWebApps implements JsonSerializable { /* * false if the Azure Static Web Apps provider should not be enabled despite the set registration; * otherwise, true. */ - @JsonProperty(value = "enabled") private Boolean enabled; /* * The configuration settings of the Azure Static Web Apps registration. */ - @JsonProperty(value = "registration") private AzureStaticWebAppsRegistration registration; /** @@ -83,4 +85,43 @@ public void validate() { registration().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeJsonField("registration", this.registration); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureStaticWebApps from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureStaticWebApps if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AzureStaticWebApps. + */ + public static AzureStaticWebApps fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureStaticWebApps deserializedAzureStaticWebApps = new AzureStaticWebApps(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedAzureStaticWebApps.enabled = reader.getNullable(JsonReader::getBoolean); + } else if ("registration".equals(fieldName)) { + deserializedAzureStaticWebApps.registration = AzureStaticWebAppsRegistration.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureStaticWebApps; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AzureStaticWebAppsRegistration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AzureStaticWebAppsRegistration.java index 1d8651ab2d1e..b73438252fbd 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AzureStaticWebAppsRegistration.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AzureStaticWebAppsRegistration.java @@ -5,17 +5,20 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The configuration settings of the registration for the Azure Static Web Apps provider. */ @Fluent -public final class AzureStaticWebAppsRegistration { +public final class AzureStaticWebAppsRegistration implements JsonSerializable { /* * The Client ID of the app used for login. */ - @JsonProperty(value = "clientId") private String clientId; /** @@ -51,4 +54,41 @@ public AzureStaticWebAppsRegistration withClientId(String clientId) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("clientId", this.clientId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureStaticWebAppsRegistration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureStaticWebAppsRegistration if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AzureStaticWebAppsRegistration. + */ + public static AzureStaticWebAppsRegistration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureStaticWebAppsRegistration deserializedAzureStaticWebAppsRegistration + = new AzureStaticWebAppsRegistration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("clientId".equals(fieldName)) { + deserializedAzureStaticWebAppsRegistration.clientId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureStaticWebAppsRegistration; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BaseContainer.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BaseContainer.java index 541432d9b2af..01e7df04856b 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BaseContainer.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BaseContainer.java @@ -5,54 +5,57 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.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; /** * Container App base container definition. */ @Fluent -public class BaseContainer { +public class BaseContainer implements JsonSerializable { /* * Container image tag. */ - @JsonProperty(value = "image") private String image; + /* + * The type of the image. Set to CloudBuild to let the system manages the image, where user will not be able to + * update image through image field. Set to ContainerImage for user provided image. + */ + private ImageType imageType; + /* * Custom container name. */ - @JsonProperty(value = "name") private String name; /* * Container start command. */ - @JsonProperty(value = "command") private List command; /* * Container start command arguments. */ - @JsonProperty(value = "args") private List args; /* * Container environment variables. */ - @JsonProperty(value = "env") private List env; /* * Container resource requirements. */ - @JsonProperty(value = "resources") private ContainerResources resources; /* * Container volume mounts. */ - @JsonProperty(value = "volumeMounts") private List volumeMounts; /** @@ -81,6 +84,28 @@ public BaseContainer withImage(String image) { return this; } + /** + * Get the imageType property: The type of the image. Set to CloudBuild to let the system manages the image, where + * user will not be able to update image through image field. Set to ContainerImage for user provided image. + * + * @return the imageType value. + */ + public ImageType imageType() { + return this.imageType; + } + + /** + * Set the imageType property: The type of the image. Set to CloudBuild to let the system manages the image, where + * user will not be able to update image through image field. Set to ContainerImage for user provided image. + * + * @param imageType the imageType value to set. + * @return the BaseContainer object itself. + */ + public BaseContainer withImageType(ImageType imageType) { + this.imageType = imageType; + return this; + } + /** * Get the name property: Custom container name. * @@ -217,4 +242,65 @@ public void validate() { volumeMounts().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("image", this.image); + jsonWriter.writeStringField("imageType", this.imageType == null ? null : this.imageType.toString()); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeArrayField("command", this.command, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("args", this.args, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("env", this.env, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("resources", this.resources); + jsonWriter.writeArrayField("volumeMounts", this.volumeMounts, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BaseContainer from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BaseContainer if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the BaseContainer. + */ + public static BaseContainer fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BaseContainer deserializedBaseContainer = new BaseContainer(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("image".equals(fieldName)) { + deserializedBaseContainer.image = reader.getString(); + } else if ("imageType".equals(fieldName)) { + deserializedBaseContainer.imageType = ImageType.fromString(reader.getString()); + } else if ("name".equals(fieldName)) { + deserializedBaseContainer.name = reader.getString(); + } else if ("command".equals(fieldName)) { + List command = reader.readArray(reader1 -> reader1.getString()); + deserializedBaseContainer.command = command; + } else if ("args".equals(fieldName)) { + List args = reader.readArray(reader1 -> reader1.getString()); + deserializedBaseContainer.args = args; + } else if ("env".equals(fieldName)) { + List env = reader.readArray(reader1 -> EnvironmentVar.fromJson(reader1)); + deserializedBaseContainer.env = env; + } else if ("resources".equals(fieldName)) { + deserializedBaseContainer.resources = ContainerResources.fromJson(reader); + } else if ("volumeMounts".equals(fieldName)) { + List volumeMounts = reader.readArray(reader1 -> VolumeMount.fromJson(reader1)); + deserializedBaseContainer.volumeMounts = volumeMounts; + } else { + reader.skipChildren(); + } + } + + return deserializedBaseContainer; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BillingMeter.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BillingMeter.java index 21e8e061d4b8..b24dae71df99 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BillingMeter.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BillingMeter.java @@ -5,39 +5,79 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Billing meter. */ @Fluent -public final class BillingMeter extends ProxyResource { +public final class BillingMeter implements JsonSerializable { + /* + * Fully qualified resource ID for the resource. Ex - + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{ + * resourceType}/{resourceName} + */ + private String id; + + /* + * The name of the resource + */ + private String name; + + /* + * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + */ + private String type; + /* * Region for the billing meter. */ - @JsonProperty(value = "location") private String location; /* * Revision resource specific properties */ - @JsonProperty(value = "properties") private BillingMeterProperties properties; - /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) - private SystemData systemData; - /** * Creates an instance of BillingMeter class. */ public BillingMeter() { } + /** + * Get the id property: Fully qualified resource ID for the resource. Ex - + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + * "Microsoft.Storage/storageAccounts". + * + * @return the type value. + */ + public String type() { + return this.type; + } + /** * Get the location property: Region for the billing meter. * @@ -78,15 +118,6 @@ public BillingMeter withProperties(BillingMeterProperties 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; - } - /** * Validates the instance. * @@ -97,4 +128,49 @@ public void validate() { properties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BillingMeter from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BillingMeter if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the BillingMeter. + */ + public static BillingMeter fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BillingMeter deserializedBillingMeter = new BillingMeter(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedBillingMeter.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedBillingMeter.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedBillingMeter.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedBillingMeter.location = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedBillingMeter.properties = BillingMeterProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedBillingMeter; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BillingMeterProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BillingMeterProperties.java index e8ab0e0c1fcc..054d2c687414 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BillingMeterProperties.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BillingMeterProperties.java @@ -5,29 +5,30 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Revision resource specific properties. */ @Fluent -public final class BillingMeterProperties { +public final class BillingMeterProperties implements JsonSerializable { /* * Used to categorize billing meters. */ - @JsonProperty(value = "category") private String category; /* * Billing meter type. */ - @JsonProperty(value = "meterType") private String meterType; /* * The everyday name of the billing meter. */ - @JsonProperty(value = "displayName") private String displayName; /** @@ -103,4 +104,46 @@ public BillingMeterProperties withDisplayName(String displayName) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("category", this.category); + jsonWriter.writeStringField("meterType", this.meterType); + jsonWriter.writeStringField("displayName", this.displayName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BillingMeterProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BillingMeterProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the BillingMeterProperties. + */ + public static BillingMeterProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BillingMeterProperties deserializedBillingMeterProperties = new BillingMeterProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("category".equals(fieldName)) { + deserializedBillingMeterProperties.category = reader.getString(); + } else if ("meterType".equals(fieldName)) { + deserializedBillingMeterProperties.meterType = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedBillingMeterProperties.displayName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedBillingMeterProperties; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BindingType.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BindingType.java index 6683cd637112..242450df7347 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BindingType.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BindingType.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public BindingType() { * @param name a name to look for. * @return the corresponding BindingType. */ - @JsonCreator public static BindingType fromString(String name) { return fromString(name, BindingType.class); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BlobStorageTokenStore.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BlobStorageTokenStore.java index ff9b6b4d46bc..9f0c27bd913c 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BlobStorageTokenStore.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BlobStorageTokenStore.java @@ -6,17 +6,20 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The configuration settings of the storage of the tokens if blob storage is used. */ @Fluent -public final class BlobStorageTokenStore { +public final class BlobStorageTokenStore implements JsonSerializable { /* * The name of the app secrets containing the SAS URL of the blob storage containing the tokens. */ - @JsonProperty(value = "sasUrlSettingName", required = true) private String sasUrlSettingName; /** @@ -54,10 +57,48 @@ public BlobStorageTokenStore withSasUrlSettingName(String sasUrlSettingName) { */ public void validate() { if (sasUrlSettingName() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property sasUrlSettingName in model BlobStorageTokenStore")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property sasUrlSettingName in model BlobStorageTokenStore")); } } private static final ClientLogger LOGGER = new ClientLogger(BlobStorageTokenStore.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("sasUrlSettingName", this.sasUrlSettingName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BlobStorageTokenStore from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BlobStorageTokenStore 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 BlobStorageTokenStore. + */ + public static BlobStorageTokenStore fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BlobStorageTokenStore deserializedBlobStorageTokenStore = new BlobStorageTokenStore(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sasUrlSettingName".equals(fieldName)) { + deserializedBlobStorageTokenStore.sasUrlSettingName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedBlobStorageTokenStore; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BuildCollection.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BuildCollection.java index bb7e4f45c623..b0267e90fff9 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BuildCollection.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BuildCollection.java @@ -6,25 +6,27 @@ 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.appcontainers.fluent.models.BuildResourceInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * The response of a BuildResource list operation. */ @Fluent -public final class BuildCollection { +public final class BuildCollection implements JsonSerializable { /* * The BuildResource items on this page */ - @JsonProperty(value = "value", required = true) private List value; /* * The link to the next page of items */ - @JsonProperty(value = "nextLink") private String nextLink; /** @@ -80,12 +82,53 @@ public BuildCollection withNextLink(String nextLink) { */ public void validate() { if (value() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property value in model BuildCollection")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model BuildCollection")); } else { value().forEach(e -> e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(BuildCollection.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 BuildCollection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BuildCollection 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 BuildCollection. + */ + public static BuildCollection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BuildCollection deserializedBuildCollection = new BuildCollection(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> BuildResourceInner.fromJson(reader1)); + deserializedBuildCollection.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedBuildCollection.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedBuildCollection; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BuildConfiguration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BuildConfiguration.java index 20aa5a04a517..bc194ad4c4f9 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BuildConfiguration.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BuildConfiguration.java @@ -5,42 +5,41 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.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; /** * Configuration of the build. */ @Fluent -public final class BuildConfiguration { +public final class BuildConfiguration implements JsonSerializable { /* * Base OS used to build and run the app. */ - @JsonProperty(value = "baseOs") private String baseOs; /* * Platform to be used to build and run the app. */ - @JsonProperty(value = "platform") private String platform; /* * Platform version to be used to build and run the app. */ - @JsonProperty(value = "platformVersion") private String platformVersion; /* * List of environment variables to be passed to the build, secrets should not be used in environment variable. */ - @JsonProperty(value = "environmentVariables") private List environmentVariables; /* * List of steps to perform before the build. */ - @JsonProperty(value = "preBuildSteps") private List preBuildSteps; /** @@ -164,4 +163,56 @@ public void validate() { preBuildSteps().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("baseOs", this.baseOs); + jsonWriter.writeStringField("platform", this.platform); + jsonWriter.writeStringField("platformVersion", this.platformVersion); + jsonWriter.writeArrayField("environmentVariables", this.environmentVariables, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("preBuildSteps", this.preBuildSteps, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BuildConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BuildConfiguration if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the BuildConfiguration. + */ + public static BuildConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BuildConfiguration deserializedBuildConfiguration = new BuildConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("baseOs".equals(fieldName)) { + deserializedBuildConfiguration.baseOs = reader.getString(); + } else if ("platform".equals(fieldName)) { + deserializedBuildConfiguration.platform = reader.getString(); + } else if ("platformVersion".equals(fieldName)) { + deserializedBuildConfiguration.platformVersion = reader.getString(); + } else if ("environmentVariables".equals(fieldName)) { + List environmentVariables + = reader.readArray(reader1 -> EnvironmentVariable.fromJson(reader1)); + deserializedBuildConfiguration.environmentVariables = environmentVariables; + } else if ("preBuildSteps".equals(fieldName)) { + List preBuildSteps = reader.readArray(reader1 -> PreBuildStep.fromJson(reader1)); + deserializedBuildConfiguration.preBuildSteps = preBuildSteps; + } else { + reader.skipChildren(); + } + } + + return deserializedBuildConfiguration; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BuildProvisioningState.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BuildProvisioningState.java index 64fbc890e676..5922fd28a4fd 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BuildProvisioningState.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BuildProvisioningState.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -57,7 +56,6 @@ public BuildProvisioningState() { * @param name a name to look for. * @return the corresponding BuildProvisioningState. */ - @JsonCreator public static BuildProvisioningState fromString(String name) { return fromString(name, BuildProvisioningState.class); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BuildStatus.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BuildStatus.java index 77c849cce275..ddd4dde5e8e7 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BuildStatus.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BuildStatus.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -52,7 +51,6 @@ public BuildStatus() { * @param name a name to look for. * @return the corresponding BuildStatus. */ - @JsonCreator public static BuildStatus fromString(String name) { return fromString(name, BuildStatus.class); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BuilderCollection.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BuilderCollection.java index f82e7ac7e8b6..d48b541cf328 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BuilderCollection.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BuilderCollection.java @@ -6,25 +6,27 @@ 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.appcontainers.fluent.models.BuilderResourceInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * The response of a BuilderResource list operation. */ @Fluent -public final class BuilderCollection { +public final class BuilderCollection implements JsonSerializable { /* * The BuilderResource items on this page */ - @JsonProperty(value = "value", required = true) private List value; /* * The link to the next page of items */ - @JsonProperty(value = "nextLink") private String nextLink; /** @@ -80,12 +82,54 @@ public BuilderCollection withNextLink(String nextLink) { */ public void validate() { if (value() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property value in model BuilderCollection")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model BuilderCollection")); } else { value().forEach(e -> e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(BuilderCollection.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 BuilderCollection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BuilderCollection 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 BuilderCollection. + */ + public static BuilderCollection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BuilderCollection deserializedBuilderCollection = new BuilderCollection(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> BuilderResourceInner.fromJson(reader1)); + deserializedBuilderCollection.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedBuilderCollection.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedBuilderCollection; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BuilderProvisioningState.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BuilderProvisioningState.java index 2a8293b79a56..7f99e5aa4f2b 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BuilderProvisioningState.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BuilderProvisioningState.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -57,7 +56,6 @@ public BuilderProvisioningState() { * @param name a name to look for. * @return the corresponding BuilderProvisioningState. */ - @JsonCreator public static BuilderProvisioningState fromString(String name) { return fromString(name, BuilderProvisioningState.class); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BuilderResourceUpdate.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BuilderResourceUpdate.java index 32c3b8c07a3e..90256ebdca5e 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BuilderResourceUpdate.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BuilderResourceUpdate.java @@ -5,33 +5,32 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.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.appcontainers.fluent.models.BuilderResourceUpdateProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.Map; /** * The type used for update operations of the BuilderResource. */ @Fluent -public final class BuilderResourceUpdate { +public final class BuilderResourceUpdate implements JsonSerializable { /* * The managed service identities assigned to this resource. */ - @JsonProperty(value = "identity") private ManagedServiceIdentity identity; /* * Resource tags. */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /* * The updatable properties of the BuilderResource. */ - @JsonProperty(value = "properties") private BuilderResourceUpdateProperties innerProperties; /** @@ -127,4 +126,48 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BuilderResourceUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BuilderResourceUpdate if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the BuilderResourceUpdate. + */ + public static BuilderResourceUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BuilderResourceUpdate deserializedBuilderResourceUpdate = new BuilderResourceUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("identity".equals(fieldName)) { + deserializedBuilderResourceUpdate.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedBuilderResourceUpdate.tags = tags; + } else if ("properties".equals(fieldName)) { + deserializedBuilderResourceUpdate.innerProperties + = BuilderResourceUpdateProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedBuilderResourceUpdate; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CertificateCollection.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CertificateCollection.java index 4b2427f101cc..4829498672c0 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CertificateCollection.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CertificateCollection.java @@ -6,25 +6,27 @@ 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.appcontainers.fluent.models.CertificateInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * Collection of Certificates. */ @Fluent -public final class CertificateCollection { +public final class CertificateCollection implements JsonSerializable { /* * Collection of resources. */ - @JsonProperty(value = "value", required = true) private List value; /* * Link to next page of resources. */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; /** @@ -69,12 +71,52 @@ public String nextLink() { */ public void validate() { if (value() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property value in model CertificateCollection")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model CertificateCollection")); } else { value().forEach(e -> e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(CertificateCollection.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CertificateCollection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CertificateCollection 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 CertificateCollection. + */ + public static CertificateCollection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CertificateCollection deserializedCertificateCollection = new CertificateCollection(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> CertificateInner.fromJson(reader1)); + deserializedCertificateCollection.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedCertificateCollection.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCertificateCollection; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CertificateKeyVaultProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CertificateKeyVaultProperties.java index 77c3a421c24d..2813e73fbf00 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CertificateKeyVaultProperties.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CertificateKeyVaultProperties.java @@ -5,24 +5,26 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Properties for a certificate stored in a Key Vault. */ @Fluent -public final class CertificateKeyVaultProperties { +public final class CertificateKeyVaultProperties implements JsonSerializable { /* * Resource ID of a managed identity to authenticate with Azure Key Vault, or System to use a system-assigned * identity. */ - @JsonProperty(value = "identity") private String identity; /* * URL pointing to the Azure Key Vault secret that holds the certificate. */ - @JsonProperty(value = "keyVaultUrl") private String keyVaultUrl; /** @@ -80,4 +82,44 @@ public CertificateKeyVaultProperties withKeyVaultUrl(String keyVaultUrl) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("identity", this.identity); + jsonWriter.writeStringField("keyVaultUrl", this.keyVaultUrl); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CertificateKeyVaultProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CertificateKeyVaultProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CertificateKeyVaultProperties. + */ + public static CertificateKeyVaultProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CertificateKeyVaultProperties deserializedCertificateKeyVaultProperties + = new CertificateKeyVaultProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("identity".equals(fieldName)) { + deserializedCertificateKeyVaultProperties.identity = reader.getString(); + } else if ("keyVaultUrl".equals(fieldName)) { + deserializedCertificateKeyVaultProperties.keyVaultUrl = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCertificateKeyVaultProperties; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CertificatePatch.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CertificatePatch.java index d1be80c2c81d..6a105a10fed9 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CertificatePatch.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CertificatePatch.java @@ -5,20 +5,21 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.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; /** * A certificate to update. */ @Fluent -public final class CertificatePatch { +public final class CertificatePatch implements JsonSerializable { /* * Application-specific metadata in the form of key-value pairs. */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /** @@ -54,4 +55,41 @@ public CertificatePatch withTags(Map tags) { */ 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 CertificatePatch from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CertificatePatch if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the CertificatePatch. + */ + public static CertificatePatch fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CertificatePatch deserializedCertificatePatch = new CertificatePatch(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedCertificatePatch.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedCertificatePatch; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CertificateProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CertificateProperties.java index ef82a7bb28b5..41c1f8b60392 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CertificateProperties.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CertificateProperties.java @@ -6,7 +6,11 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.CoreUtils; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.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.util.List; @@ -14,83 +18,70 @@ * Certificate resource specific properties. */ @Fluent -public final class CertificateProperties { +public final class CertificateProperties implements JsonSerializable { /* * Provisioning state of the certificate. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private CertificateProvisioningState provisioningState; /* * Properties for a certificate stored in a Key Vault. */ - @JsonProperty(value = "certificateKeyVaultProperties") private CertificateKeyVaultProperties certificateKeyVaultProperties; /* * Certificate password. */ - @JsonProperty(value = "password") private String password; /* * Subject name of the certificate. */ - @JsonProperty(value = "subjectName", access = JsonProperty.Access.WRITE_ONLY) private String subjectName; /* * Subject alternative names the certificate applies to. */ - @JsonProperty(value = "subjectAlternativeNames", access = JsonProperty.Access.WRITE_ONLY) private List subjectAlternativeNames; /* * PFX or PEM blob */ - @JsonProperty(value = "value") private byte[] value; /* * Certificate issuer. */ - @JsonProperty(value = "issuer", access = JsonProperty.Access.WRITE_ONLY) private String issuer; /* * Certificate issue Date. */ - @JsonProperty(value = "issueDate", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime issueDate; /* * Certificate expiration date. */ - @JsonProperty(value = "expirationDate", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime expirationDate; /* * Certificate thumbprint. */ - @JsonProperty(value = "thumbprint", access = JsonProperty.Access.WRITE_ONLY) private String thumbprint; /* * Is the certificate valid?. */ - @JsonProperty(value = "valid", access = JsonProperty.Access.WRITE_ONLY) private Boolean valid; /* * Public key hash. */ - @JsonProperty(value = "publicKeyHash", access = JsonProperty.Access.WRITE_ONLY) private String publicKeyHash; /* * The type of the certificate. Allowed values are `ServerSSLCertificate` and `ImagePullTrustedCA` */ - @JsonProperty(value = "certificateType") private CertificateType certificateType; /** @@ -273,4 +264,73 @@ public void validate() { certificateKeyVaultProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("certificateKeyVaultProperties", this.certificateKeyVaultProperties); + jsonWriter.writeStringField("password", this.password); + jsonWriter.writeBinaryField("value", this.value); + jsonWriter.writeStringField("certificateType", + this.certificateType == null ? null : this.certificateType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CertificateProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CertificateProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the CertificateProperties. + */ + public static CertificateProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CertificateProperties deserializedCertificateProperties = new CertificateProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedCertificateProperties.provisioningState + = CertificateProvisioningState.fromString(reader.getString()); + } else if ("certificateKeyVaultProperties".equals(fieldName)) { + deserializedCertificateProperties.certificateKeyVaultProperties + = CertificateKeyVaultProperties.fromJson(reader); + } else if ("password".equals(fieldName)) { + deserializedCertificateProperties.password = reader.getString(); + } else if ("subjectName".equals(fieldName)) { + deserializedCertificateProperties.subjectName = reader.getString(); + } else if ("subjectAlternativeNames".equals(fieldName)) { + List subjectAlternativeNames = reader.readArray(reader1 -> reader1.getString()); + deserializedCertificateProperties.subjectAlternativeNames = subjectAlternativeNames; + } else if ("value".equals(fieldName)) { + deserializedCertificateProperties.value = reader.getBinary(); + } else if ("issuer".equals(fieldName)) { + deserializedCertificateProperties.issuer = reader.getString(); + } else if ("issueDate".equals(fieldName)) { + deserializedCertificateProperties.issueDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("expirationDate".equals(fieldName)) { + deserializedCertificateProperties.expirationDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("thumbprint".equals(fieldName)) { + deserializedCertificateProperties.thumbprint = reader.getString(); + } else if ("valid".equals(fieldName)) { + deserializedCertificateProperties.valid = reader.getNullable(JsonReader::getBoolean); + } else if ("publicKeyHash".equals(fieldName)) { + deserializedCertificateProperties.publicKeyHash = reader.getString(); + } else if ("certificateType".equals(fieldName)) { + deserializedCertificateProperties.certificateType = CertificateType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedCertificateProperties; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CertificateProvisioningState.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CertificateProvisioningState.java index 74cae6f86cc9..2ffca63da6c3 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CertificateProvisioningState.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CertificateProvisioningState.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -52,7 +51,6 @@ public CertificateProvisioningState() { * @param name a name to look for. * @return the corresponding CertificateProvisioningState. */ - @JsonCreator public static CertificateProvisioningState fromString(String name) { return fromString(name, CertificateProvisioningState.class); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CertificateType.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CertificateType.java index 93d70629eeb9..c00cb182ef8f 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CertificateType.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CertificateType.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public CertificateType() { * @param name a name to look for. * @return the corresponding CertificateType. */ - @JsonCreator public static CertificateType fromString(String name) { return fromString(name, CertificateType.class); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CheckNameAvailabilityReason.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CheckNameAvailabilityReason.java index e499c606fcab..186892302726 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CheckNameAvailabilityReason.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CheckNameAvailabilityReason.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public CheckNameAvailabilityReason() { * @param name a name to look for. * @return the corresponding CheckNameAvailabilityReason. */ - @JsonCreator public static CheckNameAvailabilityReason fromString(String name) { return fromString(name, CheckNameAvailabilityReason.class); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CheckNameAvailabilityRequest.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CheckNameAvailabilityRequest.java index 51361d97bdd9..d964c0cf48f8 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CheckNameAvailabilityRequest.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CheckNameAvailabilityRequest.java @@ -5,23 +5,25 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The check availability request body. */ @Fluent -public final class CheckNameAvailabilityRequest { +public final class CheckNameAvailabilityRequest implements JsonSerializable { /* * The name of the resource for which availability needs to be checked. */ - @JsonProperty(value = "name") private String name; /* * The resource type. */ - @JsonProperty(value = "type") private String type; /** @@ -77,4 +79,43 @@ public CheckNameAvailabilityRequest withType(String type) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("type", this.type); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CheckNameAvailabilityRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CheckNameAvailabilityRequest if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CheckNameAvailabilityRequest. + */ + public static CheckNameAvailabilityRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CheckNameAvailabilityRequest deserializedCheckNameAvailabilityRequest = new CheckNameAvailabilityRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedCheckNameAvailabilityRequest.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedCheckNameAvailabilityRequest.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCheckNameAvailabilityRequest; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CircuitBreakerPolicy.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CircuitBreakerPolicy.java index 15fa7600e32b..973c4c44a1bd 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CircuitBreakerPolicy.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CircuitBreakerPolicy.java @@ -5,30 +5,31 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Policy that defines circuit breaker conditions. */ @Fluent -public final class CircuitBreakerPolicy { +public final class CircuitBreakerPolicy implements JsonSerializable { /* * Number of consecutive errors before the circuit breaker opens */ - @JsonProperty(value = "consecutiveErrors") private Integer consecutiveErrors; /* * The time interval, in seconds, between endpoint checks. This can result in opening the circuit breaker if the * check fails as well as closing the circuit breaker if the check succeeds. Defaults to 10s. */ - @JsonProperty(value = "intervalInSeconds") private Integer intervalInSeconds; /* * Maximum percentage of hosts that will be ejected after failure threshold has been met */ - @JsonProperty(value = "maxEjectionPercent") private Integer maxEjectionPercent; /** @@ -82,8 +83,8 @@ public CircuitBreakerPolicy withIntervalInSeconds(Integer intervalInSeconds) { } /** - * Get the maxEjectionPercent property: Maximum percentage of hosts that will be ejected after failure threshold - * has been met. + * Get the maxEjectionPercent property: Maximum percentage of hosts that will be ejected after failure threshold has + * been met. * * @return the maxEjectionPercent value. */ @@ -92,8 +93,8 @@ public Integer maxEjectionPercent() { } /** - * Set the maxEjectionPercent property: Maximum percentage of hosts that will be ejected after failure threshold - * has been met. + * Set the maxEjectionPercent property: Maximum percentage of hosts that will be ejected after failure threshold has + * been met. * * @param maxEjectionPercent the maxEjectionPercent value to set. * @return the CircuitBreakerPolicy object itself. @@ -110,4 +111,46 @@ public CircuitBreakerPolicy withMaxEjectionPercent(Integer maxEjectionPercent) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("consecutiveErrors", this.consecutiveErrors); + jsonWriter.writeNumberField("intervalInSeconds", this.intervalInSeconds); + jsonWriter.writeNumberField("maxEjectionPercent", this.maxEjectionPercent); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CircuitBreakerPolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CircuitBreakerPolicy if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the CircuitBreakerPolicy. + */ + public static CircuitBreakerPolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CircuitBreakerPolicy deserializedCircuitBreakerPolicy = new CircuitBreakerPolicy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("consecutiveErrors".equals(fieldName)) { + deserializedCircuitBreakerPolicy.consecutiveErrors = reader.getNullable(JsonReader::getInt); + } else if ("intervalInSeconds".equals(fieldName)) { + deserializedCircuitBreakerPolicy.intervalInSeconds = reader.getNullable(JsonReader::getInt); + } else if ("maxEjectionPercent".equals(fieldName)) { + deserializedCircuitBreakerPolicy.maxEjectionPercent = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedCircuitBreakerPolicy; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ClientCredentialMethod.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ClientCredentialMethod.java index c2dc3e9ab038..1bfcc8315252 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ClientCredentialMethod.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ClientCredentialMethod.java @@ -4,9 +4,6 @@ package com.azure.resourcemanager.appcontainers.models; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - /** * The method that should be used to authenticate the user. */ @@ -31,7 +28,6 @@ public enum ClientCredentialMethod { * @param value the serialized value to parse. * @return the parsed ClientCredentialMethod object, or null if unable to parse. */ - @JsonCreator public static ClientCredentialMethod fromString(String value) { if (value == null) { return null; @@ -48,7 +44,6 @@ public static ClientCredentialMethod fromString(String value) { /** * {@inheritDoc} */ - @JsonValue @Override public String toString() { return this.value; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ClientRegistration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ClientRegistration.java index c016c58d4bc3..67660d403a50 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ClientRegistration.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ClientRegistration.java @@ -5,23 +5,25 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The configuration settings of the app registration for providers that have client ids and client secrets. */ @Fluent -public final class ClientRegistration { +public final class ClientRegistration implements JsonSerializable { /* * The Client ID of the app used for login. */ - @JsonProperty(value = "clientId") private String clientId; /* * The app setting name that contains the client secret. */ - @JsonProperty(value = "clientSecretSettingName") private String clientSecretSettingName; /** @@ -77,4 +79,43 @@ public ClientRegistration withClientSecretSettingName(String clientSecretSetting */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("clientId", this.clientId); + jsonWriter.writeStringField("clientSecretSettingName", this.clientSecretSettingName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClientRegistration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClientRegistration if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ClientRegistration. + */ + public static ClientRegistration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClientRegistration deserializedClientRegistration = new ClientRegistration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("clientId".equals(fieldName)) { + deserializedClientRegistration.clientId = reader.getString(); + } else if ("clientSecretSettingName".equals(fieldName)) { + deserializedClientRegistration.clientSecretSettingName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedClientRegistration; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Configuration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Configuration.java index 82755893d112..06b863bd1e9a 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Configuration.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Configuration.java @@ -5,18 +5,21 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.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; /** * Non versioned Container App configuration properties that define the mutable settings of a Container app. */ @Fluent -public final class Configuration { +public final class Configuration implements JsonSerializable { /* * Collection of secrets used by a Container app */ - @JsonProperty(value = "secrets") private List secrets; /* @@ -24,39 +27,44 @@ public final class Configuration { * Multiple: multiple revisions can be active.Single: Only one revision can be active at a * time. Revision weights can not be used in this mode. If no value if provided, this is the default. */ - @JsonProperty(value = "activeRevisionsMode") private ActiveRevisionsMode activeRevisionsMode; /* * Ingress configurations. */ - @JsonProperty(value = "ingress") private Ingress ingress; /* * Collection of private container registry credentials for containers used by the Container app */ - @JsonProperty(value = "registries") private List registries; /* * Dapr configuration for the Container App. */ - @JsonProperty(value = "dapr") private Dapr dapr; + /* + * App runtime configuration for the Container App. + */ + private Runtime runtime; + /* * Optional. Max inactive revisions a Container App can have. */ - @JsonProperty(value = "maxInactiveRevisions") private Integer maxInactiveRevisions; /* * Container App to be a dev Container App Service */ - @JsonProperty(value = "service") private Service service; + /* + * Optional settings for Managed Identities that are assigned to the Container App. If a Managed Identity is not + * specified here, default settings will be used. + */ + private List identitySettings; + /** * Creates an instance of Configuration class. */ @@ -87,8 +95,8 @@ public Configuration withSecrets(List secrets) { * Get the activeRevisionsMode property: ActiveRevisionsMode controls how active revisions are handled for the * Container app: * <list><item>Multiple: multiple revisions can be active.</item><item>Single: Only one - * revision can be active at a time. Revision weights can not be used in this mode. If no value if provided, this - * is the default.</item></list>. + * revision can be active at a time. Revision weights can not be used in this mode. If no value if provided, this is + * the default.</item></list>. * * @return the activeRevisionsMode value. */ @@ -100,8 +108,8 @@ public ActiveRevisionsMode activeRevisionsMode() { * Set the activeRevisionsMode property: ActiveRevisionsMode controls how active revisions are handled for the * Container app: * <list><item>Multiple: multiple revisions can be active.</item><item>Single: Only one - * revision can be active at a time. Revision weights can not be used in this mode. If no value if provided, this - * is the default.</item></list>. + * revision can be active at a time. Revision weights can not be used in this mode. If no value if provided, this is + * the default.</item></list>. * * @param activeRevisionsMode the activeRevisionsMode value to set. * @return the Configuration object itself. @@ -173,6 +181,26 @@ public Configuration withDapr(Dapr dapr) { return this; } + /** + * Get the runtime property: App runtime configuration for the Container App. + * + * @return the runtime value. + */ + public Runtime runtime() { + return this.runtime; + } + + /** + * Set the runtime property: App runtime configuration for the Container App. + * + * @param runtime the runtime value to set. + * @return the Configuration object itself. + */ + public Configuration withRuntime(Runtime runtime) { + this.runtime = runtime; + return this; + } + /** * Get the maxInactiveRevisions property: Optional. Max inactive revisions a Container App can have. * @@ -213,6 +241,28 @@ public Configuration withService(Service service) { return this; } + /** + * Get the identitySettings property: Optional settings for Managed Identities that are assigned to the Container + * App. If a Managed Identity is not specified here, default settings will be used. + * + * @return the identitySettings value. + */ + public List identitySettings() { + return this.identitySettings; + } + + /** + * Set the identitySettings property: Optional settings for Managed Identities that are assigned to the Container + * App. If a Managed Identity is not specified here, default settings will be used. + * + * @param identitySettings the identitySettings value to set. + * @return the Configuration object itself. + */ + public Configuration withIdentitySettings(List identitySettings) { + this.identitySettings = identitySettings; + return this; + } + /** * Validates the instance. * @@ -231,8 +281,81 @@ public void validate() { if (dapr() != null) { dapr().validate(); } + if (runtime() != null) { + runtime().validate(); + } if (service() != null) { service().validate(); } + if (identitySettings() != null) { + identitySettings().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("secrets", this.secrets, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("activeRevisionsMode", + this.activeRevisionsMode == null ? null : this.activeRevisionsMode.toString()); + jsonWriter.writeJsonField("ingress", this.ingress); + jsonWriter.writeArrayField("registries", this.registries, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("dapr", this.dapr); + jsonWriter.writeJsonField("runtime", this.runtime); + jsonWriter.writeNumberField("maxInactiveRevisions", this.maxInactiveRevisions); + jsonWriter.writeJsonField("service", this.service); + jsonWriter.writeArrayField("identitySettings", this.identitySettings, + (writer, element) -> writer.writeJson(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 ("secrets".equals(fieldName)) { + List secrets = reader.readArray(reader1 -> Secret.fromJson(reader1)); + deserializedConfiguration.secrets = secrets; + } else if ("activeRevisionsMode".equals(fieldName)) { + deserializedConfiguration.activeRevisionsMode = ActiveRevisionsMode.fromString(reader.getString()); + } else if ("ingress".equals(fieldName)) { + deserializedConfiguration.ingress = Ingress.fromJson(reader); + } else if ("registries".equals(fieldName)) { + List registries + = reader.readArray(reader1 -> RegistryCredentials.fromJson(reader1)); + deserializedConfiguration.registries = registries; + } else if ("dapr".equals(fieldName)) { + deserializedConfiguration.dapr = Dapr.fromJson(reader); + } else if ("runtime".equals(fieldName)) { + deserializedConfiguration.runtime = Runtime.fromJson(reader); + } else if ("maxInactiveRevisions".equals(fieldName)) { + deserializedConfiguration.maxInactiveRevisions = reader.getNullable(JsonReader::getInt); + } else if ("service".equals(fieldName)) { + deserializedConfiguration.service = Service.fromJson(reader); + } else if ("identitySettings".equals(fieldName)) { + List identitySettings + = reader.readArray(reader1 -> IdentitySettings.fromJson(reader1)); + deserializedConfiguration.identitySettings = identitySettings; + } else { + reader.skipChildren(); + } + } + + return deserializedConfiguration; + }); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironmentCollection.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironmentCollection.java index f95c515f5c0f..09017c93dba6 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironmentCollection.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironmentCollection.java @@ -5,25 +5,27 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.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.appcontainers.fluent.models.ConnectedEnvironmentInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * Collection of connectedEnvironments. */ @Fluent -public final class ConnectedEnvironmentCollection { +public final class ConnectedEnvironmentCollection implements JsonSerializable { /* * Collection of resources. */ - @JsonProperty(value = "value") private List value; /* * Link to next page of resources. */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; /** @@ -71,4 +73,45 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectedEnvironmentCollection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectedEnvironmentCollection if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ConnectedEnvironmentCollection. + */ + public static ConnectedEnvironmentCollection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectedEnvironmentCollection deserializedConnectedEnvironmentCollection + = new ConnectedEnvironmentCollection(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ConnectedEnvironmentInner.fromJson(reader1)); + deserializedConnectedEnvironmentCollection.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedConnectedEnvironmentCollection.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedConnectedEnvironmentCollection; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironmentProvisioningState.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironmentProvisioningState.java index 5655b3a8691f..d9ca5cac6b16 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironmentProvisioningState.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironmentProvisioningState.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -71,7 +70,6 @@ public ConnectedEnvironmentProvisioningState() { * @param name a name to look for. * @return the corresponding ConnectedEnvironmentProvisioningState. */ - @JsonCreator public static ConnectedEnvironmentProvisioningState fromString(String name) { return fromString(name, ConnectedEnvironmentProvisioningState.class); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironmentStorageProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironmentStorageProperties.java index 9715cc8bc3cb..4ba039d9a39c 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironmentStorageProperties.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironmentStorageProperties.java @@ -5,19 +5,28 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Storage properties. */ @Fluent -public final class ConnectedEnvironmentStorageProperties { +public final class ConnectedEnvironmentStorageProperties + implements JsonSerializable { /* * Azure file properties */ - @JsonProperty(value = "azureFile") private AzureFileProperties azureFile; + /* + * SMB storage properties + */ + private SmbStorage smb; + /** * Creates an instance of ConnectedEnvironmentStorageProperties class. */ @@ -44,6 +53,26 @@ public ConnectedEnvironmentStorageProperties withAzureFile(AzureFileProperties a return this; } + /** + * Get the smb property: SMB storage properties. + * + * @return the smb value. + */ + public SmbStorage smb() { + return this.smb; + } + + /** + * Set the smb property: SMB storage properties. + * + * @param smb the smb value to set. + * @return the ConnectedEnvironmentStorageProperties object itself. + */ + public ConnectedEnvironmentStorageProperties withSmb(SmbStorage smb) { + this.smb = smb; + return this; + } + /** * Validates the instance. * @@ -53,5 +82,48 @@ public void validate() { if (azureFile() != null) { azureFile().validate(); } + if (smb() != null) { + smb().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("azureFile", this.azureFile); + jsonWriter.writeJsonField("smb", this.smb); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectedEnvironmentStorageProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectedEnvironmentStorageProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ConnectedEnvironmentStorageProperties. + */ + public static ConnectedEnvironmentStorageProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectedEnvironmentStorageProperties deserializedConnectedEnvironmentStorageProperties + = new ConnectedEnvironmentStorageProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("azureFile".equals(fieldName)) { + deserializedConnectedEnvironmentStorageProperties.azureFile = AzureFileProperties.fromJson(reader); + } else if ("smb".equals(fieldName)) { + deserializedConnectedEnvironmentStorageProperties.smb = SmbStorage.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedConnectedEnvironmentStorageProperties; + }); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Container.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Container.java index b1f4d676514c..e6e01dd10dbd 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Container.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Container.java @@ -5,7 +5,10 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** @@ -16,7 +19,6 @@ public final class Container extends BaseContainer { /* * List of probes for the container. */ - @JsonProperty(value = "probes") private List probes; /** @@ -54,6 +56,15 @@ public Container withImage(String image) { return this; } + /** + * {@inheritDoc} + */ + @Override + public Container withImageType(ImageType imageType) { + super.withImageType(imageType); + return this; + } + /** * {@inheritDoc} */ @@ -120,4 +131,69 @@ public void validate() { probes().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("image", image()); + jsonWriter.writeStringField("imageType", imageType() == null ? null : imageType().toString()); + jsonWriter.writeStringField("name", name()); + jsonWriter.writeArrayField("command", command(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("args", args(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("env", env(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("resources", resources()); + jsonWriter.writeArrayField("volumeMounts", volumeMounts(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("probes", this.probes, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Container from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Container if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the Container. + */ + public static Container fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Container deserializedContainer = new Container(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("image".equals(fieldName)) { + deserializedContainer.withImage(reader.getString()); + } else if ("imageType".equals(fieldName)) { + deserializedContainer.withImageType(ImageType.fromString(reader.getString())); + } else if ("name".equals(fieldName)) { + deserializedContainer.withName(reader.getString()); + } else if ("command".equals(fieldName)) { + List command = reader.readArray(reader1 -> reader1.getString()); + deserializedContainer.withCommand(command); + } else if ("args".equals(fieldName)) { + List args = reader.readArray(reader1 -> reader1.getString()); + deserializedContainer.withArgs(args); + } else if ("env".equals(fieldName)) { + List env = reader.readArray(reader1 -> EnvironmentVar.fromJson(reader1)); + deserializedContainer.withEnv(env); + } else if ("resources".equals(fieldName)) { + deserializedContainer.withResources(ContainerResources.fromJson(reader)); + } else if ("volumeMounts".equals(fieldName)) { + List volumeMounts = reader.readArray(reader1 -> VolumeMount.fromJson(reader1)); + deserializedContainer.withVolumeMounts(volumeMounts); + } else if ("probes".equals(fieldName)) { + List probes = reader.readArray(reader1 -> ContainerAppProbe.fromJson(reader1)); + deserializedContainer.probes = probes; + } else { + reader.skipChildren(); + } + } + + return deserializedContainer; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerApp.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerApp.java index 45488a9f26c9..66b389c0a112 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerApp.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerApp.java @@ -75,6 +75,15 @@ public interface ContainerApp { */ String managedBy(); + /** + * Gets the kind property: Metadata used to render different experiences for resources of the same type; e.g. + * WorkflowApp is a kind of Microsoft.App/ContainerApps type. If supported, the resource provider must validate and + * persist this value. + * + * @return the kind value. + */ + Kind kind(); + /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * @@ -110,6 +119,13 @@ public interface ContainerApp { */ String workloadProfileName(); + /** + * Gets the patchingConfiguration property: Container App auto patch configuration. + * + * @return the patchingConfiguration value. + */ + ContainerAppPropertiesPatchingConfiguration patchingConfiguration(); + /** * Gets the latestRevisionName property: Name of the latest revision of the Container App. * @@ -250,8 +266,9 @@ interface WithResourceGroup { * to be created, but also allows for any other optional properties to be specified. */ interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithExtendedLocation, - DefinitionStages.WithIdentity, DefinitionStages.WithManagedBy, DefinitionStages.WithManagedEnvironmentId, - DefinitionStages.WithEnvironmentId, DefinitionStages.WithWorkloadProfileName, + DefinitionStages.WithIdentity, DefinitionStages.WithManagedBy, DefinitionStages.WithKind, + DefinitionStages.WithManagedEnvironmentId, DefinitionStages.WithEnvironmentId, + DefinitionStages.WithWorkloadProfileName, DefinitionStages.WithPatchingConfiguration, DefinitionStages.WithConfiguration, DefinitionStages.WithTemplate { /** * Executes the create request. @@ -328,6 +345,23 @@ interface WithManagedBy { WithCreate withManagedBy(String managedBy); } + /** + * The stage of the ContainerApp definition allowing to specify kind. + */ + interface WithKind { + /** + * Specifies the kind property: Metadata used to render different experiences for resources of the same + * type; e.g. WorkflowApp is a kind of Microsoft.App/ContainerApps type. If supported, the resource provider + * must validate and persist this value.. + * + * @param kind Metadata used to render different experiences for resources of the same type; e.g. + * WorkflowApp is a kind of Microsoft.App/ContainerApps type. If supported, the resource provider must + * validate and persist this value. + * @return the next definition stage. + */ + WithCreate withKind(Kind kind); + } + /** * The stage of the ContainerApp definition allowing to specify managedEnvironmentId. */ @@ -367,6 +401,19 @@ interface WithWorkloadProfileName { WithCreate withWorkloadProfileName(String workloadProfileName); } + /** + * The stage of the ContainerApp definition allowing to specify patchingConfiguration. + */ + interface WithPatchingConfiguration { + /** + * Specifies the patchingConfiguration property: Container App auto patch configuration.. + * + * @param patchingConfiguration Container App auto patch configuration. + * @return the next definition stage. + */ + WithCreate withPatchingConfiguration(ContainerAppPropertiesPatchingConfiguration patchingConfiguration); + } + /** * The stage of the ContainerApp definition allowing to specify configuration. */ @@ -405,8 +452,8 @@ interface WithTemplate { * The template for ContainerApp update. */ interface Update extends UpdateStages.WithTags, UpdateStages.WithExtendedLocation, UpdateStages.WithIdentity, - UpdateStages.WithManagedBy, UpdateStages.WithWorkloadProfileName, UpdateStages.WithConfiguration, - UpdateStages.WithTemplate { + UpdateStages.WithManagedBy, UpdateStages.WithWorkloadProfileName, UpdateStages.WithPatchingConfiguration, + UpdateStages.WithConfiguration, UpdateStages.WithTemplate { /** * Executes the update request. * @@ -499,6 +546,19 @@ interface WithWorkloadProfileName { Update withWorkloadProfileName(String workloadProfileName); } + /** + * The stage of the ContainerApp update allowing to specify patchingConfiguration. + */ + interface WithPatchingConfiguration { + /** + * Specifies the patchingConfiguration property: Container App auto patch configuration.. + * + * @param patchingConfiguration Container App auto patch configuration. + * @return the next definition stage. + */ + Update withPatchingConfiguration(ContainerAppPropertiesPatchingConfiguration patchingConfiguration); + } + /** * The stage of the ContainerApp update allowing to specify configuration. */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppCollection.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppCollection.java index 5a225b40667c..1a61963f8c2d 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppCollection.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppCollection.java @@ -6,25 +6,27 @@ 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.appcontainers.fluent.models.ContainerAppInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * Container App collection ARM resource. */ @Fluent -public final class ContainerAppCollection { +public final class ContainerAppCollection implements JsonSerializable { /* * Collection of resources. */ - @JsonProperty(value = "value", required = true) private List value; /* * Link to next page of resources. */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; /** @@ -69,12 +71,52 @@ public String nextLink() { */ public void validate() { if (value() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property value in model ContainerAppCollection")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model ContainerAppCollection")); } else { value().forEach(e -> e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(ContainerAppCollection.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerAppCollection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerAppCollection 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 ContainerAppCollection. + */ + public static ContainerAppCollection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerAppCollection deserializedContainerAppCollection = new ContainerAppCollection(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> ContainerAppInner.fromJson(reader1)); + deserializedContainerAppCollection.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedContainerAppCollection.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedContainerAppCollection; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppContainerRunningState.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppContainerRunningState.java index 861d6514b3b4..2345993fbb89 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppContainerRunningState.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppContainerRunningState.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -42,7 +41,6 @@ public ContainerAppContainerRunningState() { * @param name a name to look for. * @return the corresponding ContainerAppContainerRunningState. */ - @JsonCreator public static ContainerAppContainerRunningState fromString(String name) { return fromString(name, ContainerAppContainerRunningState.class); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppProbe.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppProbe.java index 907cf9dd9aae..417fa0b3698c 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppProbe.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppProbe.java @@ -5,51 +5,49 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Probe describes a health check to be performed against a container to determine whether it is alive or ready to * receive traffic. */ @Fluent -public final class ContainerAppProbe { +public final class ContainerAppProbe implements JsonSerializable { /* - * Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. - * Minimum value is 1. Maximum value is 10. + * Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum + * value is 1. Maximum value is 10. */ - @JsonProperty(value = "failureThreshold") private Integer failureThreshold; /* * HTTPGet specifies the http request to perform. */ - @JsonProperty(value = "httpGet") private ContainerAppProbeHttpGet httpGet; /* * Number of seconds after the container has started before liveness probes are initiated. Minimum value is 1. * Maximum value is 60. */ - @JsonProperty(value = "initialDelaySeconds") private Integer initialDelaySeconds; /* * How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1. Maximum value is 240. */ - @JsonProperty(value = "periodSeconds") private Integer periodSeconds; /* * Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must * be 1 for liveness and startup. Minimum value is 1. Maximum value is 10. */ - @JsonProperty(value = "successThreshold") private Integer successThreshold; /* * TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported. */ - @JsonProperty(value = "tcpSocket") private ContainerAppProbeTcpSocket tcpSocket; /* @@ -61,20 +59,17 @@ public final class ContainerAppProbe { * immediately via the kill signal (no opportunity to shut down). This is an alpha field and requires enabling * ProbeTerminationGracePeriod feature gate. Maximum value is 3600 seconds (1 hour) */ - @JsonProperty(value = "terminationGracePeriodSeconds") private Long terminationGracePeriodSeconds; /* * Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. Maximum value is * 240. */ - @JsonProperty(value = "timeoutSeconds") private Integer timeoutSeconds; /* * The type of probe. */ - @JsonProperty(value = "type") private Type type; /** @@ -148,8 +143,8 @@ public ContainerAppProbe withInitialDelaySeconds(Integer initialDelaySeconds) { } /** - * Get the periodSeconds property: How often (in seconds) to perform the probe. Default to 10 seconds. Minimum - * value is 1. Maximum value is 240. + * Get the periodSeconds property: How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value + * is 1. Maximum value is 240. * * @return the periodSeconds value. */ @@ -158,8 +153,8 @@ public Integer periodSeconds() { } /** - * Set the periodSeconds property: How often (in seconds) to perform the probe. Default to 10 seconds. Minimum - * value is 1. Maximum value is 240. + * Set the periodSeconds property: How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value + * is 1. Maximum value is 240. * * @param periodSeconds the periodSeconds value to set. * @return the ContainerAppProbe object itself. @@ -213,13 +208,13 @@ public ContainerAppProbe withTcpSocket(ContainerAppProbeTcpSocket tcpSocket) { /** * Get the terminationGracePeriodSeconds property: Optional duration in seconds the pod needs to terminate - * gracefully upon probe failure. The grace period is the duration in seconds after the processes running in the - * pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set - * this value longer than the expected cleanup time for your process. If this value is nil, the pod's + * gracefully upon probe failure. The grace period is the duration in seconds after the processes running in the pod + * are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this + * value longer than the expected cleanup time for your process. If this value is nil, the pod's * terminationGracePeriodSeconds will be used. Otherwise, this value overrides the value provided by the pod spec. - * Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no - * opportunity to shut down). This is an alpha field and requires enabling ProbeTerminationGracePeriod feature - * gate. Maximum value is 3600 seconds (1 hour). + * Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity + * to shut down). This is an alpha field and requires enabling ProbeTerminationGracePeriod feature gate. Maximum + * value is 3600 seconds (1 hour). * * @return the terminationGracePeriodSeconds value. */ @@ -229,13 +224,13 @@ public Long terminationGracePeriodSeconds() { /** * Set the terminationGracePeriodSeconds property: Optional duration in seconds the pod needs to terminate - * gracefully upon probe failure. The grace period is the duration in seconds after the processes running in the - * pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set - * this value longer than the expected cleanup time for your process. If this value is nil, the pod's + * gracefully upon probe failure. The grace period is the duration in seconds after the processes running in the pod + * are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this + * value longer than the expected cleanup time for your process. If this value is nil, the pod's * terminationGracePeriodSeconds will be used. Otherwise, this value overrides the value provided by the pod spec. - * Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no - * opportunity to shut down). This is an alpha field and requires enabling ProbeTerminationGracePeriod feature - * gate. Maximum value is 3600 seconds (1 hour). + * Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity + * to shut down). This is an alpha field and requires enabling ProbeTerminationGracePeriod feature gate. Maximum + * value is 3600 seconds (1 hour). * * @param terminationGracePeriodSeconds the terminationGracePeriodSeconds value to set. * @return the ContainerAppProbe object itself. @@ -246,8 +241,8 @@ public ContainerAppProbe withTerminationGracePeriodSeconds(Long terminationGrace } /** - * Get the timeoutSeconds property: Number of seconds after which the probe times out. Defaults to 1 second. - * Minimum value is 1. Maximum value is 240. + * Get the timeoutSeconds property: Number of seconds after which the probe times out. Defaults to 1 second. Minimum + * value is 1. Maximum value is 240. * * @return the timeoutSeconds value. */ @@ -256,8 +251,8 @@ public Integer timeoutSeconds() { } /** - * Set the timeoutSeconds property: Number of seconds after which the probe times out. Defaults to 1 second. - * Minimum value is 1. Maximum value is 240. + * Set the timeoutSeconds property: Number of seconds after which the probe times out. Defaults to 1 second. Minimum + * value is 1. Maximum value is 240. * * @param timeoutSeconds the timeoutSeconds value to set. * @return the ContainerAppProbe object itself. @@ -300,4 +295,65 @@ public void validate() { tcpSocket().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("failureThreshold", this.failureThreshold); + jsonWriter.writeJsonField("httpGet", this.httpGet); + jsonWriter.writeNumberField("initialDelaySeconds", this.initialDelaySeconds); + jsonWriter.writeNumberField("periodSeconds", this.periodSeconds); + jsonWriter.writeNumberField("successThreshold", this.successThreshold); + jsonWriter.writeJsonField("tcpSocket", this.tcpSocket); + jsonWriter.writeNumberField("terminationGracePeriodSeconds", this.terminationGracePeriodSeconds); + jsonWriter.writeNumberField("timeoutSeconds", this.timeoutSeconds); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerAppProbe from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerAppProbe if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ContainerAppProbe. + */ + public static ContainerAppProbe fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerAppProbe deserializedContainerAppProbe = new ContainerAppProbe(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("failureThreshold".equals(fieldName)) { + deserializedContainerAppProbe.failureThreshold = reader.getNullable(JsonReader::getInt); + } else if ("httpGet".equals(fieldName)) { + deserializedContainerAppProbe.httpGet = ContainerAppProbeHttpGet.fromJson(reader); + } else if ("initialDelaySeconds".equals(fieldName)) { + deserializedContainerAppProbe.initialDelaySeconds = reader.getNullable(JsonReader::getInt); + } else if ("periodSeconds".equals(fieldName)) { + deserializedContainerAppProbe.periodSeconds = reader.getNullable(JsonReader::getInt); + } else if ("successThreshold".equals(fieldName)) { + deserializedContainerAppProbe.successThreshold = reader.getNullable(JsonReader::getInt); + } else if ("tcpSocket".equals(fieldName)) { + deserializedContainerAppProbe.tcpSocket = ContainerAppProbeTcpSocket.fromJson(reader); + } else if ("terminationGracePeriodSeconds".equals(fieldName)) { + deserializedContainerAppProbe.terminationGracePeriodSeconds + = reader.getNullable(JsonReader::getLong); + } else if ("timeoutSeconds".equals(fieldName)) { + deserializedContainerAppProbe.timeoutSeconds = reader.getNullable(JsonReader::getInt); + } else if ("type".equals(fieldName)) { + deserializedContainerAppProbe.type = Type.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedContainerAppProbe; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppProbeHttpGet.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppProbeHttpGet.java index 1de99cf72dbb..75cd7d1ccba7 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppProbeHttpGet.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppProbeHttpGet.java @@ -5,43 +5,42 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.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; /** * HTTPGet specifies the http request to perform. */ @Fluent -public final class ContainerAppProbeHttpGet { +public final class ContainerAppProbeHttpGet implements JsonSerializable { /* * Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. */ - @JsonProperty(value = "host") private String host; /* * Custom headers to set in the request. HTTP allows repeated headers. */ - @JsonProperty(value = "httpHeaders") private List httpHeaders; /* * Path to access on the HTTP server. */ - @JsonProperty(value = "path") private String path; /* * Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an * IANA_SVC_NAME. */ - @JsonProperty(value = "port", required = true) private int port; /* * Scheme to use for connecting to the host. Defaults to HTTP. */ - @JsonProperty(value = "scheme") private Scheme scheme; /** @@ -164,4 +163,55 @@ public void validate() { httpHeaders().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("port", this.port); + jsonWriter.writeStringField("host", this.host); + jsonWriter.writeArrayField("httpHeaders", this.httpHeaders, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("path", this.path); + jsonWriter.writeStringField("scheme", this.scheme == null ? null : this.scheme.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerAppProbeHttpGet from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerAppProbeHttpGet 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 ContainerAppProbeHttpGet. + */ + public static ContainerAppProbeHttpGet fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerAppProbeHttpGet deserializedContainerAppProbeHttpGet = new ContainerAppProbeHttpGet(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("port".equals(fieldName)) { + deserializedContainerAppProbeHttpGet.port = reader.getInt(); + } else if ("host".equals(fieldName)) { + deserializedContainerAppProbeHttpGet.host = reader.getString(); + } else if ("httpHeaders".equals(fieldName)) { + List httpHeaders + = reader.readArray(reader1 -> ContainerAppProbeHttpGetHttpHeadersItem.fromJson(reader1)); + deserializedContainerAppProbeHttpGet.httpHeaders = httpHeaders; + } else if ("path".equals(fieldName)) { + deserializedContainerAppProbeHttpGet.path = reader.getString(); + } else if ("scheme".equals(fieldName)) { + deserializedContainerAppProbeHttpGet.scheme = Scheme.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedContainerAppProbeHttpGet; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppProbeHttpGetHttpHeadersItem.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppProbeHttpGetHttpHeadersItem.java index 2c9e5d980c59..4c947e5689a2 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppProbeHttpGetHttpHeadersItem.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppProbeHttpGetHttpHeadersItem.java @@ -6,23 +6,26 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * HTTPHeader describes a custom header to be used in HTTP probes. */ @Fluent -public final class ContainerAppProbeHttpGetHttpHeadersItem { +public final class ContainerAppProbeHttpGetHttpHeadersItem + implements JsonSerializable { /* * The header field name */ - @JsonProperty(value = "name", required = true) private String name; /* * The header field value */ - @JsonProperty(value = "value", required = true) private String value; /** @@ -78,14 +81,57 @@ public ContainerAppProbeHttpGetHttpHeadersItem withValue(String value) { */ public void validate() { if (name() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property name in model ContainerAppProbeHttpGetHttpHeadersItem")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property name in model ContainerAppProbeHttpGetHttpHeadersItem")); } if (value() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property value in model ContainerAppProbeHttpGetHttpHeadersItem")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model ContainerAppProbeHttpGetHttpHeadersItem")); } } private static final ClientLogger LOGGER = new ClientLogger(ContainerAppProbeHttpGetHttpHeadersItem.class); + + /** + * {@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 ContainerAppProbeHttpGetHttpHeadersItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerAppProbeHttpGetHttpHeadersItem 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 ContainerAppProbeHttpGetHttpHeadersItem. + */ + public static ContainerAppProbeHttpGetHttpHeadersItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerAppProbeHttpGetHttpHeadersItem deserializedContainerAppProbeHttpGetHttpHeadersItem + = new ContainerAppProbeHttpGetHttpHeadersItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedContainerAppProbeHttpGetHttpHeadersItem.name = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedContainerAppProbeHttpGetHttpHeadersItem.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedContainerAppProbeHttpGetHttpHeadersItem; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppProbeTcpSocket.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppProbeTcpSocket.java index 271d066feefb..bf143f4a5f77 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppProbeTcpSocket.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppProbeTcpSocket.java @@ -5,24 +5,26 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported. */ @Fluent -public final class ContainerAppProbeTcpSocket { +public final class ContainerAppProbeTcpSocket implements JsonSerializable { /* * Optional: Host name to connect to, defaults to the pod IP. */ - @JsonProperty(value = "host") private String host; /* * Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an * IANA_SVC_NAME. */ - @JsonProperty(value = "port", required = true) private int port; /** @@ -80,4 +82,44 @@ public ContainerAppProbeTcpSocket withPort(int port) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("port", this.port); + jsonWriter.writeStringField("host", this.host); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerAppProbeTcpSocket from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerAppProbeTcpSocket 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 ContainerAppProbeTcpSocket. + */ + public static ContainerAppProbeTcpSocket fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerAppProbeTcpSocket deserializedContainerAppProbeTcpSocket = new ContainerAppProbeTcpSocket(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("port".equals(fieldName)) { + deserializedContainerAppProbeTcpSocket.port = reader.getInt(); + } else if ("host".equals(fieldName)) { + deserializedContainerAppProbeTcpSocket.host = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedContainerAppProbeTcpSocket; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppPropertiesPatchingConfiguration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppPropertiesPatchingConfiguration.java new file mode 100644 index 000000000000..538fd7361ad8 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppPropertiesPatchingConfiguration.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.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Container App auto patch configuration. + */ +@Fluent +public final class ContainerAppPropertiesPatchingConfiguration + implements JsonSerializable { + /* + * Patching mode for the container app. Null or default in this field will be interpreted as Automatic by RP. + * Automatic mode will automatically apply available patches. Manual mode will require the user to manually apply + * patches. Disabled mode will stop patch detection and auto patching. + */ + private PatchingMode patchingMode; + + /** + * Creates an instance of ContainerAppPropertiesPatchingConfiguration class. + */ + public ContainerAppPropertiesPatchingConfiguration() { + } + + /** + * Get the patchingMode property: Patching mode for the container app. Null or default in this field will be + * interpreted as Automatic by RP. Automatic mode will automatically apply available patches. Manual mode will + * require the user to manually apply patches. Disabled mode will stop patch detection and auto patching. + * + * @return the patchingMode value. + */ + public PatchingMode patchingMode() { + return this.patchingMode; + } + + /** + * Set the patchingMode property: Patching mode for the container app. Null or default in this field will be + * interpreted as Automatic by RP. Automatic mode will automatically apply available patches. Manual mode will + * require the user to manually apply patches. Disabled mode will stop patch detection and auto patching. + * + * @param patchingMode the patchingMode value to set. + * @return the ContainerAppPropertiesPatchingConfiguration object itself. + */ + public ContainerAppPropertiesPatchingConfiguration withPatchingMode(PatchingMode patchingMode) { + this.patchingMode = patchingMode; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("patchingMode", this.patchingMode == null ? null : this.patchingMode.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerAppPropertiesPatchingConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerAppPropertiesPatchingConfiguration if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ContainerAppPropertiesPatchingConfiguration. + */ + public static ContainerAppPropertiesPatchingConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerAppPropertiesPatchingConfiguration deserializedContainerAppPropertiesPatchingConfiguration + = new ContainerAppPropertiesPatchingConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("patchingMode".equals(fieldName)) { + deserializedContainerAppPropertiesPatchingConfiguration.patchingMode + = PatchingMode.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedContainerAppPropertiesPatchingConfiguration; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppProvisioningState.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppProvisioningState.java index 9b7718d4b9cf..e7993871a247 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppProvisioningState.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppProvisioningState.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -52,7 +51,6 @@ public ContainerAppProvisioningState() { * @param name a name to look for. * @return the corresponding ContainerAppProvisioningState. */ - @JsonCreator public static ContainerAppProvisioningState fromString(String name) { return fromString(name, ContainerAppProvisioningState.class); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppReplicaRunningState.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppReplicaRunningState.java index fa8058f0d086..327c9eb5b65f 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppReplicaRunningState.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppReplicaRunningState.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -42,7 +41,6 @@ public ContainerAppReplicaRunningState() { * @param name a name to look for. * @return the corresponding ContainerAppReplicaRunningState. */ - @JsonCreator public static ContainerAppReplicaRunningState fromString(String name) { return fromString(name, ContainerAppReplicaRunningState.class); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppSecret.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppSecret.java index 023aaea23ec4..c647d95cff2b 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppSecret.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppSecret.java @@ -5,36 +5,36 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Container App Secret. */ @Immutable -public final class ContainerAppSecret { +public final class ContainerAppSecret implements JsonSerializable { /* * Secret Name. */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) private String name; /* * Secret Value. */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private String value; /* * Resource ID of a managed identity to authenticate with Azure Key Vault, or System to use a system-assigned * identity. */ - @JsonProperty(value = "identity", access = JsonProperty.Access.WRITE_ONLY) private String identity; /* * Azure Key Vault URL pointing to the secret referenced by the container app. */ - @JsonProperty(value = "keyVaultUrl", access = JsonProperty.Access.WRITE_ONLY) private String keyVaultUrl; /** @@ -87,4 +87,45 @@ public String keyVaultUrl() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerAppSecret from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerAppSecret if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ContainerAppSecret. + */ + public static ContainerAppSecret fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerAppSecret deserializedContainerAppSecret = new ContainerAppSecret(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedContainerAppSecret.name = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedContainerAppSecret.value = reader.getString(); + } else if ("identity".equals(fieldName)) { + deserializedContainerAppSecret.identity = reader.getString(); + } else if ("keyVaultUrl".equals(fieldName)) { + deserializedContainerAppSecret.keyVaultUrl = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedContainerAppSecret; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsBuildCollection.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsBuildCollection.java new file mode 100644 index 000000000000..d0764cdbf52f --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsBuildCollection.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.appcontainers.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.appcontainers.fluent.models.ContainerAppsBuildResourceInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a Container Apps Build Resource list operation. + */ +@Fluent +public final class ContainerAppsBuildCollection implements JsonSerializable { + /* + * The Container Apps Build Resource items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of ContainerAppsBuildCollection class. + */ + public ContainerAppsBuildCollection() { + } + + /** + * Get the value property: The Container Apps Build Resource items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The Container Apps Build Resource items on this page. + * + * @param value the value value to set. + * @return the ContainerAppsBuildCollection object itself. + */ + public ContainerAppsBuildCollection 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 ContainerAppsBuildCollection object itself. + */ + public ContainerAppsBuildCollection 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 ContainerAppsBuildCollection")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ContainerAppsBuildCollection.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 ContainerAppsBuildCollection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerAppsBuildCollection 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 ContainerAppsBuildCollection. + */ + public static ContainerAppsBuildCollection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerAppsBuildCollection deserializedContainerAppsBuildCollection = new ContainerAppsBuildCollection(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ContainerAppsBuildResourceInner.fromJson(reader1)); + deserializedContainerAppsBuildCollection.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedContainerAppsBuildCollection.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedContainerAppsBuildCollection; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsBuildConfiguration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsBuildConfiguration.java new file mode 100644 index 000000000000..1404749df225 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsBuildConfiguration.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.appcontainers.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; +import java.util.List; + +/** + * Configuration of the build. + */ +@Immutable +public final class ContainerAppsBuildConfiguration implements JsonSerializable { + /* + * Base OS used to build and run the app. + */ + private String baseOs; + + /* + * Platform to be used to build and run the app. + */ + private String platform; + + /* + * Platform version to be used to build and run the app. + */ + private String platformVersion; + + /* + * List of environment variables to be passed to the build, secrets should not be used in environment variable. + */ + private List environmentVariables; + + /* + * List of steps to perform before the build. + */ + private List preBuildSteps; + + /** + * Creates an instance of ContainerAppsBuildConfiguration class. + */ + public ContainerAppsBuildConfiguration() { + } + + /** + * Get the baseOs property: Base OS used to build and run the app. + * + * @return the baseOs value. + */ + public String baseOs() { + return this.baseOs; + } + + /** + * Get the platform property: Platform to be used to build and run the app. + * + * @return the platform value. + */ + public String platform() { + return this.platform; + } + + /** + * Get the platformVersion property: Platform version to be used to build and run the app. + * + * @return the platformVersion value. + */ + public String platformVersion() { + return this.platformVersion; + } + + /** + * Get the environmentVariables property: List of environment variables to be passed to the build, secrets should + * not be used in environment variable. + * + * @return the environmentVariables value. + */ + public List environmentVariables() { + return this.environmentVariables; + } + + /** + * Get the preBuildSteps property: List of steps to perform before the build. + * + * @return the preBuildSteps value. + */ + public List preBuildSteps() { + return this.preBuildSteps; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (environmentVariables() != null) { + environmentVariables().forEach(e -> e.validate()); + } + if (preBuildSteps() != null) { + preBuildSteps().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerAppsBuildConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerAppsBuildConfiguration if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ContainerAppsBuildConfiguration. + */ + public static ContainerAppsBuildConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerAppsBuildConfiguration deserializedContainerAppsBuildConfiguration + = new ContainerAppsBuildConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("baseOs".equals(fieldName)) { + deserializedContainerAppsBuildConfiguration.baseOs = reader.getString(); + } else if ("platform".equals(fieldName)) { + deserializedContainerAppsBuildConfiguration.platform = reader.getString(); + } else if ("platformVersion".equals(fieldName)) { + deserializedContainerAppsBuildConfiguration.platformVersion = reader.getString(); + } else if ("environmentVariables".equals(fieldName)) { + List environmentVariables + = reader.readArray(reader1 -> EnvironmentVariable.fromJson(reader1)); + deserializedContainerAppsBuildConfiguration.environmentVariables = environmentVariables; + } else if ("preBuildSteps".equals(fieldName)) { + List preBuildSteps = reader.readArray(reader1 -> PreBuildStep.fromJson(reader1)); + deserializedContainerAppsBuildConfiguration.preBuildSteps = preBuildSteps; + } else { + reader.skipChildren(); + } + } + + return deserializedContainerAppsBuildConfiguration; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsBuildResource.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsBuildResource.java new file mode 100644 index 000000000000..e0a93c5e4895 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsBuildResource.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.appcontainers.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appcontainers.fluent.models.ContainerAppsBuildResourceInner; + +/** + * An immutable client-side representation of ContainerAppsBuildResource. + */ +public interface ContainerAppsBuildResource { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: Build provisioning state. + * + * @return the provisioningState value. + */ + BuildProvisioningState provisioningState(); + + /** + * Gets the buildStatus property: Status of the build once it has been provisioned. + * + * @return the buildStatus value. + */ + BuildStatus buildStatus(); + + /** + * Gets the destinationContainerRegistry property: Container registry that the final image will be uploaded to. + * + * @return the destinationContainerRegistry value. + */ + ContainerRegistryWithCustomImage destinationContainerRegistry(); + + /** + * Gets the configuration property: Configuration of the build. + * + * @return the configuration value. + */ + ContainerAppsBuildConfiguration configuration(); + + /** + * Gets the logStreamEndpoint property: Endpoint from which the build logs can be streamed. + * + * @return the logStreamEndpoint value. + */ + String logStreamEndpoint(); + + /** + * Gets the inner com.azure.resourcemanager.appcontainers.fluent.models.ContainerAppsBuildResourceInner object. + * + * @return the inner object. + */ + ContainerAppsBuildResourceInner innerModel(); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsBuilds.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsBuilds.java new file mode 100644 index 000000000000..293579325fa1 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsBuilds.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.appcontainers.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of ContainerAppsBuilds. + */ +public interface ContainerAppsBuilds { + /** + * Get a Container Apps Build resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Build is associated. + * @param buildName The name of a build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Container Apps Build resource along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String containerAppName, + String buildName, Context context); + + /** + * Get a Container Apps Build resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Build is associated. + * @param buildName The name of a build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Container Apps Build resource. + */ + ContainerAppsBuildResource get(String resourceGroupName, String containerAppName, String buildName); + + /** + * Delete a Container Apps Build resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Build is associated. + * @param buildName The name of a build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 containerAppName, String buildName); + + /** + * Delete a Container Apps Build resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Build is associated. + * @param buildName The name of a build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 containerAppName, String buildName, Context context); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsBuildsByContainerApps.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsBuildsByContainerApps.java new file mode 100644 index 000000000000..bb61f0cf9013 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsBuildsByContainerApps.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.appcontainers.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** + * Resource collection API of ContainerAppsBuildsByContainerApps. + */ +public interface ContainerAppsBuildsByContainerApps { + /** + * List Container Apps Build resources by Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Build is associated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Container Apps Build Resource list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String containerAppName); + + /** + * List Container Apps Build resources by Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Build is associated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Container Apps Build Resource list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String containerAppName, Context context); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsPatchResource.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsPatchResource.java new file mode 100644 index 000000000000..0a032a7e86e3 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsPatchResource.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.appcontainers.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appcontainers.fluent.models.ContainerAppsPatchResourceInner; + +/** + * An immutable client-side representation of ContainerAppsPatchResource. + */ +public interface ContainerAppsPatchResource { + /** + * 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: Properties that describes current states of the patch resource. + * + * @return the properties value. + */ + PatchProperties 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.appcontainers.fluent.models.ContainerAppsPatchResourceInner object. + * + * @return the inner object. + */ + ContainerAppsPatchResourceInner innerModel(); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsPatches.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsPatches.java new file mode 100644 index 000000000000..04509a19a50e --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsPatches.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.appcontainers.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 ContainerAppsPatches. + */ +public interface ContainerAppsPatches { + /** + * List Container Apps Patch resources by ContainerApp. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App patch collection as paginated response with {@link PagedIterable}. + */ + PagedIterable listByContainerApp(String resourceGroupName, String containerAppName); + + /** + * List Container Apps Patch resources by ContainerApp. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param filter The filter to apply on the operation. For example, $filter=properties/patchApplyStatus eq + * 'Succeeded'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App patch collection as paginated response with {@link PagedIterable}. + */ + PagedIterable listByContainerApp(String resourceGroupName, String containerAppName, + String filter, Context context); + + /** + * Get details for specific Container Apps Patch by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details for specific Container Apps Patch by patch name along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String containerAppName, + String patchName, Context context); + + /** + * Get details for specific Container Apps Patch by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details for specific Container Apps Patch by patch name. + */ + ContainerAppsPatchResource get(String resourceGroupName, String containerAppName, String patchName); + + /** + * Delete specific Container Apps Patch by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 containerAppName, String patchName); + + /** + * Delete specific Container Apps Patch by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 containerAppName, String patchName, Context context); + + /** + * Configure the Container Apps Patch skip option by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param patchSkipConfig Configure patcher to skip a patch or not. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void skipConfigure(String resourceGroupName, String containerAppName, String patchName, + PatchSkipConfig patchSkipConfig); + + /** + * Configure the Container Apps Patch skip option by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param patchSkipConfig Configure patcher to skip a patch or not. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void skipConfigure(String resourceGroupName, String containerAppName, String patchName, + PatchSkipConfig patchSkipConfig, Context context); + + /** + * Apply a Container Apps Patch resource with patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App Patch. + */ + ContainerAppsPatchResource apply(String resourceGroupName, String containerAppName, String patchName); + + /** + * Apply a Container Apps Patch resource with patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App Patch. + */ + ContainerAppsPatchResource apply(String resourceGroupName, String containerAppName, String patchName, + Context context); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsSessionPools.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsSessionPools.java new file mode 100644 index 000000000000..7e2d6e365e21 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsSessionPools.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.appcontainers.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 ContainerAppsSessionPools. + */ +public interface ContainerAppsSessionPools { + /** + * Get the session pools in a given subscription. + * + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the session pools in a given subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Get the session pools in a given subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the session pools in a given subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Get the session pools in a given resource group of a subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the session pools in a given resource group of a subscription as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Get the session pools in a given resource group of a subscription. + * + * @param resourceGroupName The name of the resource 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.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the session pools in a given resource group of a subscription as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get the properties of a session pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a session pool along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String sessionPoolName, + Context context); + + /** + * Get the properties of a session pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a session pool. + */ + SessionPool getByResourceGroup(String resourceGroupName, String sessionPoolName); + + /** + * Delete a session pool. + * + * Delete the session pool with the given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException 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 sessionPoolName); + + /** + * Delete a session pool. + * + * Delete the session pool with the given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException 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 sessionPoolName, Context context); + + /** + * Get the properties of a session pool. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a session pool along with {@link Response}. + */ + SessionPool getById(String id); + + /** + * Get the properties of a session pool. + * + * @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.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a session pool along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a session pool. + * + * Delete the session pool with the given name. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException 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 session pool. + * + * Delete the session pool with the given name. + * + * @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.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException 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 SessionPool resource. + * + * @param name resource name. + * @return the first stage of the new SessionPool definition. + */ + SessionPool.DefinitionStages.Blank define(String name); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerExecutionStatus.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerExecutionStatus.java new file mode 100644 index 000000000000..0ca01e367769 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerExecutionStatus.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.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Container Apps Job execution container status. Contains status code and reason. + */ +@Fluent +public final class ContainerExecutionStatus implements JsonSerializable { + /* + * Container Name. + */ + private String name; + + /* + * Exit code + */ + private Integer code; + + /* + * Additional information for the container status + */ + private String additionalInformation; + + /* + * Status of the container + */ + private String status; + + /** + * Creates an instance of ContainerExecutionStatus class. + */ + public ContainerExecutionStatus() { + } + + /** + * Get the name property: Container Name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Container Name. + * + * @param name the name value to set. + * @return the ContainerExecutionStatus object itself. + */ + public ContainerExecutionStatus withName(String name) { + this.name = name; + return this; + } + + /** + * Get the code property: Exit code. + * + * @return the code value. + */ + public Integer code() { + return this.code; + } + + /** + * Set the code property: Exit code. + * + * @param code the code value to set. + * @return the ContainerExecutionStatus object itself. + */ + public ContainerExecutionStatus withCode(Integer code) { + this.code = code; + return this; + } + + /** + * Get the additionalInformation property: Additional information for the container status. + * + * @return the additionalInformation value. + */ + public String additionalInformation() { + return this.additionalInformation; + } + + /** + * Set the additionalInformation property: Additional information for the container status. + * + * @param additionalInformation the additionalInformation value to set. + * @return the ContainerExecutionStatus object itself. + */ + public ContainerExecutionStatus withAdditionalInformation(String additionalInformation) { + this.additionalInformation = additionalInformation; + return this; + } + + /** + * Get the status property: Status of the container. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Set the status property: Status of the container. + * + * @param status the status value to set. + * @return the ContainerExecutionStatus object itself. + */ + public ContainerExecutionStatus 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.writeNumberField("code", this.code); + jsonWriter.writeStringField("additionalInformation", this.additionalInformation); + jsonWriter.writeStringField("status", this.status); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerExecutionStatus from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerExecutionStatus if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ContainerExecutionStatus. + */ + public static ContainerExecutionStatus fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerExecutionStatus deserializedContainerExecutionStatus = new ContainerExecutionStatus(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedContainerExecutionStatus.name = reader.getString(); + } else if ("code".equals(fieldName)) { + deserializedContainerExecutionStatus.code = reader.getNullable(JsonReader::getInt); + } else if ("additionalInformation".equals(fieldName)) { + deserializedContainerExecutionStatus.additionalInformation = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedContainerExecutionStatus.status = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedContainerExecutionStatus; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerRegistry.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerRegistry.java index 8c1b99939147..a20c60c56254 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerRegistry.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerRegistry.java @@ -6,23 +6,25 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Model representing a mapping from a container registry to the identity used to connect to it. */ @Fluent -public final class ContainerRegistry { +public final class ContainerRegistry implements JsonSerializable { /* * Login server of the container registry. */ - @JsonProperty(value = "containerRegistryServer", required = true) private String containerRegistryServer; /* * Resource ID of the managed identity. */ - @JsonProperty(value = "identityResourceId", required = true) private String identityResourceId; /** @@ -78,14 +80,56 @@ public ContainerRegistry withIdentityResourceId(String identityResourceId) { */ public void validate() { if (containerRegistryServer() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property containerRegistryServer in model ContainerRegistry")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property containerRegistryServer in model ContainerRegistry")); } if (identityResourceId() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property identityResourceId in model ContainerRegistry")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property identityResourceId in model ContainerRegistry")); } } private static final ClientLogger LOGGER = new ClientLogger(ContainerRegistry.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("containerRegistryServer", this.containerRegistryServer); + jsonWriter.writeStringField("identityResourceId", this.identityResourceId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerRegistry from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerRegistry 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 ContainerRegistry. + */ + public static ContainerRegistry fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerRegistry deserializedContainerRegistry = new ContainerRegistry(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("containerRegistryServer".equals(fieldName)) { + deserializedContainerRegistry.containerRegistryServer = reader.getString(); + } else if ("identityResourceId".equals(fieldName)) { + deserializedContainerRegistry.identityResourceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedContainerRegistry; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerRegistryWithCustomImage.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerRegistryWithCustomImage.java index 2682fc52cb1f..aefd2633fb20 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerRegistryWithCustomImage.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerRegistryWithCustomImage.java @@ -6,24 +6,26 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Container registry that the final image will be uploaded to. */ @Fluent -public final class ContainerRegistryWithCustomImage { +public final class ContainerRegistryWithCustomImage implements JsonSerializable { /* - * Login server of the container registry that the final image should be uploaded to. Builder resource needs to - * have this container registry defined along with an identity to use to access it. + * Login server of the container registry that the final image should be uploaded to. Builder resource needs to have + * this container registry defined along with an identity to use to access it. */ - @JsonProperty(value = "server", required = true) private String server; /* * Full name that the final image should be uploaded as, including both image name and tag. */ - @JsonProperty(value = "image") private String image; /** @@ -81,10 +83,52 @@ public ContainerRegistryWithCustomImage withImage(String image) { */ public void validate() { if (server() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property server in model ContainerRegistryWithCustomImage")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property server in model ContainerRegistryWithCustomImage")); } } private static final ClientLogger LOGGER = new ClientLogger(ContainerRegistryWithCustomImage.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("server", this.server); + jsonWriter.writeStringField("image", this.image); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerRegistryWithCustomImage from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerRegistryWithCustomImage 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 ContainerRegistryWithCustomImage. + */ + public static ContainerRegistryWithCustomImage fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerRegistryWithCustomImage deserializedContainerRegistryWithCustomImage + = new ContainerRegistryWithCustomImage(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("server".equals(fieldName)) { + deserializedContainerRegistryWithCustomImage.server = reader.getString(); + } else if ("image".equals(fieldName)) { + deserializedContainerRegistryWithCustomImage.image = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedContainerRegistryWithCustomImage; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerResources.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerResources.java index eb5ba7e7e19d..5e43d89033e1 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerResources.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerResources.java @@ -5,29 +5,30 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Container App container resource requirements. */ @Fluent -public final class ContainerResources { +public final class ContainerResources implements JsonSerializable { /* * Required CPU in cores, e.g. 0.5 */ - @JsonProperty(value = "cpu") private Double cpu; /* * Required memory, e.g. "250Mb" */ - @JsonProperty(value = "memory") private String memory; /* * Ephemeral Storage, e.g. "1Gi" */ - @JsonProperty(value = "ephemeralStorage", access = JsonProperty.Access.WRITE_ONLY) private String ephemeralStorage; /** @@ -92,4 +93,45 @@ public String ephemeralStorage() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("cpu", this.cpu); + jsonWriter.writeStringField("memory", this.memory); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerResources from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerResources if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ContainerResources. + */ + public static ContainerResources fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerResources deserializedContainerResources = new ContainerResources(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("cpu".equals(fieldName)) { + deserializedContainerResources.cpu = reader.getNullable(JsonReader::getDouble); + } else if ("memory".equals(fieldName)) { + deserializedContainerResources.memory = reader.getString(); + } else if ("ephemeralStorage".equals(fieldName)) { + deserializedContainerResources.ephemeralStorage = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedContainerResources; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerType.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerType.java new file mode 100644 index 000000000000..e8b2e7cc4a58 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerType.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.appcontainers.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The container type of the sessions. + */ +public final class ContainerType extends ExpandableStringEnum { + /** + * Static value CustomContainer for ContainerType. + */ + public static final ContainerType CUSTOM_CONTAINER = fromString("CustomContainer"); + + /** + * Static value PythonLTS for ContainerType. + */ + public static final ContainerType PYTHON_LTS = fromString("PythonLTS"); + + /** + * Creates a new instance of ContainerType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ContainerType() { + } + + /** + * Creates or finds a ContainerType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ContainerType. + */ + public static ContainerType fromString(String name) { + return fromString(name, ContainerType.class); + } + + /** + * Gets known ContainerType values. + * + * @return known ContainerType values. + */ + public static Collection values() { + return values(ContainerType.class); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CookieExpiration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CookieExpiration.java index 5b4454d8e747..da298489c89e 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CookieExpiration.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CookieExpiration.java @@ -5,23 +5,25 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The configuration settings of the session cookie's expiration. */ @Fluent -public final class CookieExpiration { +public final class CookieExpiration implements JsonSerializable { /* * The convention used when determining the session cookie's expiration. */ - @JsonProperty(value = "convention") private CookieExpirationConvention convention; /* * The time after the request is made when the session cookie should expire. */ - @JsonProperty(value = "timeToExpiration") private String timeToExpiration; /** @@ -77,4 +79,43 @@ public CookieExpiration withTimeToExpiration(String timeToExpiration) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("convention", this.convention == null ? null : this.convention.toString()); + jsonWriter.writeStringField("timeToExpiration", this.timeToExpiration); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CookieExpiration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CookieExpiration if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the CookieExpiration. + */ + public static CookieExpiration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CookieExpiration deserializedCookieExpiration = new CookieExpiration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("convention".equals(fieldName)) { + deserializedCookieExpiration.convention = CookieExpirationConvention.fromString(reader.getString()); + } else if ("timeToExpiration".equals(fieldName)) { + deserializedCookieExpiration.timeToExpiration = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCookieExpiration; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CookieExpirationConvention.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CookieExpirationConvention.java index 8680a3d10e9f..c7940865b546 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CookieExpirationConvention.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CookieExpirationConvention.java @@ -4,9 +4,6 @@ package com.azure.resourcemanager.appcontainers.models; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - /** * The convention used when determining the session cookie's expiration. */ @@ -36,7 +33,6 @@ public enum CookieExpirationConvention { * @param value the serialized value to parse. * @return the parsed CookieExpirationConvention object, or null if unable to parse. */ - @JsonCreator public static CookieExpirationConvention fromString(String value) { if (value == null) { return null; @@ -53,7 +49,6 @@ public static CookieExpirationConvention fromString(String value) { /** * {@inheritDoc} */ - @JsonValue @Override public String toString() { return this.value; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CorsPolicy.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CorsPolicy.java index 9c0a944196c1..29a0f3cf4d68 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CorsPolicy.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CorsPolicy.java @@ -6,48 +6,46 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.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; /** * Cross-Origin-Resource-Sharing policy. */ @Fluent -public final class CorsPolicy { +public final class CorsPolicy implements JsonSerializable { /* * Specifies the content for the access-control-allow-origins header */ - @JsonProperty(value = "allowedOrigins", required = true) private List allowedOrigins; /* * Specifies the content for the access-control-allow-methods header */ - @JsonProperty(value = "allowedMethods") private List allowedMethods; /* * Specifies the content for the access-control-allow-headers header */ - @JsonProperty(value = "allowedHeaders") private List allowedHeaders; /* * Specifies the content for the access-control-expose-headers header */ - @JsonProperty(value = "exposeHeaders") private List exposeHeaders; /* * Specifies the content for the access-control-max-age header */ - @JsonProperty(value = "maxAge") private Integer maxAge; /* * Specifies whether the resource allows credentials */ - @JsonProperty(value = "allowCredentials") private Boolean allowCredentials; /** @@ -183,10 +181,70 @@ public CorsPolicy withAllowCredentials(Boolean allowCredentials) { */ public void validate() { if (allowedOrigins() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property allowedOrigins in model CorsPolicy")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property allowedOrigins in model CorsPolicy")); } } private static final ClientLogger LOGGER = new ClientLogger(CorsPolicy.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("allowedOrigins", this.allowedOrigins, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("allowedMethods", this.allowedMethods, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("allowedHeaders", this.allowedHeaders, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("exposeHeaders", this.exposeHeaders, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeNumberField("maxAge", this.maxAge); + jsonWriter.writeBooleanField("allowCredentials", this.allowCredentials); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CorsPolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CorsPolicy 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 CorsPolicy. + */ + public static CorsPolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CorsPolicy deserializedCorsPolicy = new CorsPolicy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("allowedOrigins".equals(fieldName)) { + List allowedOrigins = reader.readArray(reader1 -> reader1.getString()); + deserializedCorsPolicy.allowedOrigins = allowedOrigins; + } else if ("allowedMethods".equals(fieldName)) { + List allowedMethods = reader.readArray(reader1 -> reader1.getString()); + deserializedCorsPolicy.allowedMethods = allowedMethods; + } else if ("allowedHeaders".equals(fieldName)) { + List allowedHeaders = reader.readArray(reader1 -> reader1.getString()); + deserializedCorsPolicy.allowedHeaders = allowedHeaders; + } else if ("exposeHeaders".equals(fieldName)) { + List exposeHeaders = reader.readArray(reader1 -> reader1.getString()); + deserializedCorsPolicy.exposeHeaders = exposeHeaders; + } else if ("maxAge".equals(fieldName)) { + deserializedCorsPolicy.maxAge = reader.getNullable(JsonReader::getInt); + } else if ("allowCredentials".equals(fieldName)) { + deserializedCorsPolicy.allowCredentials = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedCorsPolicy; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CustomContainerTemplate.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CustomContainerTemplate.java new file mode 100644 index 000000000000..63725b65db72 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CustomContainerTemplate.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.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.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; + +/** + * Custom container configuration. + */ +@Fluent +public final class CustomContainerTemplate implements JsonSerializable { + /* + * Private container registry credentials for containers used by the sessions of the session pool. + */ + private SessionRegistryCredentials registryCredentials; + + /* + * List of container definitions for the sessions of the session pool. + */ + private List containers; + + /* + * Session pool ingress configuration. + */ + private SessionIngress ingress; + + /** + * Creates an instance of CustomContainerTemplate class. + */ + public CustomContainerTemplate() { + } + + /** + * Get the registryCredentials property: Private container registry credentials for containers used by the sessions + * of the session pool. + * + * @return the registryCredentials value. + */ + public SessionRegistryCredentials registryCredentials() { + return this.registryCredentials; + } + + /** + * Set the registryCredentials property: Private container registry credentials for containers used by the sessions + * of the session pool. + * + * @param registryCredentials the registryCredentials value to set. + * @return the CustomContainerTemplate object itself. + */ + public CustomContainerTemplate withRegistryCredentials(SessionRegistryCredentials registryCredentials) { + this.registryCredentials = registryCredentials; + return this; + } + + /** + * Get the containers property: List of container definitions for the sessions of the session pool. + * + * @return the containers value. + */ + public List containers() { + return this.containers; + } + + /** + * Set the containers property: List of container definitions for the sessions of the session pool. + * + * @param containers the containers value to set. + * @return the CustomContainerTemplate object itself. + */ + public CustomContainerTemplate withContainers(List containers) { + this.containers = containers; + return this; + } + + /** + * Get the ingress property: Session pool ingress configuration. + * + * @return the ingress value. + */ + public SessionIngress ingress() { + return this.ingress; + } + + /** + * Set the ingress property: Session pool ingress configuration. + * + * @param ingress the ingress value to set. + * @return the CustomContainerTemplate object itself. + */ + public CustomContainerTemplate withIngress(SessionIngress ingress) { + this.ingress = ingress; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (registryCredentials() != null) { + registryCredentials().validate(); + } + if (containers() != null) { + containers().forEach(e -> e.validate()); + } + if (ingress() != null) { + ingress().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("registryCredentials", this.registryCredentials); + jsonWriter.writeArrayField("containers", this.containers, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("ingress", this.ingress); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CustomContainerTemplate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CustomContainerTemplate if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the CustomContainerTemplate. + */ + public static CustomContainerTemplate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CustomContainerTemplate deserializedCustomContainerTemplate = new CustomContainerTemplate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("registryCredentials".equals(fieldName)) { + deserializedCustomContainerTemplate.registryCredentials + = SessionRegistryCredentials.fromJson(reader); + } else if ("containers".equals(fieldName)) { + List containers = reader.readArray(reader1 -> SessionContainer.fromJson(reader1)); + deserializedCustomContainerTemplate.containers = containers; + } else if ("ingress".equals(fieldName)) { + deserializedCustomContainerTemplate.ingress = SessionIngress.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCustomContainerTemplate; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CustomDomain.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CustomDomain.java index 298c01667aba..d5d83f6444e7 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CustomDomain.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CustomDomain.java @@ -6,29 +6,30 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Custom Domain of a Container App. */ @Fluent -public final class CustomDomain { +public final class CustomDomain implements JsonSerializable { /* * Hostname. */ - @JsonProperty(value = "name", required = true) private String name; /* * Custom Domain binding type. */ - @JsonProperty(value = "bindingType") private BindingType bindingType; /* * Resource Id of the Certificate to be bound to this hostname. Must exist in the Managed Environment. */ - @JsonProperty(value = "certificateId") private String certificateId; /** @@ -106,10 +107,53 @@ public CustomDomain withCertificateId(String certificateId) { */ public void validate() { if (name() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property name in model CustomDomain")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property name in model CustomDomain")); } } private static final ClientLogger LOGGER = new ClientLogger(CustomDomain.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("bindingType", this.bindingType == null ? null : this.bindingType.toString()); + jsonWriter.writeStringField("certificateId", this.certificateId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CustomDomain from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CustomDomain 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 CustomDomain. + */ + public static CustomDomain fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CustomDomain deserializedCustomDomain = new CustomDomain(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedCustomDomain.name = reader.getString(); + } else if ("bindingType".equals(fieldName)) { + deserializedCustomDomain.bindingType = BindingType.fromString(reader.getString()); + } else if ("certificateId".equals(fieldName)) { + deserializedCustomDomain.certificateId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCustomDomain; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CustomDomainConfiguration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CustomDomainConfiguration.java index ba53b980ff5e..543efc3f3adf 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CustomDomainConfiguration.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CustomDomainConfiguration.java @@ -6,60 +6,56 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.CoreUtils; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.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; /** * Configuration properties for apps environment custom domain. */ @Fluent -public final class CustomDomainConfiguration { +public final class CustomDomainConfiguration implements JsonSerializable { /* * Id used to verify domain name ownership */ - @JsonProperty(value = "customDomainVerificationId", access = JsonProperty.Access.WRITE_ONLY) private String customDomainVerificationId; /* * Dns suffix for the environment domain */ - @JsonProperty(value = "dnsSuffix") private String dnsSuffix; /* * Certificate stored in Azure Key Vault. */ - @JsonProperty(value = "certificateKeyVaultProperties") private CertificateKeyVaultProperties certificateKeyVaultProperties; /* * PFX or PEM blob */ - @JsonProperty(value = "certificateValue") private byte[] certificateValue; /* * Certificate password */ - @JsonProperty(value = "certificatePassword") private String certificatePassword; /* * Certificate expiration date. */ - @JsonProperty(value = "expirationDate", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime expirationDate; /* * Certificate thumbprint. */ - @JsonProperty(value = "thumbprint", access = JsonProperty.Access.WRITE_ONLY) private String thumbprint; /* * Subject name of the certificate. */ - @JsonProperty(value = "subjectName", access = JsonProperty.Access.WRITE_ONLY) private String subjectName; /** @@ -195,4 +191,59 @@ public void validate() { certificateKeyVaultProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("dnsSuffix", this.dnsSuffix); + jsonWriter.writeJsonField("certificateKeyVaultProperties", this.certificateKeyVaultProperties); + jsonWriter.writeBinaryField("certificateValue", this.certificateValue); + jsonWriter.writeStringField("certificatePassword", this.certificatePassword); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CustomDomainConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CustomDomainConfiguration if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CustomDomainConfiguration. + */ + public static CustomDomainConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CustomDomainConfiguration deserializedCustomDomainConfiguration = new CustomDomainConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("customDomainVerificationId".equals(fieldName)) { + deserializedCustomDomainConfiguration.customDomainVerificationId = reader.getString(); + } else if ("dnsSuffix".equals(fieldName)) { + deserializedCustomDomainConfiguration.dnsSuffix = reader.getString(); + } else if ("certificateKeyVaultProperties".equals(fieldName)) { + deserializedCustomDomainConfiguration.certificateKeyVaultProperties + = CertificateKeyVaultProperties.fromJson(reader); + } else if ("certificateValue".equals(fieldName)) { + deserializedCustomDomainConfiguration.certificateValue = reader.getBinary(); + } else if ("certificatePassword".equals(fieldName)) { + deserializedCustomDomainConfiguration.certificatePassword = reader.getString(); + } else if ("expirationDate".equals(fieldName)) { + deserializedCustomDomainConfiguration.expirationDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("thumbprint".equals(fieldName)) { + deserializedCustomDomainConfiguration.thumbprint = reader.getString(); + } else if ("subjectName".equals(fieldName)) { + deserializedCustomDomainConfiguration.subjectName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCustomDomainConfiguration; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CustomHostnameAnalysisResultCustomDomainVerificationFailureInfo.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CustomHostnameAnalysisResultCustomDomainVerificationFailureInfo.java index 45529ba9c4b5..12e0c9ad2519 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CustomHostnameAnalysisResultCustomDomainVerificationFailureInfo.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CustomHostnameAnalysisResultCustomDomainVerificationFailureInfo.java @@ -5,36 +5,37 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.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; /** * Raw failure information if DNS verification fails. */ @Fluent -public final class CustomHostnameAnalysisResultCustomDomainVerificationFailureInfo { +public final class CustomHostnameAnalysisResultCustomDomainVerificationFailureInfo + implements JsonSerializable { /* * Standardized string to programmatically identify the error. */ - @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) private String code; /* * Detailed error description and debugging information. */ - @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) private String message; /* * Detailed error description and debugging information. */ - @JsonProperty(value = "target", access = JsonProperty.Access.WRITE_ONLY) private String target; /* * Details or the error */ - @JsonProperty(value = "details") private List details; /** @@ -101,4 +102,55 @@ public void validate() { details().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("details", this.details, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CustomHostnameAnalysisResultCustomDomainVerificationFailureInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CustomHostnameAnalysisResultCustomDomainVerificationFailureInfo if the JsonReader was + * pointing to an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the + * CustomHostnameAnalysisResultCustomDomainVerificationFailureInfo. + */ + public static CustomHostnameAnalysisResultCustomDomainVerificationFailureInfo fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + CustomHostnameAnalysisResultCustomDomainVerificationFailureInfo deserializedCustomHostnameAnalysisResultCustomDomainVerificationFailureInfo + = new CustomHostnameAnalysisResultCustomDomainVerificationFailureInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("code".equals(fieldName)) { + deserializedCustomHostnameAnalysisResultCustomDomainVerificationFailureInfo.code + = reader.getString(); + } else if ("message".equals(fieldName)) { + deserializedCustomHostnameAnalysisResultCustomDomainVerificationFailureInfo.message + = reader.getString(); + } else if ("target".equals(fieldName)) { + deserializedCustomHostnameAnalysisResultCustomDomainVerificationFailureInfo.target + = reader.getString(); + } else if ("details".equals(fieldName)) { + List details = reader + .readArray(reader1 -> CustomHostnameAnalysisResultCustomDomainVerificationFailureInfoDetailsItem + .fromJson(reader1)); + deserializedCustomHostnameAnalysisResultCustomDomainVerificationFailureInfo.details = details; + } else { + reader.skipChildren(); + } + } + + return deserializedCustomHostnameAnalysisResultCustomDomainVerificationFailureInfo; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CustomHostnameAnalysisResultCustomDomainVerificationFailureInfoDetailsItem.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CustomHostnameAnalysisResultCustomDomainVerificationFailureInfoDetailsItem.java index 1f62e74e378d..499ba7d2784c 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CustomHostnameAnalysisResultCustomDomainVerificationFailureInfoDetailsItem.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CustomHostnameAnalysisResultCustomDomainVerificationFailureInfoDetailsItem.java @@ -5,29 +5,31 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Detailed errors. */ @Immutable -public final class CustomHostnameAnalysisResultCustomDomainVerificationFailureInfoDetailsItem { +public final class CustomHostnameAnalysisResultCustomDomainVerificationFailureInfoDetailsItem + implements JsonSerializable { /* * Standardized string to programmatically identify the error. */ - @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) private String code; /* * Detailed error description and debugging information. */ - @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) private String message; /* * Detailed error description and debugging information. */ - @JsonProperty(value = "target", access = JsonProperty.Access.WRITE_ONLY) private String target; /** @@ -70,4 +72,50 @@ public String target() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CustomHostnameAnalysisResultCustomDomainVerificationFailureInfoDetailsItem from the + * JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CustomHostnameAnalysisResultCustomDomainVerificationFailureInfoDetailsItem if the + * JsonReader was pointing to an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the + * CustomHostnameAnalysisResultCustomDomainVerificationFailureInfoDetailsItem. + */ + public static CustomHostnameAnalysisResultCustomDomainVerificationFailureInfoDetailsItem + fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CustomHostnameAnalysisResultCustomDomainVerificationFailureInfoDetailsItem deserializedCustomHostnameAnalysisResultCustomDomainVerificationFailureInfoDetailsItem + = new CustomHostnameAnalysisResultCustomDomainVerificationFailureInfoDetailsItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("code".equals(fieldName)) { + deserializedCustomHostnameAnalysisResultCustomDomainVerificationFailureInfoDetailsItem.code + = reader.getString(); + } else if ("message".equals(fieldName)) { + deserializedCustomHostnameAnalysisResultCustomDomainVerificationFailureInfoDetailsItem.message + = reader.getString(); + } else if ("target".equals(fieldName)) { + deserializedCustomHostnameAnalysisResultCustomDomainVerificationFailureInfoDetailsItem.target + = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCustomHostnameAnalysisResultCustomDomainVerificationFailureInfoDetailsItem; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CustomOpenIdConnectProvider.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CustomOpenIdConnectProvider.java index 042d48d13233..3d2c8518522f 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CustomOpenIdConnectProvider.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CustomOpenIdConnectProvider.java @@ -5,29 +5,30 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The configuration settings of the custom Open ID Connect provider. */ @Fluent -public final class CustomOpenIdConnectProvider { +public final class CustomOpenIdConnectProvider implements JsonSerializable { /* * false if the custom Open ID provider provider should not be enabled; otherwise, true. */ - @JsonProperty(value = "enabled") private Boolean enabled; /* * The configuration settings of the app registration for the custom Open ID Connect provider. */ - @JsonProperty(value = "registration") private OpenIdConnectRegistration registration; /* * The configuration settings of the login flow of the custom Open ID Connect provider. */ - @JsonProperty(value = "login") private OpenIdConnectLogin login; /** @@ -113,4 +114,46 @@ public void validate() { login().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeJsonField("registration", this.registration); + jsonWriter.writeJsonField("login", this.login); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CustomOpenIdConnectProvider from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CustomOpenIdConnectProvider if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CustomOpenIdConnectProvider. + */ + public static CustomOpenIdConnectProvider fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CustomOpenIdConnectProvider deserializedCustomOpenIdConnectProvider = new CustomOpenIdConnectProvider(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedCustomOpenIdConnectProvider.enabled = reader.getNullable(JsonReader::getBoolean); + } else if ("registration".equals(fieldName)) { + deserializedCustomOpenIdConnectProvider.registration = OpenIdConnectRegistration.fromJson(reader); + } else if ("login".equals(fieldName)) { + deserializedCustomOpenIdConnectProvider.login = OpenIdConnectLogin.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCustomOpenIdConnectProvider; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CustomScaleRule.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CustomScaleRule.java index c5b307384859..2a63f74b802b 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CustomScaleRule.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CustomScaleRule.java @@ -5,8 +5,11 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.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; @@ -14,27 +17,29 @@ * Container App container Custom scaling rule. */ @Fluent -public final class CustomScaleRule { +public final class CustomScaleRule implements JsonSerializable { /* * Type of the custom scale rule * eg: azure-servicebus, redis etc. */ - @JsonProperty(value = "type") private String type; /* * Metadata properties to describe custom scale rule. */ - @JsonProperty(value = "metadata") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map metadata; /* * Authentication secrets for the custom scale rule. */ - @JsonProperty(value = "auth") private List auth; + /* + * The resource ID of a user-assigned managed identity that is assigned to the Container App, or 'system' for + * system-assigned identity. + */ + private String identity; + /** * Creates an instance of CustomScaleRule class. */ @@ -103,6 +108,28 @@ public CustomScaleRule withAuth(List auth) { return this; } + /** + * Get the identity property: The resource ID of a user-assigned managed identity that is assigned to the Container + * App, or 'system' for system-assigned identity. + * + * @return the identity value. + */ + public String identity() { + return this.identity; + } + + /** + * Set the identity property: The resource ID of a user-assigned managed identity that is assigned to the Container + * App, or 'system' for system-assigned identity. + * + * @param identity the identity value to set. + * @return the CustomScaleRule object itself. + */ + public CustomScaleRule withIdentity(String identity) { + this.identity = identity; + return this; + } + /** * Validates the instance. * @@ -113,4 +140,51 @@ public void validate() { auth().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type); + jsonWriter.writeMapField("metadata", this.metadata, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("auth", this.auth, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("identity", this.identity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CustomScaleRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CustomScaleRule if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the CustomScaleRule. + */ + public static CustomScaleRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CustomScaleRule deserializedCustomScaleRule = new CustomScaleRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedCustomScaleRule.type = reader.getString(); + } else if ("metadata".equals(fieldName)) { + Map metadata = reader.readMap(reader1 -> reader1.getString()); + deserializedCustomScaleRule.metadata = metadata; + } else if ("auth".equals(fieldName)) { + List auth = reader.readArray(reader1 -> ScaleRuleAuth.fromJson(reader1)); + deserializedCustomScaleRule.auth = auth; + } else if ("identity".equals(fieldName)) { + deserializedCustomScaleRule.identity = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCustomScaleRule; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Dapr.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Dapr.java index bd279c80bfc6..a12e4ad8164b 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Dapr.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Dapr.java @@ -5,60 +5,56 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Container App Dapr configuration. */ @Fluent -public final class Dapr { +public final class Dapr implements JsonSerializable { /* * Boolean indicating if the Dapr side car is enabled */ - @JsonProperty(value = "enabled") private Boolean enabled; /* * Dapr application identifier */ - @JsonProperty(value = "appId") private String appId; /* * Tells Dapr which protocol your application is using. Valid options are http and grpc. Default is http */ - @JsonProperty(value = "appProtocol") private AppProtocol appProtocol; /* * Tells Dapr which port your application is listening on */ - @JsonProperty(value = "appPort") private Integer appPort; /* * Dapr max size of http header read buffer in KB to handle when sending multi-KB headers. Default is 65KB. */ - @JsonProperty(value = "httpReadBufferSize") private Integer httpReadBufferSize; /* * Increasing max size of request body http and grpc servers parameter in MB to handle uploading of big files. * Default is 4 MB. */ - @JsonProperty(value = "httpMaxRequestSize") private Integer httpMaxRequestSize; /* * Sets the log level for the Dapr sidecar. Allowed values are debug, info, warn, error. Default is info. */ - @JsonProperty(value = "logLevel") private LogLevel logLevel; /* * Enables API logging for the Dapr sidecar */ - @JsonProperty(value = "enableApiLogging") private Boolean enableApiLogging; /** @@ -172,8 +168,8 @@ public Dapr withHttpReadBufferSize(Integer httpReadBufferSize) { } /** - * Get the httpMaxRequestSize property: Increasing max size of request body http and grpc servers parameter in MB - * to handle uploading of big files. Default is 4 MB. + * Get the httpMaxRequestSize property: Increasing max size of request body http and grpc servers parameter in MB to + * handle uploading of big files. Default is 4 MB. * * @return the httpMaxRequestSize value. */ @@ -182,8 +178,8 @@ public Integer httpMaxRequestSize() { } /** - * Set the httpMaxRequestSize property: Increasing max size of request body http and grpc servers parameter in MB - * to handle uploading of big files. Default is 4 MB. + * Set the httpMaxRequestSize property: Increasing max size of request body http and grpc servers parameter in MB to + * handle uploading of big files. Default is 4 MB. * * @param httpMaxRequestSize the httpMaxRequestSize value to set. * @return the Dapr object itself. @@ -242,4 +238,61 @@ public Dapr withEnableApiLogging(Boolean enableApiLogging) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeStringField("appId", this.appId); + jsonWriter.writeStringField("appProtocol", this.appProtocol == null ? null : this.appProtocol.toString()); + jsonWriter.writeNumberField("appPort", this.appPort); + jsonWriter.writeNumberField("httpReadBufferSize", this.httpReadBufferSize); + jsonWriter.writeNumberField("httpMaxRequestSize", this.httpMaxRequestSize); + jsonWriter.writeStringField("logLevel", this.logLevel == null ? null : this.logLevel.toString()); + jsonWriter.writeBooleanField("enableApiLogging", this.enableApiLogging); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Dapr from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Dapr if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Dapr. + */ + public static Dapr fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Dapr deserializedDapr = new Dapr(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedDapr.enabled = reader.getNullable(JsonReader::getBoolean); + } else if ("appId".equals(fieldName)) { + deserializedDapr.appId = reader.getString(); + } else if ("appProtocol".equals(fieldName)) { + deserializedDapr.appProtocol = AppProtocol.fromString(reader.getString()); + } else if ("appPort".equals(fieldName)) { + deserializedDapr.appPort = reader.getNullable(JsonReader::getInt); + } else if ("httpReadBufferSize".equals(fieldName)) { + deserializedDapr.httpReadBufferSize = reader.getNullable(JsonReader::getInt); + } else if ("httpMaxRequestSize".equals(fieldName)) { + deserializedDapr.httpMaxRequestSize = reader.getNullable(JsonReader::getInt); + } else if ("logLevel".equals(fieldName)) { + deserializedDapr.logLevel = LogLevel.fromString(reader.getString()); + } else if ("enableApiLogging".equals(fieldName)) { + deserializedDapr.enableApiLogging = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedDapr; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentResiliencyPoliciesCollection.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentResiliencyPoliciesCollection.java index d2cd3641ede9..cc87807184db 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentResiliencyPoliciesCollection.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentResiliencyPoliciesCollection.java @@ -6,25 +6,28 @@ 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.appcontainers.fluent.models.DaprComponentResiliencyPolicyInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * Dapr Component Resiliency Policies ARM resource. */ @Fluent -public final class DaprComponentResiliencyPoliciesCollection { +public final class DaprComponentResiliencyPoliciesCollection + implements JsonSerializable { /* * Collection of resources. */ - @JsonProperty(value = "value", required = true) private List value; /* * Link to next page of resources. */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; /** @@ -69,12 +72,55 @@ public String nextLink() { */ public void validate() { if (value() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property value in model DaprComponentResiliencyPoliciesCollection")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model DaprComponentResiliencyPoliciesCollection")); } else { value().forEach(e -> e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(DaprComponentResiliencyPoliciesCollection.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DaprComponentResiliencyPoliciesCollection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DaprComponentResiliencyPoliciesCollection 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 DaprComponentResiliencyPoliciesCollection. + */ + public static DaprComponentResiliencyPoliciesCollection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DaprComponentResiliencyPoliciesCollection deserializedDaprComponentResiliencyPoliciesCollection + = new DaprComponentResiliencyPoliciesCollection(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> DaprComponentResiliencyPolicyInner.fromJson(reader1)); + deserializedDaprComponentResiliencyPoliciesCollection.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedDaprComponentResiliencyPoliciesCollection.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDaprComponentResiliencyPoliciesCollection; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration.java index 00acaa9ac2ce..d1e30673c559 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration.java @@ -5,30 +5,32 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Dapr Component Resiliency Policy Circuit Breaker Policy Configuration. */ @Fluent -public final class DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration { +public final class DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration + implements JsonSerializable { /* * The number of consecutive errors before the circuit is opened. */ - @JsonProperty(value = "consecutiveErrors") private Integer consecutiveErrors; /* * The interval in seconds until a retry attempt is made after the circuit is opened. */ - @JsonProperty(value = "timeoutInSeconds") private Integer timeoutInSeconds; /* * The optional interval in seconds after which the error count resets to 0. An interval of 0 will never reset. If * not specified, the timeoutInSeconds value will be used. */ - @JsonProperty(value = "intervalInSeconds") private Integer intervalInSeconds; /** @@ -111,4 +113,52 @@ public Integer intervalInSeconds() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("consecutiveErrors", this.consecutiveErrors); + jsonWriter.writeNumberField("timeoutInSeconds", this.timeoutInSeconds); + jsonWriter.writeNumberField("intervalInSeconds", this.intervalInSeconds); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration if the JsonReader was + * pointing to an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the + * DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration. + */ + public static DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration deserializedDaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration + = new DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("consecutiveErrors".equals(fieldName)) { + deserializedDaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration.consecutiveErrors + = reader.getNullable(JsonReader::getInt); + } else if ("timeoutInSeconds".equals(fieldName)) { + deserializedDaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration.timeoutInSeconds + = reader.getNullable(JsonReader::getInt); + } else if ("intervalInSeconds".equals(fieldName)) { + deserializedDaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration.intervalInSeconds + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedDaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentResiliencyPolicyConfiguration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentResiliencyPolicyConfiguration.java index de2ba311504e..3e83447dbee9 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentResiliencyPolicyConfiguration.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentResiliencyPolicyConfiguration.java @@ -5,29 +5,31 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Dapr Component Resiliency Policy Configuration. */ @Fluent -public final class DaprComponentResiliencyPolicyConfiguration { +public final class DaprComponentResiliencyPolicyConfiguration + implements JsonSerializable { /* * The optional HTTP retry policy configuration */ - @JsonProperty(value = "httpRetryPolicy") private DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration httpRetryPolicy; /* * The optional timeout policy configuration */ - @JsonProperty(value = "timeoutPolicy") private DaprComponentResiliencyPolicyTimeoutPolicyConfiguration timeoutPolicy; /* * The optional circuit breaker policy configuration */ - @JsonProperty(value = "circuitBreakerPolicy") private DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration circuitBreakerPolicy; /** @@ -115,4 +117,50 @@ public void validate() { circuitBreakerPolicy().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("httpRetryPolicy", this.httpRetryPolicy); + jsonWriter.writeJsonField("timeoutPolicy", this.timeoutPolicy); + jsonWriter.writeJsonField("circuitBreakerPolicy", this.circuitBreakerPolicy); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DaprComponentResiliencyPolicyConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DaprComponentResiliencyPolicyConfiguration if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DaprComponentResiliencyPolicyConfiguration. + */ + public static DaprComponentResiliencyPolicyConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DaprComponentResiliencyPolicyConfiguration deserializedDaprComponentResiliencyPolicyConfiguration + = new DaprComponentResiliencyPolicyConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("httpRetryPolicy".equals(fieldName)) { + deserializedDaprComponentResiliencyPolicyConfiguration.httpRetryPolicy + = DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration.fromJson(reader); + } else if ("timeoutPolicy".equals(fieldName)) { + deserializedDaprComponentResiliencyPolicyConfiguration.timeoutPolicy + = DaprComponentResiliencyPolicyTimeoutPolicyConfiguration.fromJson(reader); + } else if ("circuitBreakerPolicy".equals(fieldName)) { + deserializedDaprComponentResiliencyPolicyConfiguration.circuitBreakerPolicy + = DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDaprComponentResiliencyPolicyConfiguration; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration.java index ade23b45f831..5a8a3dfdbaf1 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration.java @@ -5,23 +5,26 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Dapr Component Resiliency Policy HTTP Retry Backoff Configuration. */ @Fluent -public final class DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration { +public final class DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration + implements JsonSerializable { /* * The optional initial delay in milliseconds before an operation is retried */ - @JsonProperty(value = "initialDelayInMilliseconds") private Integer initialDelayInMilliseconds; /* * The optional maximum time interval in milliseconds between retry attempts */ - @JsonProperty(value = "maxIntervalInMilliseconds") private Integer maxIntervalInMilliseconds; /** @@ -83,4 +86,48 @@ public Integer maxIntervalInMilliseconds() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("initialDelayInMilliseconds", this.initialDelayInMilliseconds); + jsonWriter.writeNumberField("maxIntervalInMilliseconds", this.maxIntervalInMilliseconds); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration if the JsonReader was pointing + * to an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the + * DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration. + */ + public static DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration deserializedDaprComponentResiliencyPolicyHttpRetryBackOffConfiguration + = new DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("initialDelayInMilliseconds".equals(fieldName)) { + deserializedDaprComponentResiliencyPolicyHttpRetryBackOffConfiguration.initialDelayInMilliseconds + = reader.getNullable(JsonReader::getInt); + } else if ("maxIntervalInMilliseconds".equals(fieldName)) { + deserializedDaprComponentResiliencyPolicyHttpRetryBackOffConfiguration.maxIntervalInMilliseconds + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedDaprComponentResiliencyPolicyHttpRetryBackOffConfiguration; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration.java index da8bf6a03fd4..f88a92cdb674 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration.java @@ -5,23 +5,26 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Dapr Component Resiliency Policy HTTP Retry Policy Configuration. */ @Fluent -public final class DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration { +public final class DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration + implements JsonSerializable { /* * The optional maximum number of retries */ - @JsonProperty(value = "maxRetries") private Integer maxRetries; /* * The optional retry backoff configuration */ - @JsonProperty(value = "retryBackOff") private DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration retryBackOff; /** @@ -81,4 +84,48 @@ public void validate() { retryBackOff().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("maxRetries", this.maxRetries); + jsonWriter.writeJsonField("retryBackOff", this.retryBackOff); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration if the JsonReader was pointing + * to an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the + * DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration. + */ + public static DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration deserializedDaprComponentResiliencyPolicyHttpRetryPolicyConfiguration + = new DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("maxRetries".equals(fieldName)) { + deserializedDaprComponentResiliencyPolicyHttpRetryPolicyConfiguration.maxRetries + = reader.getNullable(JsonReader::getInt); + } else if ("retryBackOff".equals(fieldName)) { + deserializedDaprComponentResiliencyPolicyHttpRetryPolicyConfiguration.retryBackOff + = DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDaprComponentResiliencyPolicyHttpRetryPolicyConfiguration; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentResiliencyPolicyTimeoutPolicyConfiguration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentResiliencyPolicyTimeoutPolicyConfiguration.java index 558f96916428..c90caf2f86bb 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentResiliencyPolicyTimeoutPolicyConfiguration.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentResiliencyPolicyTimeoutPolicyConfiguration.java @@ -5,17 +5,21 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Dapr Component Resiliency Policy Timeout Policy Configuration. */ @Fluent -public final class DaprComponentResiliencyPolicyTimeoutPolicyConfiguration { +public final class DaprComponentResiliencyPolicyTimeoutPolicyConfiguration + implements JsonSerializable { /* * The optional response timeout in seconds */ - @JsonProperty(value = "responseTimeoutInSeconds") private Integer responseTimeoutInSeconds; /** @@ -52,4 +56,43 @@ public Integer responseTimeoutInSeconds() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("responseTimeoutInSeconds", this.responseTimeoutInSeconds); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DaprComponentResiliencyPolicyTimeoutPolicyConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DaprComponentResiliencyPolicyTimeoutPolicyConfiguration if the JsonReader was pointing to + * an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DaprComponentResiliencyPolicyTimeoutPolicyConfiguration. + */ + public static DaprComponentResiliencyPolicyTimeoutPolicyConfiguration fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + DaprComponentResiliencyPolicyTimeoutPolicyConfiguration deserializedDaprComponentResiliencyPolicyTimeoutPolicyConfiguration + = new DaprComponentResiliencyPolicyTimeoutPolicyConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("responseTimeoutInSeconds".equals(fieldName)) { + deserializedDaprComponentResiliencyPolicyTimeoutPolicyConfiguration.responseTimeoutInSeconds + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedDaprComponentResiliencyPolicyTimeoutPolicyConfiguration; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentServiceBinding.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentServiceBinding.java index f2ab867136a4..0d4739a9d4f6 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentServiceBinding.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentServiceBinding.java @@ -5,29 +5,30 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Configuration to bind a Dapr Component to a dev ContainerApp Service. */ @Fluent -public final class DaprComponentServiceBinding { +public final class DaprComponentServiceBinding implements JsonSerializable { /* * Name of the service bind */ - @JsonProperty(value = "name") private String name; /* * Resource id of the target service */ - @JsonProperty(value = "serviceId") private String serviceId; /* * Service bind metadata */ - @JsonProperty(value = "metadata") private DaprServiceBindMetadata metadata; /** @@ -106,4 +107,46 @@ public void validate() { metadata().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("serviceId", this.serviceId); + jsonWriter.writeJsonField("metadata", this.metadata); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DaprComponentServiceBinding from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DaprComponentServiceBinding if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DaprComponentServiceBinding. + */ + public static DaprComponentServiceBinding fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DaprComponentServiceBinding deserializedDaprComponentServiceBinding = new DaprComponentServiceBinding(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedDaprComponentServiceBinding.name = reader.getString(); + } else if ("serviceId".equals(fieldName)) { + deserializedDaprComponentServiceBinding.serviceId = reader.getString(); + } else if ("metadata".equals(fieldName)) { + deserializedDaprComponentServiceBinding.metadata = DaprServiceBindMetadata.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDaprComponentServiceBinding; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentsCollection.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentsCollection.java index a61699c74b2b..812630bf02eb 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentsCollection.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentsCollection.java @@ -6,25 +6,27 @@ 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.appcontainers.fluent.models.DaprComponentInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * Dapr Components ARM resource. */ @Fluent -public final class DaprComponentsCollection { +public final class DaprComponentsCollection implements JsonSerializable { /* * Collection of resources. */ - @JsonProperty(value = "value", required = true) private List value; /* * Link to next page of resources. */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; /** @@ -69,12 +71,52 @@ public String nextLink() { */ public void validate() { if (value() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property value in model DaprComponentsCollection")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model DaprComponentsCollection")); } else { value().forEach(e -> e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(DaprComponentsCollection.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DaprComponentsCollection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DaprComponentsCollection 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 DaprComponentsCollection. + */ + public static DaprComponentsCollection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DaprComponentsCollection deserializedDaprComponentsCollection = new DaprComponentsCollection(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> DaprComponentInner.fromJson(reader1)); + deserializedDaprComponentsCollection.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedDaprComponentsCollection.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDaprComponentsCollection; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprConfiguration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprConfiguration.java index fb4c30f8dfae..98c7a26c6868 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprConfiguration.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprConfiguration.java @@ -5,17 +5,20 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Configuration properties Dapr component. */ @Immutable -public final class DaprConfiguration { +public final class DaprConfiguration implements JsonSerializable { /* * The version of Dapr */ - @JsonProperty(value = "version", access = JsonProperty.Access.WRITE_ONLY) private String version; /** @@ -40,4 +43,39 @@ public String version() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DaprConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DaprConfiguration if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DaprConfiguration. + */ + public static DaprConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DaprConfiguration deserializedDaprConfiguration = new DaprConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("version".equals(fieldName)) { + deserializedDaprConfiguration.version = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDaprConfiguration; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprMetadata.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprMetadata.java index 4c1ba04e9035..0673beca3a57 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprMetadata.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprMetadata.java @@ -5,29 +5,30 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Dapr component metadata. */ @Fluent -public final class DaprMetadata { +public final class DaprMetadata implements JsonSerializable { /* * Metadata property name. */ - @JsonProperty(value = "name") private String name; /* * Metadata property value. */ - @JsonProperty(value = "value") private String value; /* * Name of the Dapr Component secret from which to pull the metadata property value. */ - @JsonProperty(value = "secretRef") private String secretRef; /** @@ -103,4 +104,46 @@ public DaprMetadata withSecretRef(String secretRef) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("value", this.value); + jsonWriter.writeStringField("secretRef", this.secretRef); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DaprMetadata from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DaprMetadata if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DaprMetadata. + */ + public static DaprMetadata fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DaprMetadata deserializedDaprMetadata = new DaprMetadata(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedDaprMetadata.name = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedDaprMetadata.value = reader.getString(); + } else if ("secretRef".equals(fieldName)) { + deserializedDaprMetadata.secretRef = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDaprMetadata; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprSecret.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprSecret.java index d30582091a86..cd8cdbf7a4ff 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprSecret.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprSecret.java @@ -5,23 +5,25 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Dapr component Secret for ListSecrets Action. */ @Immutable -public final class DaprSecret { +public final class DaprSecret implements JsonSerializable { /* * Secret Name. */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) private String name; /* * Secret Value. */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private String value; /** @@ -55,4 +57,41 @@ public String value() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DaprSecret from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DaprSecret if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the DaprSecret. + */ + public static DaprSecret fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DaprSecret deserializedDaprSecret = new DaprSecret(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedDaprSecret.name = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedDaprSecret.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDaprSecret; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprServiceBindMetadata.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprServiceBindMetadata.java index db50d0768187..d273181362de 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprServiceBindMetadata.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprServiceBindMetadata.java @@ -5,23 +5,25 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Dapr component metadata. */ @Fluent -public final class DaprServiceBindMetadata { +public final class DaprServiceBindMetadata implements JsonSerializable { /* * Service bind metadata property name. */ - @JsonProperty(value = "name") private String name; /* * Service bind metadata property value. */ - @JsonProperty(value = "value") private String value; /** @@ -77,4 +79,43 @@ public DaprServiceBindMetadata withValue(String value) { */ 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 DaprServiceBindMetadata from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DaprServiceBindMetadata if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the DaprServiceBindMetadata. + */ + public static DaprServiceBindMetadata fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DaprServiceBindMetadata deserializedDaprServiceBindMetadata = new DaprServiceBindMetadata(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedDaprServiceBindMetadata.name = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedDaprServiceBindMetadata.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDaprServiceBindMetadata; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprSubscriptionBulkSubscribeOptions.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprSubscriptionBulkSubscribeOptions.java index 75faad2981a7..2359c554ab54 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprSubscriptionBulkSubscribeOptions.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprSubscriptionBulkSubscribeOptions.java @@ -5,29 +5,31 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Dapr PubSub Bulk Subscription Options. */ @Fluent -public final class DaprSubscriptionBulkSubscribeOptions { +public final class DaprSubscriptionBulkSubscribeOptions + implements JsonSerializable { /* * Enable bulk subscription */ - @JsonProperty(value = "enabled") private Boolean enabled; /* * Maximum number of messages to deliver in a bulk message. */ - @JsonProperty(value = "maxMessagesCount") private Integer maxMessagesCount; /* * Maximum duration in milliseconds to wait before a bulk message is sent to the app. */ - @JsonProperty(value = "maxAwaitDurationMs") private Integer maxAwaitDurationMs; /** @@ -105,4 +107,50 @@ public DaprSubscriptionBulkSubscribeOptions withMaxAwaitDurationMs(Integer maxAw */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeNumberField("maxMessagesCount", this.maxMessagesCount); + jsonWriter.writeNumberField("maxAwaitDurationMs", this.maxAwaitDurationMs); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DaprSubscriptionBulkSubscribeOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DaprSubscriptionBulkSubscribeOptions if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DaprSubscriptionBulkSubscribeOptions. + */ + public static DaprSubscriptionBulkSubscribeOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DaprSubscriptionBulkSubscribeOptions deserializedDaprSubscriptionBulkSubscribeOptions + = new DaprSubscriptionBulkSubscribeOptions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedDaprSubscriptionBulkSubscribeOptions.enabled + = reader.getNullable(JsonReader::getBoolean); + } else if ("maxMessagesCount".equals(fieldName)) { + deserializedDaprSubscriptionBulkSubscribeOptions.maxMessagesCount + = reader.getNullable(JsonReader::getInt); + } else if ("maxAwaitDurationMs".equals(fieldName)) { + deserializedDaprSubscriptionBulkSubscribeOptions.maxAwaitDurationMs + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedDaprSubscriptionBulkSubscribeOptions; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprSubscriptionRouteRule.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprSubscriptionRouteRule.java index d6d2bdcf1338..6b18d09b436f 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprSubscriptionRouteRule.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprSubscriptionRouteRule.java @@ -5,25 +5,27 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Dapr Pubsub Event Subscription Route Rule is used to specify the condition for sending a message to a specific path. */ @Fluent -public final class DaprSubscriptionRouteRule { +public final class DaprSubscriptionRouteRule implements JsonSerializable { /* * The optional CEL expression used to match the event. If the match is not specified, then the route is considered * the default. The rules are tested in the order specified, so they should be define from most-to-least specific. * The default route should appear last in the list. */ - @JsonProperty(value = "match") private String match; /* * The path for events that match this rule */ - @JsonProperty(value = "path") private String path; /** @@ -83,4 +85,43 @@ public DaprSubscriptionRouteRule withPath(String path) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("match", this.match); + jsonWriter.writeStringField("path", this.path); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DaprSubscriptionRouteRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DaprSubscriptionRouteRule if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DaprSubscriptionRouteRule. + */ + public static DaprSubscriptionRouteRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DaprSubscriptionRouteRule deserializedDaprSubscriptionRouteRule = new DaprSubscriptionRouteRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("match".equals(fieldName)) { + deserializedDaprSubscriptionRouteRule.match = reader.getString(); + } else if ("path".equals(fieldName)) { + deserializedDaprSubscriptionRouteRule.path = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDaprSubscriptionRouteRule; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprSubscriptionRoutes.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprSubscriptionRoutes.java index 695bdbdb1e29..8e8e43b7e9f8 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprSubscriptionRoutes.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprSubscriptionRoutes.java @@ -5,24 +5,26 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.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; /** * Dapr PubSub Event Subscription Routes configuration. */ @Fluent -public final class DaprSubscriptionRoutes { +public final class DaprSubscriptionRoutes implements JsonSerializable { /* * The list of Dapr PubSub Event Subscription Route Rules. */ - @JsonProperty(value = "rules") private List rules; /* * The default path to deliver events that do not match any of the rules. */ - @JsonProperty(value = "default") private String defaultProperty; /** @@ -81,4 +83,45 @@ public void validate() { 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)); + jsonWriter.writeStringField("default", this.defaultProperty); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DaprSubscriptionRoutes from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DaprSubscriptionRoutes if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the DaprSubscriptionRoutes. + */ + public static DaprSubscriptionRoutes fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DaprSubscriptionRoutes deserializedDaprSubscriptionRoutes = new DaprSubscriptionRoutes(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("rules".equals(fieldName)) { + List rules + = reader.readArray(reader1 -> DaprSubscriptionRouteRule.fromJson(reader1)); + deserializedDaprSubscriptionRoutes.rules = rules; + } else if ("default".equals(fieldName)) { + deserializedDaprSubscriptionRoutes.defaultProperty = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDaprSubscriptionRoutes; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprSubscriptionsCollection.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprSubscriptionsCollection.java index e78b2ac2a46c..5149087ecbb8 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprSubscriptionsCollection.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprSubscriptionsCollection.java @@ -6,25 +6,27 @@ 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.appcontainers.fluent.models.DaprSubscriptionInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * Dapr Subscriptions ARM resource. */ @Fluent -public final class DaprSubscriptionsCollection { +public final class DaprSubscriptionsCollection implements JsonSerializable { /* * Collection of resources. */ - @JsonProperty(value = "value", required = true) private List value; /* * Link to next page of resources. */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; /** @@ -69,12 +71,54 @@ public String nextLink() { */ public void validate() { if (value() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property value in model DaprSubscriptionsCollection")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model DaprSubscriptionsCollection")); } else { value().forEach(e -> e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(DaprSubscriptionsCollection.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DaprSubscriptionsCollection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DaprSubscriptionsCollection 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 DaprSubscriptionsCollection. + */ + public static DaprSubscriptionsCollection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DaprSubscriptionsCollection deserializedDaprSubscriptionsCollection = new DaprSubscriptionsCollection(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> DaprSubscriptionInner.fromJson(reader1)); + deserializedDaprSubscriptionsCollection.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedDaprSubscriptionsCollection.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDaprSubscriptionsCollection; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DataDogConfiguration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DataDogConfiguration.java index 47880887d199..169088edbdcd 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DataDogConfiguration.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DataDogConfiguration.java @@ -5,23 +5,25 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Configuration of datadog. */ @Fluent -public final class DataDogConfiguration { +public final class DataDogConfiguration implements JsonSerializable { /* * The data dog site */ - @JsonProperty(value = "site") private String site; /* * The data dog api key */ - @JsonProperty(value = "key") private String key; /** @@ -77,4 +79,43 @@ public DataDogConfiguration withKey(String key) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("site", this.site); + jsonWriter.writeStringField("key", this.key); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataDogConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataDogConfiguration if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the DataDogConfiguration. + */ + public static DataDogConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataDogConfiguration deserializedDataDogConfiguration = new DataDogConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("site".equals(fieldName)) { + deserializedDataDogConfiguration.site = reader.getString(); + } else if ("key".equals(fieldName)) { + deserializedDataDogConfiguration.key = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDataDogConfiguration; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DefaultAuthorizationPolicy.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DefaultAuthorizationPolicy.java index 49f7b2b12bbb..f5abfa61892a 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DefaultAuthorizationPolicy.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DefaultAuthorizationPolicy.java @@ -5,24 +5,26 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.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; /** * The configuration settings of the Azure Active Directory default authorization policy. */ @Fluent -public final class DefaultAuthorizationPolicy { +public final class DefaultAuthorizationPolicy implements JsonSerializable { /* * The configuration settings of the Azure Active Directory allowed principals. */ - @JsonProperty(value = "allowedPrincipals") private AllowedPrincipals allowedPrincipals; /* * The configuration settings of the Azure Active Directory allowed applications. */ - @JsonProperty(value = "allowedApplications") private List allowedApplications; /** @@ -83,4 +85,45 @@ public void validate() { allowedPrincipals().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("allowedPrincipals", this.allowedPrincipals); + jsonWriter.writeArrayField("allowedApplications", this.allowedApplications, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DefaultAuthorizationPolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DefaultAuthorizationPolicy if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DefaultAuthorizationPolicy. + */ + public static DefaultAuthorizationPolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DefaultAuthorizationPolicy deserializedDefaultAuthorizationPolicy = new DefaultAuthorizationPolicy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("allowedPrincipals".equals(fieldName)) { + deserializedDefaultAuthorizationPolicy.allowedPrincipals = AllowedPrincipals.fromJson(reader); + } else if ("allowedApplications".equals(fieldName)) { + List allowedApplications = reader.readArray(reader1 -> reader1.getString()); + deserializedDefaultAuthorizationPolicy.allowedApplications = allowedApplications; + } else { + reader.skipChildren(); + } + } + + return deserializedDefaultAuthorizationPolicy; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DefaultErrorResponseError.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DefaultErrorResponseError.java index a0d8564a8449..5ac8f5104faf 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DefaultErrorResponseError.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DefaultErrorResponseError.java @@ -6,7 +6,10 @@ import com.azure.core.annotation.Immutable; import com.azure.core.management.exception.ManagementError; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * App Service error response. @@ -16,7 +19,6 @@ public final class DefaultErrorResponseError extends ManagementError { /* * More information to debug error. */ - @JsonProperty(value = "innererror", access = JsonProperty.Access.WRITE_ONLY) private String innererror; /** @@ -41,4 +43,39 @@ public String getInnererror() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DefaultErrorResponseError from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DefaultErrorResponseError if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DefaultErrorResponseError. + */ + public static DefaultErrorResponseError fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DefaultErrorResponseError deserializedDefaultErrorResponseError = new DefaultErrorResponseError(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("innererror".equals(fieldName)) { + deserializedDefaultErrorResponseError.innererror = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDefaultErrorResponseError; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DestinationsConfiguration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DestinationsConfiguration.java index 53fd75e4424b..d79de70647ca 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DestinationsConfiguration.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DestinationsConfiguration.java @@ -5,24 +5,26 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.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; /** * Configuration of Open Telemetry destinations. */ @Fluent -public final class DestinationsConfiguration { +public final class DestinationsConfiguration implements JsonSerializable { /* * Open telemetry datadog destination configuration */ - @JsonProperty(value = "dataDogConfiguration") private DataDogConfiguration dataDogConfiguration; /* * Open telemetry otlp configurations */ - @JsonProperty(value = "otlpConfigurations") private List otlpConfigurations; /** @@ -84,4 +86,46 @@ public void validate() { otlpConfigurations().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("dataDogConfiguration", this.dataDogConfiguration); + jsonWriter.writeArrayField("otlpConfigurations", this.otlpConfigurations, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DestinationsConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DestinationsConfiguration if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DestinationsConfiguration. + */ + public static DestinationsConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DestinationsConfiguration deserializedDestinationsConfiguration = new DestinationsConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("dataDogConfiguration".equals(fieldName)) { + deserializedDestinationsConfiguration.dataDogConfiguration = DataDogConfiguration.fromJson(reader); + } else if ("otlpConfigurations".equals(fieldName)) { + List otlpConfigurations + = reader.readArray(reader1 -> OtlpConfiguration.fromJson(reader1)); + deserializedDestinationsConfiguration.otlpConfigurations = otlpConfigurations; + } else { + reader.skipChildren(); + } + } + + return deserializedDestinationsConfiguration; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DetectionStatus.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DetectionStatus.java new file mode 100644 index 000000000000..8b203aaede5d --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DetectionStatus.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.appcontainers.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The status of the patch detection. + */ +public final class DetectionStatus extends ExpandableStringEnum { + /** + * Static value Succeeded for DetectionStatus. + */ + public static final DetectionStatus SUCCEEDED = fromString("Succeeded"); + + /** + * Static value RegistryLoginFailed for DetectionStatus. + */ + public static final DetectionStatus REGISTRY_LOGIN_FAILED = fromString("RegistryLoginFailed"); + + /** + * Static value Failed for DetectionStatus. + */ + public static final DetectionStatus FAILED = fromString("Failed"); + + /** + * Creates a new instance of DetectionStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DetectionStatus() { + } + + /** + * Creates or finds a DetectionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding DetectionStatus. + */ + public static DetectionStatus fromString(String name) { + return fromString(name, DetectionStatus.class); + } + + /** + * Gets known DetectionStatus values. + * + * @return known DetectionStatus values. + */ + public static Collection values() { + return values(DetectionStatus.class); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticDataProviderMetadata.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticDataProviderMetadata.java index 22ffbe86a162..b858a7dd7a9a 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticDataProviderMetadata.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticDataProviderMetadata.java @@ -5,24 +5,26 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.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; /** * Details of a diagnostics data provider. */ @Fluent -public final class DiagnosticDataProviderMetadata { +public final class DiagnosticDataProviderMetadata implements JsonSerializable { /* * Name of data provider */ - @JsonProperty(value = "providerName") private String providerName; /* * Collection of properties */ - @JsonProperty(value = "propertyBag") private List propertyBag; /** @@ -82,4 +84,46 @@ public void validate() { propertyBag().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("providerName", this.providerName); + jsonWriter.writeArrayField("propertyBag", this.propertyBag, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DiagnosticDataProviderMetadata from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DiagnosticDataProviderMetadata if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DiagnosticDataProviderMetadata. + */ + public static DiagnosticDataProviderMetadata fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DiagnosticDataProviderMetadata deserializedDiagnosticDataProviderMetadata + = new DiagnosticDataProviderMetadata(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("providerName".equals(fieldName)) { + deserializedDiagnosticDataProviderMetadata.providerName = reader.getString(); + } else if ("propertyBag".equals(fieldName)) { + List propertyBag + = reader.readArray(reader1 -> DiagnosticDataProviderMetadataPropertyBagItem.fromJson(reader1)); + deserializedDiagnosticDataProviderMetadata.propertyBag = propertyBag; + } else { + reader.skipChildren(); + } + } + + return deserializedDiagnosticDataProviderMetadata; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticDataProviderMetadataPropertyBagItem.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticDataProviderMetadataPropertyBagItem.java index 582e1a89341b..10c41181eb45 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticDataProviderMetadataPropertyBagItem.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticDataProviderMetadataPropertyBagItem.java @@ -5,23 +5,26 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Property details. */ @Fluent -public final class DiagnosticDataProviderMetadataPropertyBagItem { +public final class DiagnosticDataProviderMetadataPropertyBagItem + implements JsonSerializable { /* * Property name */ - @JsonProperty(value = "name") private String name; /* * Property value */ - @JsonProperty(value = "value") private String value; /** @@ -77,4 +80,44 @@ public DiagnosticDataProviderMetadataPropertyBagItem withValue(String value) { */ 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 DiagnosticDataProviderMetadataPropertyBagItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DiagnosticDataProviderMetadataPropertyBagItem if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DiagnosticDataProviderMetadataPropertyBagItem. + */ + public static DiagnosticDataProviderMetadataPropertyBagItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DiagnosticDataProviderMetadataPropertyBagItem deserializedDiagnosticDataProviderMetadataPropertyBagItem + = new DiagnosticDataProviderMetadataPropertyBagItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedDiagnosticDataProviderMetadataPropertyBagItem.name = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedDiagnosticDataProviderMetadataPropertyBagItem.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDiagnosticDataProviderMetadataPropertyBagItem; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticDataTableResponseColumn.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticDataTableResponseColumn.java index 4195cc5ea2f4..746623c49a05 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticDataTableResponseColumn.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticDataTableResponseColumn.java @@ -5,29 +5,30 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Diagnostics data column. */ @Fluent -public final class DiagnosticDataTableResponseColumn { +public final class DiagnosticDataTableResponseColumn implements JsonSerializable { /* * Column name */ - @JsonProperty(value = "columnName") private String columnName; /* * Data type of the column */ - @JsonProperty(value = "dataType") private String dataType; /* * Column type */ - @JsonProperty(value = "columnType") private String columnType; /** @@ -103,4 +104,47 @@ public DiagnosticDataTableResponseColumn withColumnType(String columnType) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("columnName", this.columnName); + jsonWriter.writeStringField("dataType", this.dataType); + jsonWriter.writeStringField("columnType", this.columnType); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DiagnosticDataTableResponseColumn from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DiagnosticDataTableResponseColumn if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DiagnosticDataTableResponseColumn. + */ + public static DiagnosticDataTableResponseColumn fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DiagnosticDataTableResponseColumn deserializedDiagnosticDataTableResponseColumn + = new DiagnosticDataTableResponseColumn(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("columnName".equals(fieldName)) { + deserializedDiagnosticDataTableResponseColumn.columnName = reader.getString(); + } else if ("dataType".equals(fieldName)) { + deserializedDiagnosticDataTableResponseColumn.dataType = reader.getString(); + } else if ("columnType".equals(fieldName)) { + deserializedDiagnosticDataTableResponseColumn.columnType = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDiagnosticDataTableResponseColumn; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticDataTableResponseObject.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticDataTableResponseObject.java index 1f91ef838dcc..a82b400f3b2a 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticDataTableResponseObject.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticDataTableResponseObject.java @@ -5,30 +5,31 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.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; /** * Diagnostics data table. */ @Fluent -public final class DiagnosticDataTableResponseObject { +public final class DiagnosticDataTableResponseObject implements JsonSerializable { /* * Table name */ - @JsonProperty(value = "tableName") private String tableName; /* * Columns in the table */ - @JsonProperty(value = "columns") private List columns; /* * Rows in the table */ - @JsonProperty(value = "rows") private List rows; /** @@ -107,4 +108,50 @@ public void validate() { columns().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("tableName", this.tableName); + jsonWriter.writeArrayField("columns", this.columns, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("rows", this.rows, (writer, element) -> writer.writeUntyped(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DiagnosticDataTableResponseObject from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DiagnosticDataTableResponseObject if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DiagnosticDataTableResponseObject. + */ + public static DiagnosticDataTableResponseObject fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DiagnosticDataTableResponseObject deserializedDiagnosticDataTableResponseObject + = new DiagnosticDataTableResponseObject(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tableName".equals(fieldName)) { + deserializedDiagnosticDataTableResponseObject.tableName = reader.getString(); + } else if ("columns".equals(fieldName)) { + List columns + = reader.readArray(reader1 -> DiagnosticDataTableResponseColumn.fromJson(reader1)); + deserializedDiagnosticDataTableResponseObject.columns = columns; + } else if ("rows".equals(fieldName)) { + List rows = reader.readArray(reader1 -> reader1.readUntyped()); + deserializedDiagnosticDataTableResponseObject.rows = rows; + } else { + reader.skipChildren(); + } + } + + return deserializedDiagnosticDataTableResponseObject; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticRendering.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticRendering.java index 3c400d9e5fa4..221b8fc25e2f 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticRendering.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticRendering.java @@ -5,35 +5,35 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Rendering details of a diagnostics table. */ @Fluent -public final class DiagnosticRendering { +public final class DiagnosticRendering implements JsonSerializable { /* * Rendering type */ - @JsonProperty(value = "type") private Integer type; /* * Title of the table */ - @JsonProperty(value = "title") private String title; /* * Description of the table */ - @JsonProperty(value = "description") private String description; /* * Flag if the table should be rendered */ - @JsonProperty(value = "isVisible") private Boolean isVisible; /** @@ -129,4 +129,49 @@ public DiagnosticRendering withIsVisible(Boolean isVisible) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("type", this.type); + jsonWriter.writeStringField("title", this.title); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeBooleanField("isVisible", this.isVisible); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DiagnosticRendering from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DiagnosticRendering if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DiagnosticRendering. + */ + public static DiagnosticRendering fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DiagnosticRendering deserializedDiagnosticRendering = new DiagnosticRendering(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedDiagnosticRendering.type = reader.getNullable(JsonReader::getInt); + } else if ("title".equals(fieldName)) { + deserializedDiagnosticRendering.title = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedDiagnosticRendering.description = reader.getString(); + } else if ("isVisible".equals(fieldName)) { + deserializedDiagnosticRendering.isVisible = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedDiagnosticRendering; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticSupportTopic.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticSupportTopic.java index ece2fd3fa51e..76341cff4927 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticSupportTopic.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticSupportTopic.java @@ -5,23 +5,25 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Support topic information. */ @Immutable -public final class DiagnosticSupportTopic { +public final class DiagnosticSupportTopic implements JsonSerializable { /* * Unique topic identifier */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) private String id; /* * PES identifier */ - @JsonProperty(value = "pesId", access = JsonProperty.Access.WRITE_ONLY) private String pesId; /** @@ -55,4 +57,41 @@ public String pesId() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DiagnosticSupportTopic from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DiagnosticSupportTopic if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the DiagnosticSupportTopic. + */ + public static DiagnosticSupportTopic fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DiagnosticSupportTopic deserializedDiagnosticSupportTopic = new DiagnosticSupportTopic(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedDiagnosticSupportTopic.id = reader.getString(); + } else if ("pesId".equals(fieldName)) { + deserializedDiagnosticSupportTopic.pesId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDiagnosticSupportTopic; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticsDataApiResponse.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticsDataApiResponse.java index 287125a29abd..9640d9549aaf 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticsDataApiResponse.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticsDataApiResponse.java @@ -5,23 +5,25 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Diagnostics data returned from a detector. */ @Fluent -public final class DiagnosticsDataApiResponse { +public final class DiagnosticsDataApiResponse implements JsonSerializable { /* * Table response */ - @JsonProperty(value = "table") private DiagnosticDataTableResponseObject table; /* * Details of the table response */ - @JsonProperty(value = "renderingProperties") private DiagnosticRendering renderingProperties; /** @@ -83,4 +85,43 @@ public void validate() { renderingProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("table", this.table); + jsonWriter.writeJsonField("renderingProperties", this.renderingProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DiagnosticsDataApiResponse from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DiagnosticsDataApiResponse if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DiagnosticsDataApiResponse. + */ + public static DiagnosticsDataApiResponse fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DiagnosticsDataApiResponse deserializedDiagnosticsDataApiResponse = new DiagnosticsDataApiResponse(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("table".equals(fieldName)) { + deserializedDiagnosticsDataApiResponse.table = DiagnosticDataTableResponseObject.fromJson(reader); + } else if ("renderingProperties".equals(fieldName)) { + deserializedDiagnosticsDataApiResponse.renderingProperties = DiagnosticRendering.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDiagnosticsDataApiResponse; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticsDefinition.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticsDefinition.java index 8d3046762ba6..1e6afd4ed928 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticsDefinition.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticsDefinition.java @@ -5,66 +5,61 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.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; /** * Metadata of the diagnostics response. */ @Fluent -public final class DiagnosticsDefinition { +public final class DiagnosticsDefinition implements JsonSerializable { /* * Unique detector name */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) private String id; /* * Display Name of the detector */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) private String name; /* * Details of the diagnostics info */ - @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) private String description; /* * Authors' names of the detector */ - @JsonProperty(value = "author", access = JsonProperty.Access.WRITE_ONLY) private String author; /* * Category of the detector */ - @JsonProperty(value = "category", access = JsonProperty.Access.WRITE_ONLY) private String category; /* * List of support topics */ - @JsonProperty(value = "supportTopicList") private List supportTopicList; /* * List of analysis types */ - @JsonProperty(value = "analysisTypes") private List analysisTypes; /* * Authors' names of the detector */ - @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) private String type; /* * Authors' names of the detector */ - @JsonProperty(value = "score", access = JsonProperty.Access.WRITE_ONLY) private Float score; /** @@ -186,4 +181,62 @@ public void validate() { supportTopicList().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("supportTopicList", this.supportTopicList, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("analysisTypes", this.analysisTypes, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DiagnosticsDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DiagnosticsDefinition if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the DiagnosticsDefinition. + */ + public static DiagnosticsDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DiagnosticsDefinition deserializedDiagnosticsDefinition = new DiagnosticsDefinition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedDiagnosticsDefinition.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedDiagnosticsDefinition.name = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedDiagnosticsDefinition.description = reader.getString(); + } else if ("author".equals(fieldName)) { + deserializedDiagnosticsDefinition.author = reader.getString(); + } else if ("category".equals(fieldName)) { + deserializedDiagnosticsDefinition.category = reader.getString(); + } else if ("supportTopicList".equals(fieldName)) { + List supportTopicList + = reader.readArray(reader1 -> DiagnosticSupportTopic.fromJson(reader1)); + deserializedDiagnosticsDefinition.supportTopicList = supportTopicList; + } else if ("analysisTypes".equals(fieldName)) { + List analysisTypes = reader.readArray(reader1 -> reader1.getString()); + deserializedDiagnosticsDefinition.analysisTypes = analysisTypes; + } else if ("type".equals(fieldName)) { + deserializedDiagnosticsDefinition.type = reader.getString(); + } else if ("score".equals(fieldName)) { + deserializedDiagnosticsDefinition.score = reader.getNullable(JsonReader::getFloat); + } else { + reader.skipChildren(); + } + } + + return deserializedDiagnosticsDefinition; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticsProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticsProperties.java index 012915c98278..47f7ea5cdb9c 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticsProperties.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticsProperties.java @@ -5,36 +5,36 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.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; /** * Diagnostics resource specific properties. */ @Fluent -public final class DiagnosticsProperties { +public final class DiagnosticsProperties implements JsonSerializable { /* * Metadata of the diagnostics response. */ - @JsonProperty(value = "metadata") private DiagnosticsDefinition metadata; /* * Set of data collections associated with the response. */ - @JsonProperty(value = "dataset") private List dataset; /* * Status of the diagnostics response. */ - @JsonProperty(value = "status") private DiagnosticsStatus status; /* * List of data providers' metadata. */ - @JsonProperty(value = "dataProviderMetadata") private DiagnosticDataProviderMetadata dataProviderMetadata; /** @@ -142,4 +142,52 @@ public void validate() { dataProviderMetadata().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("metadata", this.metadata); + jsonWriter.writeArrayField("dataset", this.dataset, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("status", this.status); + jsonWriter.writeJsonField("dataProviderMetadata", this.dataProviderMetadata); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DiagnosticsProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DiagnosticsProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the DiagnosticsProperties. + */ + public static DiagnosticsProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DiagnosticsProperties deserializedDiagnosticsProperties = new DiagnosticsProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("metadata".equals(fieldName)) { + deserializedDiagnosticsProperties.metadata = DiagnosticsDefinition.fromJson(reader); + } else if ("dataset".equals(fieldName)) { + List dataset + = reader.readArray(reader1 -> DiagnosticsDataApiResponse.fromJson(reader1)); + deserializedDiagnosticsProperties.dataset = dataset; + } else if ("status".equals(fieldName)) { + deserializedDiagnosticsProperties.status = DiagnosticsStatus.fromJson(reader); + } else if ("dataProviderMetadata".equals(fieldName)) { + deserializedDiagnosticsProperties.dataProviderMetadata + = DiagnosticDataProviderMetadata.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDiagnosticsProperties; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticsStatus.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticsStatus.java index 1379a4992d57..4514cbddf3c8 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticsStatus.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticsStatus.java @@ -5,23 +5,25 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Rendering details of a diagnostics table. */ @Fluent -public final class DiagnosticsStatus { +public final class DiagnosticsStatus implements JsonSerializable { /* * Diagnostic message */ - @JsonProperty(value = "message") private String message; /* * Status */ - @JsonProperty(value = "statusId") private Integer statusId; /** @@ -77,4 +79,43 @@ public DiagnosticsStatus withStatusId(Integer statusId) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("message", this.message); + jsonWriter.writeNumberField("statusId", this.statusId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DiagnosticsStatus from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DiagnosticsStatus if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DiagnosticsStatus. + */ + public static DiagnosticsStatus fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DiagnosticsStatus deserializedDiagnosticsStatus = new DiagnosticsStatus(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("message".equals(fieldName)) { + deserializedDiagnosticsStatus.message = reader.getString(); + } else if ("statusId".equals(fieldName)) { + deserializedDiagnosticsStatus.statusId = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedDiagnosticsStatus; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DnsVerificationTestResult.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DnsVerificationTestResult.java index 65a02dd71aeb..73290d277eaf 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DnsVerificationTestResult.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DnsVerificationTestResult.java @@ -4,9 +4,6 @@ package com.azure.resourcemanager.appcontainers.models; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - /** * DNS verification test result. */ @@ -41,7 +38,6 @@ public enum DnsVerificationTestResult { * @param value the serialized value to parse. * @return the parsed DnsVerificationTestResult object, or null if unable to parse. */ - @JsonCreator public static DnsVerificationTestResult fromString(String value) { if (value == null) { return null; @@ -58,7 +54,6 @@ public static DnsVerificationTestResult fromString(String value) { /** * {@inheritDoc} */ - @JsonValue @Override public String toString() { return this.value; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DotNetComponentConfigurationProperty.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DotNetComponentConfigurationProperty.java index 9a529ae5766f..467ae1e04d6a 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DotNetComponentConfigurationProperty.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DotNetComponentConfigurationProperty.java @@ -5,23 +5,26 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Configuration properties for a .NET Component. */ @Fluent -public final class DotNetComponentConfigurationProperty { +public final class DotNetComponentConfigurationProperty + implements JsonSerializable { /* * The name of the property */ - @JsonProperty(value = "propertyName") private String propertyName; /* * The value of the property */ - @JsonProperty(value = "value") private String value; /** @@ -77,4 +80,44 @@ public DotNetComponentConfigurationProperty withValue(String value) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("propertyName", this.propertyName); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DotNetComponentConfigurationProperty from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DotNetComponentConfigurationProperty if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DotNetComponentConfigurationProperty. + */ + public static DotNetComponentConfigurationProperty fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DotNetComponentConfigurationProperty deserializedDotNetComponentConfigurationProperty + = new DotNetComponentConfigurationProperty(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("propertyName".equals(fieldName)) { + deserializedDotNetComponentConfigurationProperty.propertyName = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedDotNetComponentConfigurationProperty.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDotNetComponentConfigurationProperty; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DotNetComponentProvisioningState.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DotNetComponentProvisioningState.java index eaffcc2516bc..e192894c00c1 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DotNetComponentProvisioningState.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DotNetComponentProvisioningState.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -52,7 +51,6 @@ public DotNetComponentProvisioningState() { * @param name a name to look for. * @return the corresponding DotNetComponentProvisioningState. */ - @JsonCreator public static DotNetComponentProvisioningState fromString(String name) { return fromString(name, DotNetComponentProvisioningState.class); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DotNetComponentServiceBind.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DotNetComponentServiceBind.java index 88f33359f483..0f9a7ff68eff 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DotNetComponentServiceBind.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DotNetComponentServiceBind.java @@ -5,23 +5,25 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Configuration to bind a .NET Component to another .NET Component. */ @Fluent -public final class DotNetComponentServiceBind { +public final class DotNetComponentServiceBind implements JsonSerializable { /* * Name of the service bind */ - @JsonProperty(value = "name") private String name; /* * Resource id of the target service */ - @JsonProperty(value = "serviceId") private String serviceId; /** @@ -77,4 +79,43 @@ public DotNetComponentServiceBind withServiceId(String serviceId) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("serviceId", this.serviceId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DotNetComponentServiceBind from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DotNetComponentServiceBind if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DotNetComponentServiceBind. + */ + public static DotNetComponentServiceBind fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DotNetComponentServiceBind deserializedDotNetComponentServiceBind = new DotNetComponentServiceBind(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedDotNetComponentServiceBind.name = reader.getString(); + } else if ("serviceId".equals(fieldName)) { + deserializedDotNetComponentServiceBind.serviceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDotNetComponentServiceBind; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DotNetComponentType.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DotNetComponentType.java index 9d1346962f4f..2a317ac4d3c3 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DotNetComponentType.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DotNetComponentType.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -17,11 +16,6 @@ public final class DotNetComponentType extends ExpandableStringEnum { /* * Collection of resources. */ - @JsonProperty(value = "value", required = true) private List value; /* * Link to next page of resources. */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; /** @@ -69,12 +71,54 @@ public String nextLink() { */ public void validate() { if (value() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property value in model DotNetComponentsCollection")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model DotNetComponentsCollection")); } else { value().forEach(e -> e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(DotNetComponentsCollection.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DotNetComponentsCollection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DotNetComponentsCollection 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 DotNetComponentsCollection. + */ + public static DotNetComponentsCollection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DotNetComponentsCollection deserializedDotNetComponentsCollection = new DotNetComponentsCollection(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> DotNetComponentInner.fromJson(reader1)); + deserializedDotNetComponentsCollection.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedDotNetComponentsCollection.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDotNetComponentsCollection; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DynamicPoolConfiguration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DynamicPoolConfiguration.java new file mode 100644 index 000000000000..2aa2b808a776 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DynamicPoolConfiguration.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.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Dynamic pool configuration. + */ +@Fluent +public final class DynamicPoolConfiguration implements JsonSerializable { + /* + * The execution type of the session pool. + */ + private ExecutionType executionType; + + /* + * The cooldown period of a session in seconds. + */ + private Integer cooldownPeriodInSeconds; + + /** + * Creates an instance of DynamicPoolConfiguration class. + */ + public DynamicPoolConfiguration() { + } + + /** + * Get the executionType property: The execution type of the session pool. + * + * @return the executionType value. + */ + public ExecutionType executionType() { + return this.executionType; + } + + /** + * Set the executionType property: The execution type of the session pool. + * + * @param executionType the executionType value to set. + * @return the DynamicPoolConfiguration object itself. + */ + public DynamicPoolConfiguration withExecutionType(ExecutionType executionType) { + this.executionType = executionType; + return this; + } + + /** + * Get the cooldownPeriodInSeconds property: The cooldown period of a session in seconds. + * + * @return the cooldownPeriodInSeconds value. + */ + public Integer cooldownPeriodInSeconds() { + return this.cooldownPeriodInSeconds; + } + + /** + * Set the cooldownPeriodInSeconds property: The cooldown period of a session in seconds. + * + * @param cooldownPeriodInSeconds the cooldownPeriodInSeconds value to set. + * @return the DynamicPoolConfiguration object itself. + */ + public DynamicPoolConfiguration withCooldownPeriodInSeconds(Integer cooldownPeriodInSeconds) { + this.cooldownPeriodInSeconds = cooldownPeriodInSeconds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("executionType", this.executionType == null ? null : this.executionType.toString()); + jsonWriter.writeNumberField("cooldownPeriodInSeconds", this.cooldownPeriodInSeconds); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DynamicPoolConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DynamicPoolConfiguration if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DynamicPoolConfiguration. + */ + public static DynamicPoolConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DynamicPoolConfiguration deserializedDynamicPoolConfiguration = new DynamicPoolConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("executionType".equals(fieldName)) { + deserializedDynamicPoolConfiguration.executionType = ExecutionType.fromString(reader.getString()); + } else if ("cooldownPeriodInSeconds".equals(fieldName)) { + deserializedDynamicPoolConfiguration.cooldownPeriodInSeconds + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedDynamicPoolConfiguration; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/EncryptionSettings.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/EncryptionSettings.java index 57068af0e0d4..af0d032eca02 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/EncryptionSettings.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/EncryptionSettings.java @@ -5,24 +5,26 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The configuration settings of the secrets references of encryption key and signing key for ContainerApp Service * Authentication/Authorization. */ @Fluent -public final class EncryptionSettings { +public final class EncryptionSettings implements JsonSerializable { /* * The secret name which is referenced for EncryptionKey. */ - @JsonProperty(value = "containerAppAuthEncryptionSecretName") private String containerAppAuthEncryptionSecretName; /* * The secret name which is referenced for SigningKey. */ - @JsonProperty(value = "containerAppAuthSigningSecretName") private String containerAppAuthSigningSecretName; /** @@ -78,4 +80,43 @@ public EncryptionSettings withContainerAppAuthSigningSecretName(String container */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("containerAppAuthEncryptionSecretName", this.containerAppAuthEncryptionSecretName); + jsonWriter.writeStringField("containerAppAuthSigningSecretName", this.containerAppAuthSigningSecretName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EncryptionSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EncryptionSettings if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the EncryptionSettings. + */ + public static EncryptionSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EncryptionSettings deserializedEncryptionSettings = new EncryptionSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("containerAppAuthEncryptionSecretName".equals(fieldName)) { + deserializedEncryptionSettings.containerAppAuthEncryptionSecretName = reader.getString(); + } else if ("containerAppAuthSigningSecretName".equals(fieldName)) { + deserializedEncryptionSettings.containerAppAuthSigningSecretName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEncryptionSettings; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/EnvironmentProvisioningState.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/EnvironmentProvisioningState.java index 255c3a14cf5a..ae124cc770b2 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/EnvironmentProvisioningState.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/EnvironmentProvisioningState.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -80,7 +79,6 @@ public EnvironmentProvisioningState() { * @param name a name to look for. * @return the corresponding EnvironmentProvisioningState. */ - @JsonCreator public static EnvironmentProvisioningState fromString(String name) { return fromString(name, EnvironmentProvisioningState.class); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/EnvironmentVar.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/EnvironmentVar.java index 4355fee30854..3f9385a95d30 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/EnvironmentVar.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/EnvironmentVar.java @@ -5,29 +5,30 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Container App container environment variable. */ @Fluent -public final class EnvironmentVar { +public final class EnvironmentVar implements JsonSerializable { /* * Environment variable name. */ - @JsonProperty(value = "name") private String name; /* * Non-secret environment variable value. */ - @JsonProperty(value = "value") private String value; /* * Name of the Container App secret from which to pull the environment variable value. */ - @JsonProperty(value = "secretRef") private String secretRef; /** @@ -103,4 +104,46 @@ public EnvironmentVar withSecretRef(String secretRef) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("value", this.value); + jsonWriter.writeStringField("secretRef", this.secretRef); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EnvironmentVar from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EnvironmentVar if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the EnvironmentVar. + */ + public static EnvironmentVar fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EnvironmentVar deserializedEnvironmentVar = new EnvironmentVar(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedEnvironmentVar.name = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedEnvironmentVar.value = reader.getString(); + } else if ("secretRef".equals(fieldName)) { + deserializedEnvironmentVar.secretRef = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEnvironmentVar; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/EnvironmentVariable.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/EnvironmentVariable.java index 0e8c6c43c8f2..c4701b917d05 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/EnvironmentVariable.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/EnvironmentVariable.java @@ -6,23 +6,25 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Model representing an environment variable. */ @Fluent -public final class EnvironmentVariable { +public final class EnvironmentVariable implements JsonSerializable { /* * Environment variable name. */ - @JsonProperty(value = "name", required = true) private String name; /* * Environment variable value. */ - @JsonProperty(value = "value", required = true) private String value; /** @@ -78,14 +80,54 @@ public EnvironmentVariable withValue(String value) { */ public void validate() { if (name() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property name in model EnvironmentVariable")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property name in model EnvironmentVariable")); } if (value() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property value in model EnvironmentVariable")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model EnvironmentVariable")); } } private static final ClientLogger LOGGER = new ClientLogger(EnvironmentVariable.class); + + /** + * {@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 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 IllegalStateException If the deserialized JSON object was missing any required properties. + * @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 ("value".equals(fieldName)) { + deserializedEnvironmentVariable.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEnvironmentVariable; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ErrorEntity.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ErrorEntity.java new file mode 100644 index 000000000000..cae94ab237ff --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ErrorEntity.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.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.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; + +/** + * Body of the error response returned from the API. + */ +@Fluent +public final class ErrorEntity implements JsonSerializable { + /* + * Type of error. + */ + private String extendedCode; + + /* + * Message template. + */ + private String messageTemplate; + + /* + * Parameters for the template. + */ + private List parameters; + + /* + * Inner errors. + */ + private List innerErrors; + + /* + * Error Details. + */ + private List details; + + /* + * The error target. + */ + private String target; + + /* + * Basic error code. + */ + private String code; + + /* + * Any details of the error. + */ + private String message; + + /** + * Creates an instance of ErrorEntity class. + */ + public ErrorEntity() { + } + + /** + * Get the extendedCode property: Type of error. + * + * @return the extendedCode value. + */ + public String extendedCode() { + return this.extendedCode; + } + + /** + * Set the extendedCode property: Type of error. + * + * @param extendedCode the extendedCode value to set. + * @return the ErrorEntity object itself. + */ + public ErrorEntity withExtendedCode(String extendedCode) { + this.extendedCode = extendedCode; + return this; + } + + /** + * Get the messageTemplate property: Message template. + * + * @return the messageTemplate value. + */ + public String messageTemplate() { + return this.messageTemplate; + } + + /** + * Set the messageTemplate property: Message template. + * + * @param messageTemplate the messageTemplate value to set. + * @return the ErrorEntity object itself. + */ + public ErrorEntity withMessageTemplate(String messageTemplate) { + this.messageTemplate = messageTemplate; + return this; + } + + /** + * Get the parameters property: Parameters for the template. + * + * @return the parameters value. + */ + public List parameters() { + return this.parameters; + } + + /** + * Set the parameters property: Parameters for the template. + * + * @param parameters the parameters value to set. + * @return the ErrorEntity object itself. + */ + public ErrorEntity withParameters(List parameters) { + this.parameters = parameters; + return this; + } + + /** + * Get the innerErrors property: Inner errors. + * + * @return the innerErrors value. + */ + public List innerErrors() { + return this.innerErrors; + } + + /** + * Set the innerErrors property: Inner errors. + * + * @param innerErrors the innerErrors value to set. + * @return the ErrorEntity object itself. + */ + public ErrorEntity withInnerErrors(List innerErrors) { + this.innerErrors = innerErrors; + return this; + } + + /** + * Get the details property: Error Details. + * + * @return the details value. + */ + public List details() { + return this.details; + } + + /** + * Set the details property: Error Details. + * + * @param details the details value to set. + * @return the ErrorEntity object itself. + */ + public ErrorEntity withDetails(List details) { + this.details = details; + return this; + } + + /** + * Get the target property: The error target. + * + * @return the target value. + */ + public String target() { + return this.target; + } + + /** + * Set the target property: The error target. + * + * @param target the target value to set. + * @return the ErrorEntity object itself. + */ + public ErrorEntity withTarget(String target) { + this.target = target; + return this; + } + + /** + * Get the code property: Basic error code. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Set the code property: Basic error code. + * + * @param code the code value to set. + * @return the ErrorEntity object itself. + */ + public ErrorEntity withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the message property: Any details of the error. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: Any details of the error. + * + * @param message the message value to set. + * @return the ErrorEntity object itself. + */ + public ErrorEntity withMessage(String message) { + this.message = message; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerErrors() != null) { + innerErrors().forEach(e -> e.validate()); + } + if (details() != null) { + details().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("extendedCode", this.extendedCode); + jsonWriter.writeStringField("messageTemplate", this.messageTemplate); + jsonWriter.writeArrayField("parameters", this.parameters, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("innerErrors", this.innerErrors, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("details", this.details, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("target", this.target); + jsonWriter.writeStringField("code", this.code); + jsonWriter.writeStringField("message", this.message); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ErrorEntity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ErrorEntity if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ErrorEntity. + */ + public static ErrorEntity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ErrorEntity deserializedErrorEntity = new ErrorEntity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("extendedCode".equals(fieldName)) { + deserializedErrorEntity.extendedCode = reader.getString(); + } else if ("messageTemplate".equals(fieldName)) { + deserializedErrorEntity.messageTemplate = reader.getString(); + } else if ("parameters".equals(fieldName)) { + List parameters = reader.readArray(reader1 -> reader1.getString()); + deserializedErrorEntity.parameters = parameters; + } else if ("innerErrors".equals(fieldName)) { + List innerErrors = reader.readArray(reader1 -> ErrorEntity.fromJson(reader1)); + deserializedErrorEntity.innerErrors = innerErrors; + } else if ("details".equals(fieldName)) { + List details = reader.readArray(reader1 -> ErrorEntity.fromJson(reader1)); + deserializedErrorEntity.details = details; + } else if ("target".equals(fieldName)) { + deserializedErrorEntity.target = reader.getString(); + } else if ("code".equals(fieldName)) { + deserializedErrorEntity.code = reader.getString(); + } else if ("message".equals(fieldName)) { + deserializedErrorEntity.message = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedErrorEntity; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ExecutionStatus.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ExecutionStatus.java new file mode 100644 index 000000000000..35e1d2d7c639 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ExecutionStatus.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.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.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; + +/** + * Container Apps Job execution status. + */ +@Fluent +public final class ExecutionStatus implements JsonSerializable { + /* + * Replicas in the execution. + */ + private List replicas; + + /** + * Creates an instance of ExecutionStatus class. + */ + public ExecutionStatus() { + } + + /** + * Get the replicas property: Replicas in the execution. + * + * @return the replicas value. + */ + public List replicas() { + return this.replicas; + } + + /** + * Set the replicas property: Replicas in the execution. + * + * @param replicas the replicas value to set. + * @return the ExecutionStatus object itself. + */ + public ExecutionStatus withReplicas(List replicas) { + this.replicas = replicas; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (replicas() != null) { + replicas().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("replicas", this.replicas, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExecutionStatus from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExecutionStatus if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ExecutionStatus. + */ + public static ExecutionStatus fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExecutionStatus deserializedExecutionStatus = new ExecutionStatus(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("replicas".equals(fieldName)) { + List replicas + = reader.readArray(reader1 -> ReplicaExecutionStatus.fromJson(reader1)); + deserializedExecutionStatus.replicas = replicas; + } else { + reader.skipChildren(); + } + } + + return deserializedExecutionStatus; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ExecutionType.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ExecutionType.java new file mode 100644 index 000000000000..bfa282dff6a4 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ExecutionType.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.appcontainers.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The execution type of the session pool. + */ +public final class ExecutionType extends ExpandableStringEnum { + /** + * Static value Timed for ExecutionType. + */ + public static final ExecutionType TIMED = fromString("Timed"); + + /** + * Creates a new instance of ExecutionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ExecutionType() { + } + + /** + * Creates or finds a ExecutionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExecutionType. + */ + public static ExecutionType fromString(String name) { + return fromString(name, ExecutionType.class); + } + + /** + * Gets known ExecutionType values. + * + * @return known ExecutionType values. + */ + public static Collection values() { + return values(ExecutionType.class); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ExtendedLocation.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ExtendedLocation.java index 8bb445ea86da..9aba5ee961a6 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ExtendedLocation.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ExtendedLocation.java @@ -5,23 +5,25 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The complex type of the extended location. */ @Fluent -public final class ExtendedLocation { +public final class ExtendedLocation implements JsonSerializable { /* * The name of the extended location. */ - @JsonProperty(value = "name") private String name; /* * The type of the extended location. */ - @JsonProperty(value = "type") private ExtendedLocationTypes type; /** @@ -77,4 +79,43 @@ public ExtendedLocation withType(ExtendedLocationTypes type) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExtendedLocation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExtendedLocation if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ExtendedLocation. + */ + public static ExtendedLocation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExtendedLocation deserializedExtendedLocation = new ExtendedLocation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedExtendedLocation.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedExtendedLocation.type = ExtendedLocationTypes.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedExtendedLocation; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ExtendedLocationTypes.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ExtendedLocationTypes.java index fc9716ab3040..4fa976b9cf7a 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ExtendedLocationTypes.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ExtendedLocationTypes.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -32,7 +31,6 @@ public ExtendedLocationTypes() { * @param name a name to look for. * @return the corresponding ExtendedLocationTypes. */ - @JsonCreator public static ExtendedLocationTypes fromString(String name) { return fromString(name, ExtendedLocationTypes.class); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Facebook.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Facebook.java index 6eebc6093dd5..aa1dc33ec6e7 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Facebook.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Facebook.java @@ -5,36 +5,36 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The configuration settings of the Facebook provider. */ @Fluent -public final class Facebook { +public final class Facebook implements JsonSerializable { /* * false if the Facebook provider should not be enabled despite the set registration; otherwise, * true. */ - @JsonProperty(value = "enabled") private Boolean enabled; /* * The configuration settings of the app registration for the Facebook provider. */ - @JsonProperty(value = "registration") private AppRegistration registration; /* * The version of the Facebook api to be used while logging in. */ - @JsonProperty(value = "graphApiVersion") private String graphApiVersion; /* * The configuration settings of the login flow. */ - @JsonProperty(value = "login") private LoginScopes login; /** @@ -138,4 +138,49 @@ public void validate() { login().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeJsonField("registration", this.registration); + jsonWriter.writeStringField("graphApiVersion", this.graphApiVersion); + jsonWriter.writeJsonField("login", this.login); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Facebook from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Facebook if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the Facebook. + */ + public static Facebook fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Facebook deserializedFacebook = new Facebook(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedFacebook.enabled = reader.getNullable(JsonReader::getBoolean); + } else if ("registration".equals(fieldName)) { + deserializedFacebook.registration = AppRegistration.fromJson(reader); + } else if ("graphApiVersion".equals(fieldName)) { + deserializedFacebook.graphApiVersion = reader.getString(); + } else if ("login".equals(fieldName)) { + deserializedFacebook.login = LoginScopes.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFacebook; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ForwardProxy.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ForwardProxy.java index 4c1c94333cb4..e801d06ae074 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ForwardProxy.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ForwardProxy.java @@ -5,29 +5,30 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The configuration settings of a forward proxy used to make the requests. */ @Fluent -public final class ForwardProxy { +public final class ForwardProxy implements JsonSerializable { /* * The convention used to determine the url of the request made. */ - @JsonProperty(value = "convention") private ForwardProxyConvention convention; /* * The name of the header containing the host of the request. */ - @JsonProperty(value = "customHostHeaderName") private String customHostHeaderName; /* * The name of the header containing the scheme of the request. */ - @JsonProperty(value = "customProtoHeaderName") private String customProtoHeaderName; /** @@ -103,4 +104,46 @@ public ForwardProxy withCustomProtoHeaderName(String customProtoHeaderName) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("convention", this.convention == null ? null : this.convention.toString()); + jsonWriter.writeStringField("customHostHeaderName", this.customHostHeaderName); + jsonWriter.writeStringField("customProtoHeaderName", this.customProtoHeaderName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ForwardProxy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ForwardProxy if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ForwardProxy. + */ + public static ForwardProxy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ForwardProxy deserializedForwardProxy = new ForwardProxy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("convention".equals(fieldName)) { + deserializedForwardProxy.convention = ForwardProxyConvention.fromString(reader.getString()); + } else if ("customHostHeaderName".equals(fieldName)) { + deserializedForwardProxy.customHostHeaderName = reader.getString(); + } else if ("customProtoHeaderName".equals(fieldName)) { + deserializedForwardProxy.customProtoHeaderName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedForwardProxy; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ForwardProxyConvention.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ForwardProxyConvention.java index 987f42967195..09328d7ffc58 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ForwardProxyConvention.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ForwardProxyConvention.java @@ -4,9 +4,6 @@ package com.azure.resourcemanager.appcontainers.models; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - /** * The convention used to determine the url of the request made. */ @@ -41,7 +38,6 @@ public enum ForwardProxyConvention { * @param value the serialized value to parse. * @return the parsed ForwardProxyConvention object, or null if unable to parse. */ - @JsonCreator public static ForwardProxyConvention fromString(String value) { if (value == null) { return null; @@ -58,7 +54,6 @@ public static ForwardProxyConvention fromString(String value) { /** * {@inheritDoc} */ - @JsonValue @Override public String toString() { return this.value; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/FunctionsExtensions.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/FunctionsExtensions.java new file mode 100644 index 000000000000..3a5584b9d59a --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/FunctionsExtensions.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.appcontainers.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of FunctionsExtensions. + */ +public interface FunctionsExtensions { + /** + * Proxies a Functions host call to the function app backed by the container app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param revisionName Name of the Container App Revision, the parent resource. + * @param functionAppName Name of the Function App, the extension resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + Response invokeFunctionsHostWithResponse(String resourceGroupName, String containerAppName, + String revisionName, String functionAppName, Context context); + + /** + * Proxies a Functions host call to the function app backed by the container app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param revisionName Name of the Container App Revision, the parent resource. + * @param functionAppName Name of the Function App, the extension resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + String invokeFunctionsHost(String resourceGroupName, String containerAppName, String revisionName, + String functionAppName); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/GitHub.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/GitHub.java index f017ad4e55b7..7b8bffb3e23d 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/GitHub.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/GitHub.java @@ -5,30 +5,31 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The configuration settings of the GitHub provider. */ @Fluent -public final class GitHub { +public final class GitHub implements JsonSerializable { /* * false if the GitHub provider should not be enabled despite the set registration; otherwise, * true. */ - @JsonProperty(value = "enabled") private Boolean enabled; /* * The configuration settings of the app registration for the GitHub provider. */ - @JsonProperty(value = "registration") private ClientRegistration registration; /* * The configuration settings of the login flow. */ - @JsonProperty(value = "login") private LoginScopes login; /** @@ -38,8 +39,8 @@ public GitHub() { } /** - * Get the enabled property: <code>false</code> if the GitHub provider should not be enabled despite - * the set registration; otherwise, <code>true</code>. + * Get the enabled property: <code>false</code> if the GitHub provider should not be enabled despite the + * set registration; otherwise, <code>true</code>. * * @return the enabled value. */ @@ -48,8 +49,8 @@ public Boolean enabled() { } /** - * Set the enabled property: <code>false</code> if the GitHub provider should not be enabled despite - * the set registration; otherwise, <code>true</code>. + * Set the enabled property: <code>false</code> if the GitHub provider should not be enabled despite the + * set registration; otherwise, <code>true</code>. * * @param enabled the enabled value to set. * @return the GitHub object itself. @@ -112,4 +113,46 @@ public void validate() { login().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeJsonField("registration", this.registration); + jsonWriter.writeJsonField("login", this.login); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GitHub from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GitHub if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the GitHub. + */ + public static GitHub fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GitHub deserializedGitHub = new GitHub(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedGitHub.enabled = reader.getNullable(JsonReader::getBoolean); + } else if ("registration".equals(fieldName)) { + deserializedGitHub.registration = ClientRegistration.fromJson(reader); + } else if ("login".equals(fieldName)) { + deserializedGitHub.login = LoginScopes.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedGitHub; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/GithubActionConfiguration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/GithubActionConfiguration.java index ea17571bff53..a3a9b1deb8ca 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/GithubActionConfiguration.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/GithubActionConfiguration.java @@ -5,72 +5,66 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.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; /** * Configuration properties that define the mutable settings of a Container App SourceControl. */ @Fluent -public final class GithubActionConfiguration { +public final class GithubActionConfiguration implements JsonSerializable { /* * Registry configurations. */ - @JsonProperty(value = "registryInfo") private RegistryInfo registryInfo; /* * AzureCredentials configurations. */ - @JsonProperty(value = "azureCredentials") private AzureCredentials azureCredentials; /* * Context path */ - @JsonProperty(value = "contextPath") private String contextPath; /* * One time Github PAT to configure github environment */ - @JsonProperty(value = "githubPersonalAccessToken") private String githubPersonalAccessToken; /* * Image name */ - @JsonProperty(value = "image") private String image; /* * Code or Image */ - @JsonProperty(value = "publishType") private String publishType; /* * Operation system */ - @JsonProperty(value = "os") private String os; /* * Runtime stack */ - @JsonProperty(value = "runtimeStack") private String runtimeStack; /* * Runtime version */ - @JsonProperty(value = "runtimeVersion") private String runtimeVersion; /* * List of environment variables to be passed to the build. */ - @JsonProperty(value = "buildEnvironmentVariables") private List buildEnvironmentVariables; /** @@ -296,4 +290,70 @@ public void validate() { buildEnvironmentVariables().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("registryInfo", this.registryInfo); + jsonWriter.writeJsonField("azureCredentials", this.azureCredentials); + jsonWriter.writeStringField("contextPath", this.contextPath); + jsonWriter.writeStringField("githubPersonalAccessToken", this.githubPersonalAccessToken); + jsonWriter.writeStringField("image", this.image); + jsonWriter.writeStringField("publishType", this.publishType); + jsonWriter.writeStringField("os", this.os); + jsonWriter.writeStringField("runtimeStack", this.runtimeStack); + jsonWriter.writeStringField("runtimeVersion", this.runtimeVersion); + jsonWriter.writeArrayField("buildEnvironmentVariables", this.buildEnvironmentVariables, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GithubActionConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GithubActionConfiguration if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the GithubActionConfiguration. + */ + public static GithubActionConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GithubActionConfiguration deserializedGithubActionConfiguration = new GithubActionConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("registryInfo".equals(fieldName)) { + deserializedGithubActionConfiguration.registryInfo = RegistryInfo.fromJson(reader); + } else if ("azureCredentials".equals(fieldName)) { + deserializedGithubActionConfiguration.azureCredentials = AzureCredentials.fromJson(reader); + } else if ("contextPath".equals(fieldName)) { + deserializedGithubActionConfiguration.contextPath = reader.getString(); + } else if ("githubPersonalAccessToken".equals(fieldName)) { + deserializedGithubActionConfiguration.githubPersonalAccessToken = reader.getString(); + } else if ("image".equals(fieldName)) { + deserializedGithubActionConfiguration.image = reader.getString(); + } else if ("publishType".equals(fieldName)) { + deserializedGithubActionConfiguration.publishType = reader.getString(); + } else if ("os".equals(fieldName)) { + deserializedGithubActionConfiguration.os = reader.getString(); + } else if ("runtimeStack".equals(fieldName)) { + deserializedGithubActionConfiguration.runtimeStack = reader.getString(); + } else if ("runtimeVersion".equals(fieldName)) { + deserializedGithubActionConfiguration.runtimeVersion = reader.getString(); + } else if ("buildEnvironmentVariables".equals(fieldName)) { + List buildEnvironmentVariables + = reader.readArray(reader1 -> EnvironmentVariable.fromJson(reader1)); + deserializedGithubActionConfiguration.buildEnvironmentVariables = buildEnvironmentVariables; + } else { + reader.skipChildren(); + } + } + + return deserializedGithubActionConfiguration; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/GlobalValidation.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/GlobalValidation.java index 133206ec91f3..6038833d1ef3 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/GlobalValidation.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/GlobalValidation.java @@ -5,7 +5,11 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.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; /** @@ -13,11 +17,10 @@ * Authentication/Authorization. */ @Fluent -public final class GlobalValidation { +public final class GlobalValidation implements JsonSerializable { /* * The action to take when an unauthenticated client attempts to access the app. */ - @JsonProperty(value = "unauthenticatedClientAction") private UnauthenticatedClientActionV2 unauthenticatedClientAction; /* @@ -25,13 +28,11 @@ public final class GlobalValidation { * This setting is only needed if multiple providers are configured and the unauthenticated client * action is set to "RedirectToLoginPage". */ - @JsonProperty(value = "redirectToProvider") private String redirectToProvider; /* * The paths for which unauthenticated flow would not be redirected to the login page. */ - @JsonProperty(value = "excludedPaths") private List excludedPaths; /** @@ -117,4 +118,50 @@ public GlobalValidation withExcludedPaths(List excludedPaths) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("unauthenticatedClientAction", + this.unauthenticatedClientAction == null ? null : this.unauthenticatedClientAction.toString()); + jsonWriter.writeStringField("redirectToProvider", this.redirectToProvider); + jsonWriter.writeArrayField("excludedPaths", this.excludedPaths, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GlobalValidation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GlobalValidation if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the GlobalValidation. + */ + public static GlobalValidation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GlobalValidation deserializedGlobalValidation = new GlobalValidation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("unauthenticatedClientAction".equals(fieldName)) { + deserializedGlobalValidation.unauthenticatedClientAction + = UnauthenticatedClientActionV2.fromString(reader.getString()); + } else if ("redirectToProvider".equals(fieldName)) { + deserializedGlobalValidation.redirectToProvider = reader.getString(); + } else if ("excludedPaths".equals(fieldName)) { + List excludedPaths = reader.readArray(reader1 -> reader1.getString()); + deserializedGlobalValidation.excludedPaths = excludedPaths; + } else { + reader.skipChildren(); + } + } + + return deserializedGlobalValidation; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Google.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Google.java index 085f2d03acff..dd44d71ca9ea 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Google.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Google.java @@ -5,36 +5,36 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The configuration settings of the Google provider. */ @Fluent -public final class Google { +public final class Google implements JsonSerializable { /* * false if the Google provider should not be enabled despite the set registration; otherwise, * true. */ - @JsonProperty(value = "enabled") private Boolean enabled; /* * The configuration settings of the app registration for the Google provider. */ - @JsonProperty(value = "registration") private ClientRegistration registration; /* * The configuration settings of the login flow. */ - @JsonProperty(value = "login") private LoginScopes login; /* * The configuration settings of the Azure Active Directory token validation flow. */ - @JsonProperty(value = "validation") private AllowedAudiencesValidation validation; /** @@ -44,8 +44,8 @@ public Google() { } /** - * Get the enabled property: <code>false</code> if the Google provider should not be enabled despite - * the set registration; otherwise, <code>true</code>. + * Get the enabled property: <code>false</code> if the Google provider should not be enabled despite the + * set registration; otherwise, <code>true</code>. * * @return the enabled value. */ @@ -54,8 +54,8 @@ public Boolean enabled() { } /** - * Set the enabled property: <code>false</code> if the Google provider should not be enabled despite - * the set registration; otherwise, <code>true</code>. + * Set the enabled property: <code>false</code> if the Google provider should not be enabled despite the + * set registration; otherwise, <code>true</code>. * * @param enabled the enabled value to set. * @return the Google object itself. @@ -141,4 +141,49 @@ public void validate() { validation().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeJsonField("registration", this.registration); + jsonWriter.writeJsonField("login", this.login); + jsonWriter.writeJsonField("validation", this.validation); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Google from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Google if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Google. + */ + public static Google fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Google deserializedGoogle = new Google(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedGoogle.enabled = reader.getNullable(JsonReader::getBoolean); + } else if ("registration".equals(fieldName)) { + deserializedGoogle.registration = ClientRegistration.fromJson(reader); + } else if ("login".equals(fieldName)) { + deserializedGoogle.login = LoginScopes.fromJson(reader); + } else if ("validation".equals(fieldName)) { + deserializedGoogle.validation = AllowedAudiencesValidation.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedGoogle; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Header.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Header.java index d8364dae7457..daa4078204fd 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Header.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Header.java @@ -5,23 +5,25 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Header of otlp configuration. */ @Fluent -public final class Header { +public final class Header implements JsonSerializable
{ /* * The key of otlp configuration header */ - @JsonProperty(value = "key") private String key; /* * The value of otlp configuration header */ - @JsonProperty(value = "value") private String value; /** @@ -77,4 +79,43 @@ public Header withValue(String value) { */ 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 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 ("key".equals(fieldName)) { + deserializedHeader.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedHeader.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedHeader; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HeaderMatch.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HeaderMatch.java index c1d1d4b55426..91f50b3a4234 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HeaderMatch.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HeaderMatch.java @@ -5,24 +5,26 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.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.appcontainers.fluent.models.HeaderMatchMatch; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * Conditions required to match a header. */ @Fluent -public final class HeaderMatch { +public final class HeaderMatch implements JsonSerializable { /* * Name of the header */ - @JsonProperty(value = "header") private String headerProperty; /* * Type of match to perform */ - @JsonProperty(value = "match") private HeaderMatchMatch innerMatch; /** @@ -162,4 +164,43 @@ public void validate() { innerMatch().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("header", this.headerProperty); + jsonWriter.writeJsonField("match", this.innerMatch); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HeaderMatch from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HeaderMatch if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the HeaderMatch. + */ + public static HeaderMatch fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HeaderMatch deserializedHeaderMatch = new HeaderMatch(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("header".equals(fieldName)) { + deserializedHeaderMatch.headerProperty = reader.getString(); + } else if ("match".equals(fieldName)) { + deserializedHeaderMatch.innerMatch = HeaderMatchMatch.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedHeaderMatch; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpConnectionPool.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpConnectionPool.java index 1b1502dcce29..1bab688679cb 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpConnectionPool.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpConnectionPool.java @@ -5,23 +5,25 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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 parameters for http connection pooling. */ @Fluent -public final class HttpConnectionPool { +public final class HttpConnectionPool implements JsonSerializable { /* * Maximum number of pending http1 requests allowed */ - @JsonProperty(value = "http1MaxPendingRequests") private Integer http1MaxPendingRequests; /* * Maximum number of http2 requests allowed */ - @JsonProperty(value = "http2MaxRequests") private Integer http2MaxRequests; /** @@ -77,4 +79,43 @@ public HttpConnectionPool withHttp2MaxRequests(Integer http2MaxRequests) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("http1MaxPendingRequests", this.http1MaxPendingRequests); + jsonWriter.writeNumberField("http2MaxRequests", this.http2MaxRequests); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HttpConnectionPool from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HttpConnectionPool if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the HttpConnectionPool. + */ + public static HttpConnectionPool fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HttpConnectionPool deserializedHttpConnectionPool = new HttpConnectionPool(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("http1MaxPendingRequests".equals(fieldName)) { + deserializedHttpConnectionPool.http1MaxPendingRequests = reader.getNullable(JsonReader::getInt); + } else if ("http2MaxRequests".equals(fieldName)) { + deserializedHttpConnectionPool.http2MaxRequests = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedHttpConnectionPool; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpGet.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpGet.java index bd154edb3423..5579b4b5dfbb 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpGet.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpGet.java @@ -6,30 +6,31 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.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; /** * Model representing a http get request. */ @Fluent -public final class HttpGet { +public final class HttpGet implements JsonSerializable { /* * URL to make HTTP GET request against. */ - @JsonProperty(value = "url", required = true) private String url; /* * Name of the file that the request should be saved to. */ - @JsonProperty(value = "fileName") private String fileName; /* * List of headers to send with the request. */ - @JsonProperty(value = "headers") private List headers; /** @@ -105,10 +106,53 @@ public HttpGet withHeaders(List headers) { */ public void validate() { if (url() == null) { - throw LOGGER - .logExceptionAsError(new IllegalArgumentException("Missing required property url in model HttpGet")); + throw LOGGER.atError().log(new IllegalArgumentException("Missing required property url in model HttpGet")); } } private static final ClientLogger LOGGER = new ClientLogger(HttpGet.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("url", this.url); + jsonWriter.writeStringField("fileName", this.fileName); + jsonWriter.writeArrayField("headers", this.headers, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HttpGet from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HttpGet 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 HttpGet. + */ + public static HttpGet fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HttpGet deserializedHttpGet = new HttpGet(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("url".equals(fieldName)) { + deserializedHttpGet.url = reader.getString(); + } else if ("fileName".equals(fieldName)) { + deserializedHttpGet.fileName = reader.getString(); + } else if ("headers".equals(fieldName)) { + List headers = reader.readArray(reader1 -> reader1.getString()); + deserializedHttpGet.headers = headers; + } else { + reader.skipChildren(); + } + } + + return deserializedHttpGet; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpRetryPolicy.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpRetryPolicy.java index e80b222f5f1e..2c4c1eee0e96 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpRetryPolicy.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpRetryPolicy.java @@ -5,32 +5,33 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.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.appcontainers.fluent.models.HttpRetryPolicyMatches; import com.azure.resourcemanager.appcontainers.fluent.models.HttpRetryPolicyRetryBackOff; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * Policy that defines http request retry conditions. */ @Fluent -public final class HttpRetryPolicy { +public final class HttpRetryPolicy implements JsonSerializable { /* * Maximum number of times a request will retry */ - @JsonProperty(value = "maxRetries") private Integer maxRetries; /* * Settings for retry backoff characteristics */ - @JsonProperty(value = "retryBackOff") private HttpRetryPolicyRetryBackOff innerRetryBackOff; /* * Conditions that must be met for a request to be retried */ - @JsonProperty(value = "matches") private HttpRetryPolicyMatches innerMatches; /** @@ -205,4 +206,46 @@ public void validate() { innerMatches().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("maxRetries", this.maxRetries); + jsonWriter.writeJsonField("retryBackOff", this.innerRetryBackOff); + jsonWriter.writeJsonField("matches", this.innerMatches); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HttpRetryPolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HttpRetryPolicy if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the HttpRetryPolicy. + */ + public static HttpRetryPolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HttpRetryPolicy deserializedHttpRetryPolicy = new HttpRetryPolicy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("maxRetries".equals(fieldName)) { + deserializedHttpRetryPolicy.maxRetries = reader.getNullable(JsonReader::getInt); + } else if ("retryBackOff".equals(fieldName)) { + deserializedHttpRetryPolicy.innerRetryBackOff = HttpRetryPolicyRetryBackOff.fromJson(reader); + } else if ("matches".equals(fieldName)) { + deserializedHttpRetryPolicy.innerMatches = HttpRetryPolicyMatches.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedHttpRetryPolicy; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpScaleRule.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpScaleRule.java index 0ecbbf8ea5f2..9624ae09d213 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpScaleRule.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpScaleRule.java @@ -5,8 +5,11 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.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; @@ -14,20 +17,23 @@ * Container App container Http scaling rule. */ @Fluent -public final class HttpScaleRule { +public final class HttpScaleRule implements JsonSerializable { /* * Metadata properties to describe http scale rule. */ - @JsonProperty(value = "metadata") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map metadata; /* * Authentication secrets for the custom scale rule. */ - @JsonProperty(value = "auth") private List auth; + /* + * The resource ID of a user-assigned managed identity that is assigned to the Container App, or 'system' for + * system-assigned identity. + */ + private String identity; + /** * Creates an instance of HttpScaleRule class. */ @@ -74,6 +80,28 @@ public HttpScaleRule withAuth(List auth) { return this; } + /** + * Get the identity property: The resource ID of a user-assigned managed identity that is assigned to the Container + * App, or 'system' for system-assigned identity. + * + * @return the identity value. + */ + public String identity() { + return this.identity; + } + + /** + * Set the identity property: The resource ID of a user-assigned managed identity that is assigned to the Container + * App, or 'system' for system-assigned identity. + * + * @param identity the identity value to set. + * @return the HttpScaleRule object itself. + */ + public HttpScaleRule withIdentity(String identity) { + this.identity = identity; + return this; + } + /** * Validates the instance. * @@ -84,4 +112,48 @@ public void validate() { auth().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("metadata", this.metadata, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("auth", this.auth, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("identity", this.identity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HttpScaleRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HttpScaleRule if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the HttpScaleRule. + */ + public static HttpScaleRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HttpScaleRule deserializedHttpScaleRule = new HttpScaleRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("metadata".equals(fieldName)) { + Map metadata = reader.readMap(reader1 -> reader1.getString()); + deserializedHttpScaleRule.metadata = metadata; + } else if ("auth".equals(fieldName)) { + List auth = reader.readArray(reader1 -> ScaleRuleAuth.fromJson(reader1)); + deserializedHttpScaleRule.auth = auth; + } else if ("identity".equals(fieldName)) { + deserializedHttpScaleRule.identity = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedHttpScaleRule; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpSettings.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpSettings.java index 59a984e74eb4..b886a17dfa2e 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpSettings.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpSettings.java @@ -5,31 +5,32 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The configuration settings of the HTTP requests for authentication and authorization requests made against * ContainerApp Service Authentication/Authorization. */ @Fluent -public final class HttpSettings { +public final class HttpSettings implements JsonSerializable { /* * false if the authentication/authorization responses not having the HTTPS scheme are permissible; * otherwise, true. */ - @JsonProperty(value = "requireHttps") private Boolean requireHttps; /* * The configuration settings of the paths HTTP requests. */ - @JsonProperty(value = "routes") private HttpSettingsRoutes routes; /* * The configuration settings of a forward proxy used to make the requests. */ - @JsonProperty(value = "forwardProxy") private ForwardProxy forwardProxy; /** @@ -113,4 +114,46 @@ public void validate() { forwardProxy().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("requireHttps", this.requireHttps); + jsonWriter.writeJsonField("routes", this.routes); + jsonWriter.writeJsonField("forwardProxy", this.forwardProxy); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HttpSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HttpSettings if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the HttpSettings. + */ + public static HttpSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HttpSettings deserializedHttpSettings = new HttpSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("requireHttps".equals(fieldName)) { + deserializedHttpSettings.requireHttps = reader.getNullable(JsonReader::getBoolean); + } else if ("routes".equals(fieldName)) { + deserializedHttpSettings.routes = HttpSettingsRoutes.fromJson(reader); + } else if ("forwardProxy".equals(fieldName)) { + deserializedHttpSettings.forwardProxy = ForwardProxy.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedHttpSettings; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpSettingsRoutes.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpSettingsRoutes.java index 53d5558dba0f..f37d6f68d3e0 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpSettingsRoutes.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpSettingsRoutes.java @@ -5,17 +5,20 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The configuration settings of the paths HTTP requests. */ @Fluent -public final class HttpSettingsRoutes { +public final class HttpSettingsRoutes implements JsonSerializable { /* * The prefix that should precede all the authentication/authorization paths. */ - @JsonProperty(value = "apiPrefix") private String apiPrefix; /** @@ -51,4 +54,40 @@ public HttpSettingsRoutes withApiPrefix(String apiPrefix) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("apiPrefix", this.apiPrefix); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HttpSettingsRoutes from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HttpSettingsRoutes if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the HttpSettingsRoutes. + */ + public static HttpSettingsRoutes fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HttpSettingsRoutes deserializedHttpSettingsRoutes = new HttpSettingsRoutes(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("apiPrefix".equals(fieldName)) { + deserializedHttpSettingsRoutes.apiPrefix = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedHttpSettingsRoutes; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IdentityProviders.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IdentityProviders.java index 762016808037..ae59391c0d2d 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IdentityProviders.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IdentityProviders.java @@ -5,8 +5,11 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.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; /** @@ -14,55 +17,46 @@ * Authentication/Authorization. */ @Fluent -public final class IdentityProviders { +public final class IdentityProviders implements JsonSerializable { /* * The configuration settings of the Azure Active directory provider. */ - @JsonProperty(value = "azureActiveDirectory") private AzureActiveDirectory azureActiveDirectory; /* * The configuration settings of the Facebook provider. */ - @JsonProperty(value = "facebook") private Facebook facebook; /* * The configuration settings of the GitHub provider. */ - @JsonProperty(value = "gitHub") private GitHub gitHub; /* * The configuration settings of the Google provider. */ - @JsonProperty(value = "google") private Google google; /* * The configuration settings of the Twitter provider. */ - @JsonProperty(value = "twitter") private Twitter twitter; /* * The configuration settings of the Apple provider. */ - @JsonProperty(value = "apple") private Apple apple; /* * The configuration settings of the Azure Static Web Apps provider. */ - @JsonProperty(value = "azureStaticWebApps") private AzureStaticWebApps azureStaticWebApps; /* * The map of the name of the alias of each custom Open ID Connect provider to the * configuration settings of the custom Open ID Connect provider. */ - @JsonProperty(value = "customOpenIdConnectProviders") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map customOpenIdConnectProviders; /** @@ -271,4 +265,64 @@ public void validate() { }); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("azureActiveDirectory", this.azureActiveDirectory); + jsonWriter.writeJsonField("facebook", this.facebook); + jsonWriter.writeJsonField("gitHub", this.gitHub); + jsonWriter.writeJsonField("google", this.google); + jsonWriter.writeJsonField("twitter", this.twitter); + jsonWriter.writeJsonField("apple", this.apple); + jsonWriter.writeJsonField("azureStaticWebApps", this.azureStaticWebApps); + jsonWriter.writeMapField("customOpenIdConnectProviders", this.customOpenIdConnectProviders, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IdentityProviders from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IdentityProviders if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the IdentityProviders. + */ + public static IdentityProviders fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IdentityProviders deserializedIdentityProviders = new IdentityProviders(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("azureActiveDirectory".equals(fieldName)) { + deserializedIdentityProviders.azureActiveDirectory = AzureActiveDirectory.fromJson(reader); + } else if ("facebook".equals(fieldName)) { + deserializedIdentityProviders.facebook = Facebook.fromJson(reader); + } else if ("gitHub".equals(fieldName)) { + deserializedIdentityProviders.gitHub = GitHub.fromJson(reader); + } else if ("google".equals(fieldName)) { + deserializedIdentityProviders.google = Google.fromJson(reader); + } else if ("twitter".equals(fieldName)) { + deserializedIdentityProviders.twitter = Twitter.fromJson(reader); + } else if ("apple".equals(fieldName)) { + deserializedIdentityProviders.apple = Apple.fromJson(reader); + } else if ("azureStaticWebApps".equals(fieldName)) { + deserializedIdentityProviders.azureStaticWebApps = AzureStaticWebApps.fromJson(reader); + } else if ("customOpenIdConnectProviders".equals(fieldName)) { + Map customOpenIdConnectProviders + = reader.readMap(reader1 -> CustomOpenIdConnectProvider.fromJson(reader1)); + deserializedIdentityProviders.customOpenIdConnectProviders = customOpenIdConnectProviders; + } else { + reader.skipChildren(); + } + } + + return deserializedIdentityProviders; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IdentitySettings.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IdentitySettings.java new file mode 100644 index 000000000000..700777e85038 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IdentitySettings.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.appcontainers.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 java.io.IOException; + +/** + * Optional settings for a Managed Identity that is assigned to the Container App. + */ +@Fluent +public final class IdentitySettings implements JsonSerializable { + /* + * The resource ID of a user-assigned managed identity that is assigned to the Container App, or 'system' for + * system-assigned identity. + */ + private String identity; + + /* + * Use to select the lifecycle stages of a Container App during which the Managed Identity should be available. + */ + private IdentitySettingsLifeCycle lifecycle; + + /** + * Creates an instance of IdentitySettings class. + */ + public IdentitySettings() { + } + + /** + * Get the identity property: The resource ID of a user-assigned managed identity that is assigned to the Container + * App, or 'system' for system-assigned identity. + * + * @return the identity value. + */ + public String identity() { + return this.identity; + } + + /** + * Set the identity property: The resource ID of a user-assigned managed identity that is assigned to the Container + * App, or 'system' for system-assigned identity. + * + * @param identity the identity value to set. + * @return the IdentitySettings object itself. + */ + public IdentitySettings withIdentity(String identity) { + this.identity = identity; + return this; + } + + /** + * Get the lifecycle property: Use to select the lifecycle stages of a Container App during which the Managed + * Identity should be available. + * + * @return the lifecycle value. + */ + public IdentitySettingsLifeCycle lifecycle() { + return this.lifecycle; + } + + /** + * Set the lifecycle property: Use to select the lifecycle stages of a Container App during which the Managed + * Identity should be available. + * + * @param lifecycle the lifecycle value to set. + * @return the IdentitySettings object itself. + */ + public IdentitySettings withLifecycle(IdentitySettingsLifeCycle lifecycle) { + this.lifecycle = lifecycle; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property identity in model IdentitySettings")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(IdentitySettings.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("identity", this.identity); + jsonWriter.writeStringField("lifecycle", this.lifecycle == null ? null : this.lifecycle.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IdentitySettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IdentitySettings 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 IdentitySettings. + */ + public static IdentitySettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IdentitySettings deserializedIdentitySettings = new IdentitySettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("identity".equals(fieldName)) { + deserializedIdentitySettings.identity = reader.getString(); + } else if ("lifecycle".equals(fieldName)) { + deserializedIdentitySettings.lifecycle = IdentitySettingsLifeCycle.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedIdentitySettings; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IdentitySettingsLifeCycle.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IdentitySettingsLifeCycle.java new file mode 100644 index 000000000000..3df9c4c12245 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IdentitySettingsLifeCycle.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.appcontainers.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Use to select the lifecycle stages of a Container App during which the Managed Identity should be available. + */ +public final class IdentitySettingsLifeCycle extends ExpandableStringEnum { + /** + * Static value Init for IdentitySettingsLifeCycle. + */ + public static final IdentitySettingsLifeCycle INIT = fromString("Init"); + + /** + * Static value Main for IdentitySettingsLifeCycle. + */ + public static final IdentitySettingsLifeCycle MAIN = fromString("Main"); + + /** + * Static value None for IdentitySettingsLifeCycle. + */ + public static final IdentitySettingsLifeCycle NONE = fromString("None"); + + /** + * Static value All for IdentitySettingsLifeCycle. + */ + public static final IdentitySettingsLifeCycle ALL = fromString("All"); + + /** + * Creates a new instance of IdentitySettingsLifeCycle value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public IdentitySettingsLifeCycle() { + } + + /** + * Creates or finds a IdentitySettingsLifeCycle from its string representation. + * + * @param name a name to look for. + * @return the corresponding IdentitySettingsLifeCycle. + */ + public static IdentitySettingsLifeCycle fromString(String name) { + return fromString(name, IdentitySettingsLifeCycle.class); + } + + /** + * Gets known IdentitySettingsLifeCycle values. + * + * @return known IdentitySettingsLifeCycle values. + */ + public static Collection values() { + return values(IdentitySettingsLifeCycle.class); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ImageType.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ImageType.java new file mode 100644 index 000000000000..968fafc226f6 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ImageType.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.appcontainers.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The type of the image. Set to CloudBuild to let the system manages the image, where user will not be able to update + * image through image field. Set to ContainerImage for user provided image. + */ +public final class ImageType extends ExpandableStringEnum { + /** + * Static value CloudBuild for ImageType. + */ + public static final ImageType CLOUD_BUILD = fromString("CloudBuild"); + + /** + * Static value ContainerImage for ImageType. + */ + public static final ImageType CONTAINER_IMAGE = fromString("ContainerImage"); + + /** + * Creates a new instance of ImageType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ImageType() { + } + + /** + * Creates or finds a ImageType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ImageType. + */ + public static ImageType fromString(String name) { + return fromString(name, ImageType.class); + } + + /** + * Gets known ImageType values. + * + * @return known ImageType values. + */ + public static Collection values() { + return values(ImageType.class); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Ingress.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Ingress.java index 115157470d1b..bcfe8ad33e0c 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Ingress.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Ingress.java @@ -5,73 +5,67 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.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; /** * Container App Ingress configuration. */ @Fluent -public final class Ingress { +public final class Ingress implements JsonSerializable { /* * Hostname. */ - @JsonProperty(value = "fqdn", access = JsonProperty.Access.WRITE_ONLY) private String fqdn; /* * Bool indicating if app exposes an external http endpoint */ - @JsonProperty(value = "external") private Boolean external; /* * Target Port in containers for traffic from ingress */ - @JsonProperty(value = "targetPort") private Integer targetPort; /* * Exposed Port in containers for TCP traffic from ingress */ - @JsonProperty(value = "exposedPort") private Integer exposedPort; /* * Ingress transport protocol */ - @JsonProperty(value = "transport") private IngressTransportMethod transport; /* * Traffic weights for app's revisions */ - @JsonProperty(value = "traffic") private List traffic; /* * custom domain bindings for Container Apps' hostnames. */ - @JsonProperty(value = "customDomains") private List customDomains; /* * Bool indicating if HTTP connections to is allowed. If set to false HTTP connections are automatically redirected * to HTTPS connections */ - @JsonProperty(value = "allowInsecure") private Boolean allowInsecure; /* * Rules to restrict incoming IP address. */ - @JsonProperty(value = "ipSecurityRestrictions") private List ipSecurityRestrictions; /* * Sticky Sessions for Single Revision Mode */ - @JsonProperty(value = "stickySessions") private IngressStickySessions stickySessions; /* @@ -79,25 +73,21 @@ public final class Ingress { * Accept indicates server forwards client certificate but does not require a client certificate. Require indicates * server requires a client certificate. */ - @JsonProperty(value = "clientCertificateMode") private IngressClientCertificateMode clientCertificateMode; /* * CORS policy for container app */ - @JsonProperty(value = "corsPolicy") private CorsPolicy corsPolicy; /* * Settings to expose additional ports on container app */ - @JsonProperty(value = "additionalPortMappings") private List additionalPortMappings; /* * Whether an http app listens on http or https */ - @JsonProperty(value = "targetPortHttpScheme") private IngressTargetPortHttpScheme targetPortHttpScheme; /** @@ -406,4 +396,90 @@ public void validate() { additionalPortMappings().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("external", this.external); + jsonWriter.writeNumberField("targetPort", this.targetPort); + jsonWriter.writeNumberField("exposedPort", this.exposedPort); + jsonWriter.writeStringField("transport", this.transport == null ? null : this.transport.toString()); + jsonWriter.writeArrayField("traffic", this.traffic, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("customDomains", this.customDomains, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("allowInsecure", this.allowInsecure); + jsonWriter.writeArrayField("ipSecurityRestrictions", this.ipSecurityRestrictions, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("stickySessions", this.stickySessions); + jsonWriter.writeStringField("clientCertificateMode", + this.clientCertificateMode == null ? null : this.clientCertificateMode.toString()); + jsonWriter.writeJsonField("corsPolicy", this.corsPolicy); + jsonWriter.writeArrayField("additionalPortMappings", this.additionalPortMappings, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("targetPortHttpScheme", + this.targetPortHttpScheme == null ? null : this.targetPortHttpScheme.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ingress from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ingress if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Ingress. + */ + public static Ingress fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ingress deserializedIngress = new Ingress(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("fqdn".equals(fieldName)) { + deserializedIngress.fqdn = reader.getString(); + } else if ("external".equals(fieldName)) { + deserializedIngress.external = reader.getNullable(JsonReader::getBoolean); + } else if ("targetPort".equals(fieldName)) { + deserializedIngress.targetPort = reader.getNullable(JsonReader::getInt); + } else if ("exposedPort".equals(fieldName)) { + deserializedIngress.exposedPort = reader.getNullable(JsonReader::getInt); + } else if ("transport".equals(fieldName)) { + deserializedIngress.transport = IngressTransportMethod.fromString(reader.getString()); + } else if ("traffic".equals(fieldName)) { + List traffic = reader.readArray(reader1 -> TrafficWeight.fromJson(reader1)); + deserializedIngress.traffic = traffic; + } else if ("customDomains".equals(fieldName)) { + List customDomains = reader.readArray(reader1 -> CustomDomain.fromJson(reader1)); + deserializedIngress.customDomains = customDomains; + } else if ("allowInsecure".equals(fieldName)) { + deserializedIngress.allowInsecure = reader.getNullable(JsonReader::getBoolean); + } else if ("ipSecurityRestrictions".equals(fieldName)) { + List ipSecurityRestrictions + = reader.readArray(reader1 -> IpSecurityRestrictionRule.fromJson(reader1)); + deserializedIngress.ipSecurityRestrictions = ipSecurityRestrictions; + } else if ("stickySessions".equals(fieldName)) { + deserializedIngress.stickySessions = IngressStickySessions.fromJson(reader); + } else if ("clientCertificateMode".equals(fieldName)) { + deserializedIngress.clientCertificateMode + = IngressClientCertificateMode.fromString(reader.getString()); + } else if ("corsPolicy".equals(fieldName)) { + deserializedIngress.corsPolicy = CorsPolicy.fromJson(reader); + } else if ("additionalPortMappings".equals(fieldName)) { + List additionalPortMappings + = reader.readArray(reader1 -> IngressPortMapping.fromJson(reader1)); + deserializedIngress.additionalPortMappings = additionalPortMappings; + } else if ("targetPortHttpScheme".equals(fieldName)) { + deserializedIngress.targetPortHttpScheme + = IngressTargetPortHttpScheme.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedIngress; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IngressClientCertificateMode.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IngressClientCertificateMode.java index 2600873124df..f5608a399d61 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IngressClientCertificateMode.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IngressClientCertificateMode.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -44,7 +43,6 @@ public IngressClientCertificateMode() { * @param name a name to look for. * @return the corresponding IngressClientCertificateMode. */ - @JsonCreator public static IngressClientCertificateMode fromString(String name) { return fromString(name, IngressClientCertificateMode.class); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IngressPortMapping.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IngressPortMapping.java index 204a36953b79..a63a4cc5c689 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IngressPortMapping.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IngressPortMapping.java @@ -5,29 +5,30 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Port mappings of container app ingress. */ @Fluent -public final class IngressPortMapping { +public final class IngressPortMapping implements JsonSerializable { /* * Specifies whether the app port is accessible outside of the environment */ - @JsonProperty(value = "external", required = true) private boolean external; /* * Specifies the port user's container listens on */ - @JsonProperty(value = "targetPort", required = true) private int targetPort; /* * Specifies the exposed port for the target port. If not specified, it defaults to target port */ - @JsonProperty(value = "exposedPort") private Integer exposedPort; /** @@ -105,4 +106,47 @@ public IngressPortMapping withExposedPort(Integer exposedPort) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("external", this.external); + jsonWriter.writeIntField("targetPort", this.targetPort); + jsonWriter.writeNumberField("exposedPort", this.exposedPort); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IngressPortMapping from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IngressPortMapping 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 IngressPortMapping. + */ + public static IngressPortMapping fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IngressPortMapping deserializedIngressPortMapping = new IngressPortMapping(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("external".equals(fieldName)) { + deserializedIngressPortMapping.external = reader.getBoolean(); + } else if ("targetPort".equals(fieldName)) { + deserializedIngressPortMapping.targetPort = reader.getInt(); + } else if ("exposedPort".equals(fieldName)) { + deserializedIngressPortMapping.exposedPort = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedIngressPortMapping; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IngressStickySessions.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IngressStickySessions.java index b6f60418efd7..7db79d0ba2d7 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IngressStickySessions.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IngressStickySessions.java @@ -5,17 +5,20 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Sticky Sessions for Single Revision Mode. */ @Fluent -public final class IngressStickySessions { +public final class IngressStickySessions implements JsonSerializable { /* * Sticky Session Affinity */ - @JsonProperty(value = "affinity") private Affinity affinity; /** @@ -51,4 +54,40 @@ public IngressStickySessions withAffinity(Affinity affinity) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("affinity", this.affinity == null ? null : this.affinity.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IngressStickySessions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IngressStickySessions if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the IngressStickySessions. + */ + public static IngressStickySessions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IngressStickySessions deserializedIngressStickySessions = new IngressStickySessions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("affinity".equals(fieldName)) { + deserializedIngressStickySessions.affinity = Affinity.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedIngressStickySessions; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IngressTargetPortHttpScheme.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IngressTargetPortHttpScheme.java index 479288c1707b..2a165d3bcd0b 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IngressTargetPortHttpScheme.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IngressTargetPortHttpScheme.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public IngressTargetPortHttpScheme() { * @param name a name to look for. * @return the corresponding IngressTargetPortHttpScheme. */ - @JsonCreator public static IngressTargetPortHttpScheme fromString(String name) { return fromString(name, IngressTargetPortHttpScheme.class); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IngressTransportMethod.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IngressTransportMethod.java index e7f0f64fc6a0..b8c6fd366086 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IngressTransportMethod.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IngressTransportMethod.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -47,7 +46,6 @@ public IngressTransportMethod() { * @param name a name to look for. * @return the corresponding IngressTransportMethod. */ - @JsonCreator public static IngressTransportMethod fromString(String name) { return fromString(name, IngressTransportMethod.class); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/InitContainer.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/InitContainer.java index dc57c485c5b8..1281048035a0 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/InitContainer.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/InitContainer.java @@ -5,6 +5,10 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** @@ -27,6 +31,15 @@ public InitContainer withImage(String image) { return this; } + /** + * {@inheritDoc} + */ + @Override + public InitContainer withImageType(ImageType imageType) { + super.withImageType(imageType); + return this; + } + /** * {@inheritDoc} */ @@ -90,4 +103,65 @@ public InitContainer withVolumeMounts(List volumeMounts) { public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("image", image()); + jsonWriter.writeStringField("imageType", imageType() == null ? null : imageType().toString()); + jsonWriter.writeStringField("name", name()); + jsonWriter.writeArrayField("command", command(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("args", args(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("env", env(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("resources", resources()); + jsonWriter.writeArrayField("volumeMounts", volumeMounts(), (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InitContainer from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InitContainer if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the InitContainer. + */ + public static InitContainer fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InitContainer deserializedInitContainer = new InitContainer(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("image".equals(fieldName)) { + deserializedInitContainer.withImage(reader.getString()); + } else if ("imageType".equals(fieldName)) { + deserializedInitContainer.withImageType(ImageType.fromString(reader.getString())); + } else if ("name".equals(fieldName)) { + deserializedInitContainer.withName(reader.getString()); + } else if ("command".equals(fieldName)) { + List command = reader.readArray(reader1 -> reader1.getString()); + deserializedInitContainer.withCommand(command); + } else if ("args".equals(fieldName)) { + List args = reader.readArray(reader1 -> reader1.getString()); + deserializedInitContainer.withArgs(args); + } else if ("env".equals(fieldName)) { + List env = reader.readArray(reader1 -> EnvironmentVar.fromJson(reader1)); + deserializedInitContainer.withEnv(env); + } else if ("resources".equals(fieldName)) { + deserializedInitContainer.withResources(ContainerResources.fromJson(reader)); + } else if ("volumeMounts".equals(fieldName)) { + List volumeMounts = reader.readArray(reader1 -> VolumeMount.fromJson(reader1)); + deserializedInitContainer.withVolumeMounts(volumeMounts); + } else { + reader.skipChildren(); + } + } + + return deserializedInitContainer; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IpSecurityRestrictionRule.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IpSecurityRestrictionRule.java index 78fa22df8a37..26c3df77d00e 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IpSecurityRestrictionRule.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IpSecurityRestrictionRule.java @@ -6,35 +6,35 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Rule to restrict incoming IP address. */ @Fluent -public final class IpSecurityRestrictionRule { +public final class IpSecurityRestrictionRule implements JsonSerializable { /* * Name for the IP restriction rule. */ - @JsonProperty(value = "name", required = true) private String name; /* * Describe the IP restriction rule that is being sent to the container-app. This is an optional field. */ - @JsonProperty(value = "description") private String description; /* * CIDR notation to match incoming IP address */ - @JsonProperty(value = "ipAddressRange", required = true) private String ipAddressRange; /* * Allow or Deny rules to determine for incoming IP. Note: Rules can only consist of ALL Allow or ALL Deny */ - @JsonProperty(value = "action", required = true) private Action action; /** @@ -134,18 +134,66 @@ public IpSecurityRestrictionRule withAction(Action action) { */ public void validate() { if (name() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property name in model IpSecurityRestrictionRule")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property name in model IpSecurityRestrictionRule")); } if (ipAddressRange() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property ipAddressRange in model IpSecurityRestrictionRule")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property ipAddressRange in model IpSecurityRestrictionRule")); } if (action() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property action in model IpSecurityRestrictionRule")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property action in model IpSecurityRestrictionRule")); } } private static final ClientLogger LOGGER = new ClientLogger(IpSecurityRestrictionRule.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("ipAddressRange", this.ipAddressRange); + jsonWriter.writeStringField("action", this.action == null ? null : this.action.toString()); + jsonWriter.writeStringField("description", this.description); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IpSecurityRestrictionRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IpSecurityRestrictionRule 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 IpSecurityRestrictionRule. + */ + public static IpSecurityRestrictionRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IpSecurityRestrictionRule deserializedIpSecurityRestrictionRule = new IpSecurityRestrictionRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedIpSecurityRestrictionRule.name = reader.getString(); + } else if ("ipAddressRange".equals(fieldName)) { + deserializedIpSecurityRestrictionRule.ipAddressRange = reader.getString(); + } else if ("action".equals(fieldName)) { + deserializedIpSecurityRestrictionRule.action = Action.fromString(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedIpSecurityRestrictionRule.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedIpSecurityRestrictionRule; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JavaComponent.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JavaComponent.java index bf42b2379e15..0faa35c4e557 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JavaComponent.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JavaComponent.java @@ -7,7 +7,6 @@ import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.appcontainers.fluent.models.JavaComponentInner; -import java.util.List; /** * An immutable client-side representation of JavaComponent. @@ -35,39 +34,18 @@ public interface JavaComponent { String type(); /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the componentType property: Type of the Java Component. + * Gets the properties property: Java Component resource specific properties. * - * @return the componentType value. + * @return the properties value. */ - JavaComponentType componentType(); + JavaComponentProperties properties(); /** - * Gets the provisioningState property: Provisioning state of the Java Component. - * - * @return the provisioningState value. - */ - JavaComponentProvisioningState provisioningState(); - - /** - * Gets the configurations property: List of Java Components configuration properties. - * - * @return the configurations value. - */ - List configurations(); - - /** - * Gets the serviceBinds property: List of Java Components that are bound to the Java component. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the serviceBinds value. + * @return the systemData value. */ - List serviceBinds(); + SystemData systemData(); /** * Gets the name of the resource group. @@ -118,8 +96,7 @@ interface WithParentResource { * The stage of the JavaComponent 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.WithComponentType, DefinitionStages.WithConfigurations, - DefinitionStages.WithServiceBinds { + interface WithCreate extends DefinitionStages.WithProperties { /** * Executes the create request. * @@ -137,42 +114,16 @@ interface WithCreate extends DefinitionStages.WithComponentType, DefinitionStage } /** - * The stage of the JavaComponent definition allowing to specify componentType. - */ - interface WithComponentType { - /** - * Specifies the componentType property: Type of the Java Component.. - * - * @param componentType Type of the Java Component. - * @return the next definition stage. - */ - WithCreate withComponentType(JavaComponentType componentType); - } - - /** - * The stage of the JavaComponent definition allowing to specify configurations. + * The stage of the JavaComponent definition allowing to specify properties. */ - interface WithConfigurations { + interface WithProperties { /** - * Specifies the configurations property: List of Java Components configuration properties. + * Specifies the properties property: Java Component resource specific properties. * - * @param configurations List of Java Components configuration properties. + * @param properties Java Component resource specific properties. * @return the next definition stage. */ - WithCreate withConfigurations(List configurations); - } - - /** - * The stage of the JavaComponent definition allowing to specify serviceBinds. - */ - interface WithServiceBinds { - /** - * Specifies the serviceBinds property: List of Java Components that are bound to the Java component. - * - * @param serviceBinds List of Java Components that are bound to the Java component. - * @return the next definition stage. - */ - WithCreate withServiceBinds(List serviceBinds); + WithCreate withProperties(JavaComponentProperties properties); } } @@ -186,8 +137,7 @@ interface WithServiceBinds { /** * The template for JavaComponent update. */ - interface Update - extends UpdateStages.WithComponentType, UpdateStages.WithConfigurations, UpdateStages.WithServiceBinds { + interface Update extends UpdateStages.WithProperties { /** * Executes the update request. * @@ -209,42 +159,16 @@ interface Update */ interface UpdateStages { /** - * The stage of the JavaComponent update allowing to specify componentType. - */ - interface WithComponentType { - /** - * Specifies the componentType property: Type of the Java Component.. - * - * @param componentType Type of the Java Component. - * @return the next definition stage. - */ - Update withComponentType(JavaComponentType componentType); - } - - /** - * The stage of the JavaComponent update allowing to specify configurations. - */ - interface WithConfigurations { - /** - * Specifies the configurations property: List of Java Components configuration properties. - * - * @param configurations List of Java Components configuration properties. - * @return the next definition stage. - */ - Update withConfigurations(List configurations); - } - - /** - * The stage of the JavaComponent update allowing to specify serviceBinds. + * The stage of the JavaComponent update allowing to specify properties. */ - interface WithServiceBinds { + interface WithProperties { /** - * Specifies the serviceBinds property: List of Java Components that are bound to the Java component. + * Specifies the properties property: Java Component resource specific properties. * - * @param serviceBinds List of Java Components that are bound to the Java component. + * @param properties Java Component resource specific properties. * @return the next definition stage. */ - Update withServiceBinds(List serviceBinds); + Update withProperties(JavaComponentProperties properties); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JavaComponentConfigurationProperty.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JavaComponentConfigurationProperty.java index 03843583c021..923aae747536 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JavaComponentConfigurationProperty.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JavaComponentConfigurationProperty.java @@ -5,23 +5,25 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Configuration properties for a Java Component. */ @Fluent -public final class JavaComponentConfigurationProperty { +public final class JavaComponentConfigurationProperty implements JsonSerializable { /* * The name of the property */ - @JsonProperty(value = "propertyName") private String propertyName; /* * The value of the property */ - @JsonProperty(value = "value") private String value; /** @@ -77,4 +79,44 @@ public JavaComponentConfigurationProperty withValue(String value) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("propertyName", this.propertyName); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of JavaComponentConfigurationProperty from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of JavaComponentConfigurationProperty if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the JavaComponentConfigurationProperty. + */ + public static JavaComponentConfigurationProperty fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + JavaComponentConfigurationProperty deserializedJavaComponentConfigurationProperty + = new JavaComponentConfigurationProperty(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("propertyName".equals(fieldName)) { + deserializedJavaComponentConfigurationProperty.propertyName = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedJavaComponentConfigurationProperty.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedJavaComponentConfigurationProperty; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JavaComponentIngress.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JavaComponentIngress.java new file mode 100644 index 000000000000..bf0d5ec6b725 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JavaComponentIngress.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.appcontainers.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; + +/** + * Container App Ingress configuration. + */ +@Immutable +public final class JavaComponentIngress implements JsonSerializable { + /* + * Hostname of the Java Component endpoint + */ + private String fqdn; + + /** + * Creates an instance of JavaComponentIngress class. + */ + public JavaComponentIngress() { + } + + /** + * Get the fqdn property: Hostname of the Java Component endpoint. + * + * @return the fqdn value. + */ + public String fqdn() { + return this.fqdn; + } + + /** + * Validates the 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 JavaComponentIngress from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of JavaComponentIngress if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the JavaComponentIngress. + */ + public static JavaComponentIngress fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + JavaComponentIngress deserializedJavaComponentIngress = new JavaComponentIngress(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("fqdn".equals(fieldName)) { + deserializedJavaComponentIngress.fqdn = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedJavaComponentIngress; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JavaComponentProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JavaComponentProperties.java new file mode 100644 index 000000000000..8018f5112916 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JavaComponentProperties.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.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.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; + +/** + * Java Component common properties. + */ +@Fluent +public class JavaComponentProperties implements JsonSerializable { + /* + * Type of the Java Component. + */ + private JavaComponentType componentType = JavaComponentType.fromString("JavaComponentProperties"); + + /* + * Provisioning state of the Java Component. + */ + private JavaComponentProvisioningState provisioningState; + + /* + * List of Java Components configuration properties + */ + private List configurations; + + /* + * List of Java Components that are bound to the Java component + */ + private List serviceBinds; + + /** + * Creates an instance of JavaComponentProperties class. + */ + public JavaComponentProperties() { + } + + /** + * Get the componentType property: Type of the Java Component. + * + * @return the componentType value. + */ + public JavaComponentType componentType() { + return this.componentType; + } + + /** + * Get the provisioningState property: Provisioning state of the Java Component. + * + * @return the provisioningState value. + */ + public JavaComponentProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: Provisioning state of the Java Component. + * + * @param provisioningState the provisioningState value to set. + * @return the JavaComponentProperties object itself. + */ + JavaComponentProperties withProvisioningState(JavaComponentProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the configurations property: List of Java Components configuration properties. + * + * @return the configurations value. + */ + public List configurations() { + return this.configurations; + } + + /** + * Set the configurations property: List of Java Components configuration properties. + * + * @param configurations the configurations value to set. + * @return the JavaComponentProperties object itself. + */ + public JavaComponentProperties withConfigurations(List configurations) { + this.configurations = configurations; + return this; + } + + /** + * Get the serviceBinds property: List of Java Components that are bound to the Java component. + * + * @return the serviceBinds value. + */ + public List serviceBinds() { + return this.serviceBinds; + } + + /** + * Set the serviceBinds property: List of Java Components that are bound to the Java component. + * + * @param serviceBinds the serviceBinds value to set. + * @return the JavaComponentProperties object itself. + */ + public JavaComponentProperties withServiceBinds(List serviceBinds) { + this.serviceBinds = serviceBinds; + 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()); + } + if (serviceBinds() != null) { + serviceBinds().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("componentType", this.componentType == null ? null : this.componentType.toString()); + jsonWriter.writeArrayField("configurations", this.configurations, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("serviceBinds", this.serviceBinds, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of JavaComponentProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of JavaComponentProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the JavaComponentProperties. + */ + public static JavaComponentProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("componentType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("SpringBootAdmin".equals(discriminatorValue)) { + return SpringBootAdminComponent.fromJson(readerToUse.reset()); + } else if ("Nacos".equals(discriminatorValue)) { + return NacosComponent.fromJson(readerToUse.reset()); + } else if ("SpringCloudEureka".equals(discriminatorValue)) { + return SpringCloudEurekaComponent.fromJson(readerToUse.reset()); + } else if ("SpringCloudConfig".equals(discriminatorValue)) { + return SpringCloudConfigComponent.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static JavaComponentProperties fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + JavaComponentProperties deserializedJavaComponentProperties = new JavaComponentProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("componentType".equals(fieldName)) { + deserializedJavaComponentProperties.componentType + = JavaComponentType.fromString(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedJavaComponentProperties.provisioningState + = JavaComponentProvisioningState.fromString(reader.getString()); + } else if ("configurations".equals(fieldName)) { + List configurations + = reader.readArray(reader1 -> JavaComponentConfigurationProperty.fromJson(reader1)); + deserializedJavaComponentProperties.configurations = configurations; + } else if ("serviceBinds".equals(fieldName)) { + List serviceBinds + = reader.readArray(reader1 -> JavaComponentServiceBind.fromJson(reader1)); + deserializedJavaComponentProperties.serviceBinds = serviceBinds; + } else { + reader.skipChildren(); + } + } + + return deserializedJavaComponentProperties; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JavaComponentProvisioningState.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JavaComponentProvisioningState.java index 40caabccda70..74f85932f5fa 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JavaComponentProvisioningState.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JavaComponentProvisioningState.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -52,7 +51,6 @@ public JavaComponentProvisioningState() { * @param name a name to look for. * @return the corresponding JavaComponentProvisioningState. */ - @JsonCreator public static JavaComponentProvisioningState fromString(String name) { return fromString(name, JavaComponentProvisioningState.class); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JavaComponentServiceBind.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JavaComponentServiceBind.java index 382c10132618..d09561fc2907 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JavaComponentServiceBind.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JavaComponentServiceBind.java @@ -5,23 +5,25 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Configuration to bind a Java Component to another Java Component. */ @Fluent -public final class JavaComponentServiceBind { +public final class JavaComponentServiceBind implements JsonSerializable { /* * Name of the service bind */ - @JsonProperty(value = "name") private String name; /* * Resource id of the target service */ - @JsonProperty(value = "serviceId") private String serviceId; /** @@ -77,4 +79,43 @@ public JavaComponentServiceBind withServiceId(String serviceId) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("serviceId", this.serviceId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of JavaComponentServiceBind from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of JavaComponentServiceBind if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the JavaComponentServiceBind. + */ + public static JavaComponentServiceBind fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + JavaComponentServiceBind deserializedJavaComponentServiceBind = new JavaComponentServiceBind(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedJavaComponentServiceBind.name = reader.getString(); + } else if ("serviceId".equals(fieldName)) { + deserializedJavaComponentServiceBind.serviceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedJavaComponentServiceBind; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JavaComponentType.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JavaComponentType.java index 60c54e06369d..696ebf961633 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JavaComponentType.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JavaComponentType.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -27,6 +26,11 @@ public final class JavaComponentType extends ExpandableStringEnum { /* * Collection of resources. */ - @JsonProperty(value = "value", required = true) private List value; /* * Link to next page of resources. */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; /** @@ -69,12 +71,52 @@ public String nextLink() { */ public void validate() { if (value() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property value in model JavaComponentsCollection")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model JavaComponentsCollection")); } else { value().forEach(e -> e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(JavaComponentsCollection.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of JavaComponentsCollection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of JavaComponentsCollection 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 JavaComponentsCollection. + */ + public static JavaComponentsCollection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + JavaComponentsCollection deserializedJavaComponentsCollection = new JavaComponentsCollection(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> JavaComponentInner.fromJson(reader1)); + deserializedJavaComponentsCollection.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedJavaComponentsCollection.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedJavaComponentsCollection; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobConfiguration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobConfiguration.java index 12c36c4401d1..5f8e8c2f509a 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobConfiguration.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobConfiguration.java @@ -6,64 +6,66 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.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; /** * Non versioned Container Apps Job configuration properties. */ @Fluent -public final class JobConfiguration { +public final class JobConfiguration implements JsonSerializable { /* * Collection of secrets used by a Container Apps Job */ - @JsonProperty(value = "secrets") private List secrets; /* * Trigger type of the job */ - @JsonProperty(value = "triggerType", required = true) private TriggerType triggerType; /* * Maximum number of seconds a replica is allowed to run. */ - @JsonProperty(value = "replicaTimeout", required = true) private int replicaTimeout; /* * Maximum number of retries before failing the job. */ - @JsonProperty(value = "replicaRetryLimit") private Integer replicaRetryLimit; /* * Manual trigger configuration for a single execution job. Properties replicaCompletionCount and parallelism would * be set to 1 by default */ - @JsonProperty(value = "manualTriggerConfig") private JobConfigurationManualTriggerConfig manualTriggerConfig; /* * Cron formatted repeating trigger schedule ("* * * * *") for cronjobs. Properties completions and parallelism * would be set to 1 by default */ - @JsonProperty(value = "scheduleTriggerConfig") private JobConfigurationScheduleTriggerConfig scheduleTriggerConfig; /* * Trigger configuration of an event driven job. */ - @JsonProperty(value = "eventTriggerConfig") private JobConfigurationEventTriggerConfig eventTriggerConfig; /* * Collection of private container registry credentials used by a Container apps job */ - @JsonProperty(value = "registries") private List registries; + /* + * Optional settings for Managed Identities that are assigned to the Container App Job. If a Managed Identity is not + * specified here, default settings will be used. + */ + private List identitySettings; + /** * Creates an instance of JobConfiguration class. */ @@ -234,6 +236,28 @@ public JobConfiguration withRegistries(List registries) { return this; } + /** + * Get the identitySettings property: Optional settings for Managed Identities that are assigned to the Container + * App Job. If a Managed Identity is not specified here, default settings will be used. + * + * @return the identitySettings value. + */ + public List identitySettings() { + return this.identitySettings; + } + + /** + * Set the identitySettings property: Optional settings for Managed Identities that are assigned to the Container + * App Job. If a Managed Identity is not specified here, default settings will be used. + * + * @param identitySettings the identitySettings value to set. + * @return the JobConfiguration object itself. + */ + public JobConfiguration withIdentitySettings(List identitySettings) { + this.identitySettings = identitySettings; + return this; + } + /** * Validates the instance. * @@ -244,8 +268,8 @@ public void validate() { secrets().forEach(e -> e.validate()); } if (triggerType() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property triggerType in model JobConfiguration")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property triggerType in model JobConfiguration")); } if (manualTriggerConfig() != null) { manualTriggerConfig().validate(); @@ -259,7 +283,80 @@ public void validate() { if (registries() != null) { registries().forEach(e -> e.validate()); } + if (identitySettings() != null) { + identitySettings().forEach(e -> e.validate()); + } } private static final ClientLogger LOGGER = new ClientLogger(JobConfiguration.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("triggerType", this.triggerType == null ? null : this.triggerType.toString()); + jsonWriter.writeIntField("replicaTimeout", this.replicaTimeout); + jsonWriter.writeArrayField("secrets", this.secrets, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeNumberField("replicaRetryLimit", this.replicaRetryLimit); + jsonWriter.writeJsonField("manualTriggerConfig", this.manualTriggerConfig); + jsonWriter.writeJsonField("scheduleTriggerConfig", this.scheduleTriggerConfig); + jsonWriter.writeJsonField("eventTriggerConfig", this.eventTriggerConfig); + jsonWriter.writeArrayField("registries", this.registries, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("identitySettings", this.identitySettings, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of JobConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of JobConfiguration 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 JobConfiguration. + */ + public static JobConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + JobConfiguration deserializedJobConfiguration = new JobConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("triggerType".equals(fieldName)) { + deserializedJobConfiguration.triggerType = TriggerType.fromString(reader.getString()); + } else if ("replicaTimeout".equals(fieldName)) { + deserializedJobConfiguration.replicaTimeout = reader.getInt(); + } else if ("secrets".equals(fieldName)) { + List secrets = reader.readArray(reader1 -> Secret.fromJson(reader1)); + deserializedJobConfiguration.secrets = secrets; + } else if ("replicaRetryLimit".equals(fieldName)) { + deserializedJobConfiguration.replicaRetryLimit = reader.getNullable(JsonReader::getInt); + } else if ("manualTriggerConfig".equals(fieldName)) { + deserializedJobConfiguration.manualTriggerConfig + = JobConfigurationManualTriggerConfig.fromJson(reader); + } else if ("scheduleTriggerConfig".equals(fieldName)) { + deserializedJobConfiguration.scheduleTriggerConfig + = JobConfigurationScheduleTriggerConfig.fromJson(reader); + } else if ("eventTriggerConfig".equals(fieldName)) { + deserializedJobConfiguration.eventTriggerConfig + = JobConfigurationEventTriggerConfig.fromJson(reader); + } else if ("registries".equals(fieldName)) { + List registries + = reader.readArray(reader1 -> RegistryCredentials.fromJson(reader1)); + deserializedJobConfiguration.registries = registries; + } else if ("identitySettings".equals(fieldName)) { + List identitySettings + = reader.readArray(reader1 -> IdentitySettings.fromJson(reader1)); + deserializedJobConfiguration.identitySettings = identitySettings; + } else { + reader.skipChildren(); + } + } + + return deserializedJobConfiguration; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobConfigurationEventTriggerConfig.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobConfigurationEventTriggerConfig.java index fb10042c2e63..583fc0410cf3 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobConfigurationEventTriggerConfig.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobConfigurationEventTriggerConfig.java @@ -5,29 +5,30 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Trigger configuration of an event driven job. */ @Fluent -public final class JobConfigurationEventTriggerConfig { +public final class JobConfigurationEventTriggerConfig implements JsonSerializable { /* * Minimum number of successful replica completions before overall job completion. */ - @JsonProperty(value = "replicaCompletionCount") private Integer replicaCompletionCount; /* * Number of parallel replicas of a job that can run at a given time. */ - @JsonProperty(value = "parallelism") private Integer parallelism; /* * Scaling configurations for event driven jobs. */ - @JsonProperty(value = "scale") private JobScale scale; /** @@ -108,4 +109,48 @@ public void validate() { scale().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("replicaCompletionCount", this.replicaCompletionCount); + jsonWriter.writeNumberField("parallelism", this.parallelism); + jsonWriter.writeJsonField("scale", this.scale); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of JobConfigurationEventTriggerConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of JobConfigurationEventTriggerConfig if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the JobConfigurationEventTriggerConfig. + */ + public static JobConfigurationEventTriggerConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + JobConfigurationEventTriggerConfig deserializedJobConfigurationEventTriggerConfig + = new JobConfigurationEventTriggerConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("replicaCompletionCount".equals(fieldName)) { + deserializedJobConfigurationEventTriggerConfig.replicaCompletionCount + = reader.getNullable(JsonReader::getInt); + } else if ("parallelism".equals(fieldName)) { + deserializedJobConfigurationEventTriggerConfig.parallelism = reader.getNullable(JsonReader::getInt); + } else if ("scale".equals(fieldName)) { + deserializedJobConfigurationEventTriggerConfig.scale = JobScale.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedJobConfigurationEventTriggerConfig; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobConfigurationManualTriggerConfig.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobConfigurationManualTriggerConfig.java index dbc0e1127a7b..70349f5ae83c 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobConfigurationManualTriggerConfig.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobConfigurationManualTriggerConfig.java @@ -5,24 +5,27 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Manual trigger configuration for a single execution job. Properties replicaCompletionCount and parallelism would be * set to 1 by default. */ @Fluent -public final class JobConfigurationManualTriggerConfig { +public final class JobConfigurationManualTriggerConfig + implements JsonSerializable { /* * Minimum number of successful replica completions before overall job completion. */ - @JsonProperty(value = "replicaCompletionCount") private Integer replicaCompletionCount; /* * Number of parallel replicas of a job that can run at a given time. */ - @JsonProperty(value = "parallelism") private Integer parallelism; /** @@ -80,4 +83,46 @@ public JobConfigurationManualTriggerConfig withParallelism(Integer parallelism) */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("replicaCompletionCount", this.replicaCompletionCount); + jsonWriter.writeNumberField("parallelism", this.parallelism); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of JobConfigurationManualTriggerConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of JobConfigurationManualTriggerConfig if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the JobConfigurationManualTriggerConfig. + */ + public static JobConfigurationManualTriggerConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + JobConfigurationManualTriggerConfig deserializedJobConfigurationManualTriggerConfig + = new JobConfigurationManualTriggerConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("replicaCompletionCount".equals(fieldName)) { + deserializedJobConfigurationManualTriggerConfig.replicaCompletionCount + = reader.getNullable(JsonReader::getInt); + } else if ("parallelism".equals(fieldName)) { + deserializedJobConfigurationManualTriggerConfig.parallelism + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedJobConfigurationManualTriggerConfig; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobConfigurationScheduleTriggerConfig.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobConfigurationScheduleTriggerConfig.java index 4ce57dc75d70..935e05c9fca0 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobConfigurationScheduleTriggerConfig.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobConfigurationScheduleTriggerConfig.java @@ -6,30 +6,32 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** - * Cron formatted repeating trigger schedule ("* * * * *") for cronjobs. Properties completions and parallelism would - * be set to 1 by default. + * Cron formatted repeating trigger schedule ("* * * * *") for cronjobs. Properties completions and parallelism would be + * set to 1 by default. */ @Fluent -public final class JobConfigurationScheduleTriggerConfig { +public final class JobConfigurationScheduleTriggerConfig + implements JsonSerializable { /* * Minimum number of successful replica completions before overall job completion. */ - @JsonProperty(value = "replicaCompletionCount") private Integer replicaCompletionCount; /* * Cron formatted repeating schedule ("* * * * *") of a Cron Job. */ - @JsonProperty(value = "cronExpression", required = true) private String cronExpression; /* * Number of parallel replicas of a job that can run at a given time. */ - @JsonProperty(value = "parallelism") private Integer parallelism; /** @@ -107,10 +109,57 @@ public JobConfigurationScheduleTriggerConfig withParallelism(Integer parallelism */ public void validate() { if (cronExpression() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property cronExpression in model JobConfigurationScheduleTriggerConfig")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property cronExpression in model JobConfigurationScheduleTriggerConfig")); } } private static final ClientLogger LOGGER = new ClientLogger(JobConfigurationScheduleTriggerConfig.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("cronExpression", this.cronExpression); + jsonWriter.writeNumberField("replicaCompletionCount", this.replicaCompletionCount); + jsonWriter.writeNumberField("parallelism", this.parallelism); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of JobConfigurationScheduleTriggerConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of JobConfigurationScheduleTriggerConfig 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 JobConfigurationScheduleTriggerConfig. + */ + public static JobConfigurationScheduleTriggerConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + JobConfigurationScheduleTriggerConfig deserializedJobConfigurationScheduleTriggerConfig + = new JobConfigurationScheduleTriggerConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("cronExpression".equals(fieldName)) { + deserializedJobConfigurationScheduleTriggerConfig.cronExpression = reader.getString(); + } else if ("replicaCompletionCount".equals(fieldName)) { + deserializedJobConfigurationScheduleTriggerConfig.replicaCompletionCount + = reader.getNullable(JsonReader::getInt); + } else if ("parallelism".equals(fieldName)) { + deserializedJobConfigurationScheduleTriggerConfig.parallelism + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedJobConfigurationScheduleTriggerConfig; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobExecution.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobExecution.java index cf83584a4386..86f5654629d5 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobExecution.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobExecution.java @@ -60,6 +60,13 @@ public interface JobExecution { */ JobExecutionTemplate template(); + /** + * Gets the detailedStatus property: Detailed status of the job execution. + * + * @return the detailedStatus value. + */ + ExecutionStatus detailedStatus(); + /** * Gets the inner com.azure.resourcemanager.appcontainers.fluent.models.JobExecutionInner object. * diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobExecutionContainer.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobExecutionContainer.java index 254e4f869bc8..483f1ddc4b94 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobExecutionContainer.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobExecutionContainer.java @@ -5,48 +5,46 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.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; /** * Container Apps Jobs execution container definition. */ @Fluent -public final class JobExecutionContainer { +public final class JobExecutionContainer implements JsonSerializable { /* * Container image tag. */ - @JsonProperty(value = "image") private String image; /* * Custom container name. */ - @JsonProperty(value = "name") private String name; /* * Container start command. */ - @JsonProperty(value = "command") private List command; /* * Container start command arguments. */ - @JsonProperty(value = "args") private List args; /* * Container environment variables. */ - @JsonProperty(value = "env") private List env; /* * Container resource requirements. */ - @JsonProperty(value = "resources") private ContainerResources resources; /** @@ -188,4 +186,58 @@ public void validate() { resources().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("image", this.image); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeArrayField("command", this.command, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("args", this.args, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("env", this.env, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("resources", this.resources); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of JobExecutionContainer from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of JobExecutionContainer if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the JobExecutionContainer. + */ + public static JobExecutionContainer fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + JobExecutionContainer deserializedJobExecutionContainer = new JobExecutionContainer(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("image".equals(fieldName)) { + deserializedJobExecutionContainer.image = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedJobExecutionContainer.name = reader.getString(); + } else if ("command".equals(fieldName)) { + List command = reader.readArray(reader1 -> reader1.getString()); + deserializedJobExecutionContainer.command = command; + } else if ("args".equals(fieldName)) { + List args = reader.readArray(reader1 -> reader1.getString()); + deserializedJobExecutionContainer.args = args; + } else if ("env".equals(fieldName)) { + List env = reader.readArray(reader1 -> EnvironmentVar.fromJson(reader1)); + deserializedJobExecutionContainer.env = env; + } else if ("resources".equals(fieldName)) { + deserializedJobExecutionContainer.resources = ContainerResources.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedJobExecutionContainer; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobExecutionRunningState.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobExecutionRunningState.java index aed929aec861..c8f20477420e 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobExecutionRunningState.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobExecutionRunningState.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -62,7 +61,6 @@ public JobExecutionRunningState() { * @param name a name to look for. * @return the corresponding JobExecutionRunningState. */ - @JsonCreator public static JobExecutionRunningState fromString(String name) { return fromString(name, JobExecutionRunningState.class); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobExecutionTemplate.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobExecutionTemplate.java index c9305f3f20c0..1bb37ef45909 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobExecutionTemplate.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobExecutionTemplate.java @@ -5,24 +5,26 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.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; /** * Job's execution template, containing container configuration for a job's execution. */ @Fluent -public final class JobExecutionTemplate { +public final class JobExecutionTemplate implements JsonSerializable { /* * List of container definitions for the Container Apps Job. */ - @JsonProperty(value = "containers") private List containers; /* * List of specialized containers that run before job containers. */ - @JsonProperty(value = "initContainers") private List initContainers; /** @@ -84,4 +86,48 @@ public void validate() { initContainers().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("containers", this.containers, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("initContainers", this.initContainers, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of JobExecutionTemplate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of JobExecutionTemplate if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the JobExecutionTemplate. + */ + public static JobExecutionTemplate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + JobExecutionTemplate deserializedJobExecutionTemplate = new JobExecutionTemplate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("containers".equals(fieldName)) { + List containers + = reader.readArray(reader1 -> JobExecutionContainer.fromJson(reader1)); + deserializedJobExecutionTemplate.containers = containers; + } else if ("initContainers".equals(fieldName)) { + List initContainers + = reader.readArray(reader1 -> JobExecutionContainer.fromJson(reader1)); + deserializedJobExecutionTemplate.initContainers = initContainers; + } else { + reader.skipChildren(); + } + } + + return deserializedJobExecutionTemplate; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobPatchProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobPatchProperties.java index d09f18fc692a..5ee1158155f0 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobPatchProperties.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobPatchProperties.java @@ -5,39 +5,37 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.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; /** * Container Apps Job resource specific properties. */ @Fluent -public final class JobPatchProperties { +public final class JobPatchProperties implements JsonSerializable { /* * The complex type of the extended location. */ - @JsonProperty(value = "extendedLocation") private ExtendedLocation extendedLocation; /* * Managed identities needed by a container app job to interact with other Azure services to not maintain any * secrets or credentials in code. */ - @JsonProperty(value = "identity") private ManagedServiceIdentity identity; /* * Resource tags. */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /* * The properties property. */ - @JsonProperty(value = "properties") private JobPatchPropertiesProperties properties; /** @@ -67,8 +65,8 @@ public JobPatchProperties withExtendedLocation(ExtendedLocation extendedLocation } /** - * Get the identity property: Managed identities needed by a container app job to interact with other Azure - * services to not maintain any secrets or credentials in code. + * Get the identity property: Managed identities needed by a container app job to interact with other Azure services + * to not maintain any secrets or credentials in code. * * @return the identity value. */ @@ -77,8 +75,8 @@ public ManagedServiceIdentity identity() { } /** - * Set the identity property: Managed identities needed by a container app job to interact with other Azure - * services to not maintain any secrets or credentials in code. + * Set the identity property: Managed identities needed by a container app job to interact with other Azure services + * to not maintain any secrets or credentials in code. * * @param identity the identity value to set. * @return the JobPatchProperties object itself. @@ -144,4 +142,50 @@ public void validate() { properties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("extendedLocation", this.extendedLocation); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of JobPatchProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of JobPatchProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the JobPatchProperties. + */ + public static JobPatchProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + JobPatchProperties deserializedJobPatchProperties = new JobPatchProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("extendedLocation".equals(fieldName)) { + deserializedJobPatchProperties.extendedLocation = ExtendedLocation.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedJobPatchProperties.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedJobPatchProperties.tags = tags; + } else if ("properties".equals(fieldName)) { + deserializedJobPatchProperties.properties = JobPatchPropertiesProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedJobPatchProperties; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobPatchPropertiesProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobPatchPropertiesProperties.java index 38474193d99f..3fb56c96772f 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobPatchPropertiesProperties.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobPatchPropertiesProperties.java @@ -5,42 +5,41 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.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; /** * The JobPatchPropertiesProperties model. */ @Fluent -public final class JobPatchPropertiesProperties { +public final class JobPatchPropertiesProperties implements JsonSerializable { /* * Resource ID of environment. */ - @JsonProperty(value = "environmentId") private String environmentId; /* * Container Apps Job configuration properties. */ - @JsonProperty(value = "configuration") private JobConfiguration configuration; /* * Container Apps job definition. */ - @JsonProperty(value = "template") private JobTemplate template; /* * Outbound IP Addresses of a container apps job. */ - @JsonProperty(value = "outboundIpAddresses") private List outboundIpAddresses; /* * The endpoint of the eventstream of the container apps job. */ - @JsonProperty(value = "eventStreamEndpoint") private String eventStreamEndpoint; /** @@ -162,4 +161,54 @@ public void validate() { template().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("environmentId", this.environmentId); + jsonWriter.writeJsonField("configuration", this.configuration); + jsonWriter.writeJsonField("template", this.template); + jsonWriter.writeArrayField("outboundIpAddresses", this.outboundIpAddresses, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("eventStreamEndpoint", this.eventStreamEndpoint); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of JobPatchPropertiesProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of JobPatchPropertiesProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the JobPatchPropertiesProperties. + */ + public static JobPatchPropertiesProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + JobPatchPropertiesProperties deserializedJobPatchPropertiesProperties = new JobPatchPropertiesProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("environmentId".equals(fieldName)) { + deserializedJobPatchPropertiesProperties.environmentId = reader.getString(); + } else if ("configuration".equals(fieldName)) { + deserializedJobPatchPropertiesProperties.configuration = JobConfiguration.fromJson(reader); + } else if ("template".equals(fieldName)) { + deserializedJobPatchPropertiesProperties.template = JobTemplate.fromJson(reader); + } else if ("outboundIpAddresses".equals(fieldName)) { + List outboundIpAddresses = reader.readArray(reader1 -> reader1.getString()); + deserializedJobPatchPropertiesProperties.outboundIpAddresses = outboundIpAddresses; + } else if ("eventStreamEndpoint".equals(fieldName)) { + deserializedJobPatchPropertiesProperties.eventStreamEndpoint = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedJobPatchPropertiesProperties; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobProvisioningState.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobProvisioningState.java index adbef85d8a2e..c623bfdcef2e 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobProvisioningState.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobProvisioningState.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -52,7 +51,6 @@ public JobProvisioningState() { * @param name a name to look for. * @return the corresponding JobProvisioningState. */ - @JsonCreator public static JobProvisioningState fromString(String name) { return fromString(name, JobProvisioningState.class); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobScale.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobScale.java index a0047df76dd4..b19d9ada4f41 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobScale.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobScale.java @@ -5,36 +5,36 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.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; /** * Scaling configurations for event driven jobs. */ @Fluent -public final class JobScale { +public final class JobScale implements JsonSerializable { /* * Interval to check each event source in seconds. Defaults to 30s */ - @JsonProperty(value = "pollingInterval") private Integer pollingInterval; /* * Minimum number of job executions that are created for a trigger, default 0 */ - @JsonProperty(value = "minExecutions") private Integer minExecutions; /* * Maximum number of job executions that are created for a trigger, default 100. */ - @JsonProperty(value = "maxExecutions") private Integer maxExecutions; /* * Scaling rules. */ - @JsonProperty(value = "rules") private List rules; /** @@ -133,4 +133,50 @@ public void validate() { rules().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("pollingInterval", this.pollingInterval); + jsonWriter.writeNumberField("minExecutions", this.minExecutions); + jsonWriter.writeNumberField("maxExecutions", this.maxExecutions); + jsonWriter.writeArrayField("rules", this.rules, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of JobScale from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of JobScale if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the JobScale. + */ + public static JobScale fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + JobScale deserializedJobScale = new JobScale(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("pollingInterval".equals(fieldName)) { + deserializedJobScale.pollingInterval = reader.getNullable(JsonReader::getInt); + } else if ("minExecutions".equals(fieldName)) { + deserializedJobScale.minExecutions = reader.getNullable(JsonReader::getInt); + } else if ("maxExecutions".equals(fieldName)) { + deserializedJobScale.maxExecutions = reader.getNullable(JsonReader::getInt); + } else if ("rules".equals(fieldName)) { + List rules = reader.readArray(reader1 -> JobScaleRule.fromJson(reader1)); + deserializedJobScale.rules = rules; + } else { + reader.skipChildren(); + } + } + + return deserializedJobScale; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobScaleRule.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobScaleRule.java index a78b1c2b38b7..def329453208 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobScaleRule.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobScaleRule.java @@ -5,39 +5,45 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.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; /** * Scaling rule. */ @Fluent -public final class JobScaleRule { +public final class JobScaleRule implements JsonSerializable { /* * Scale Rule Name */ - @JsonProperty(value = "name") private String name; /* * Type of the scale rule * eg: azure-servicebus, redis etc. */ - @JsonProperty(value = "type") private String type; /* * Metadata properties to describe the scale rule. */ - @JsonProperty(value = "metadata") private Object metadata; /* * Authentication secrets for the scale rule. */ - @JsonProperty(value = "auth") private List auth; + /* + * The resource ID of a user-assigned managed identity that is assigned to the job, or 'system' for system-assigned + * identity. + */ + private String identity; + /** * Creates an instance of JobScaleRule class. */ @@ -126,6 +132,28 @@ public JobScaleRule withAuth(List auth) { return this; } + /** + * Get the identity property: The resource ID of a user-assigned managed identity that is assigned to the job, or + * 'system' for system-assigned identity. + * + * @return the identity value. + */ + public String identity() { + return this.identity; + } + + /** + * Set the identity property: The resource ID of a user-assigned managed identity that is assigned to the job, or + * 'system' for system-assigned identity. + * + * @param identity the identity value to set. + * @return the JobScaleRule object itself. + */ + public JobScaleRule withIdentity(String identity) { + this.identity = identity; + return this; + } + /** * Validates the instance. * @@ -136,4 +164,53 @@ public void validate() { auth().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("type", this.type); + jsonWriter.writeUntypedField("metadata", this.metadata); + jsonWriter.writeArrayField("auth", this.auth, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("identity", this.identity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of JobScaleRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of JobScaleRule if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the JobScaleRule. + */ + public static JobScaleRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + JobScaleRule deserializedJobScaleRule = new JobScaleRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedJobScaleRule.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedJobScaleRule.type = reader.getString(); + } else if ("metadata".equals(fieldName)) { + deserializedJobScaleRule.metadata = reader.readUntyped(); + } else if ("auth".equals(fieldName)) { + List auth = reader.readArray(reader1 -> ScaleRuleAuth.fromJson(reader1)); + deserializedJobScaleRule.auth = auth; + } else if ("identity".equals(fieldName)) { + deserializedJobScaleRule.identity = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedJobScaleRule; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobTemplate.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobTemplate.java index 753c254e3b02..0ad7cf857b38 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobTemplate.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobTemplate.java @@ -5,7 +5,11 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.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; /** @@ -13,23 +17,20 @@ * to this section Will result in a new revision being created. */ @Fluent -public final class JobTemplate { +public final class JobTemplate implements JsonSerializable { /* * List of specialized containers that run before app containers. */ - @JsonProperty(value = "initContainers") private List initContainers; /* * List of container definitions for the Container App. */ - @JsonProperty(value = "containers") private List containers; /* * List of volume definitions for the Container App. */ - @JsonProperty(value = "volumes") private List volumes; /** @@ -114,4 +115,50 @@ public void validate() { volumes().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("initContainers", this.initContainers, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("containers", this.containers, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("volumes", this.volumes, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of JobTemplate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of JobTemplate if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the JobTemplate. + */ + public static JobTemplate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + JobTemplate deserializedJobTemplate = new JobTemplate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("initContainers".equals(fieldName)) { + List initContainers = reader.readArray(reader1 -> InitContainer.fromJson(reader1)); + deserializedJobTemplate.initContainers = initContainers; + } else if ("containers".equals(fieldName)) { + List containers = reader.readArray(reader1 -> Container.fromJson(reader1)); + deserializedJobTemplate.containers = containers; + } else if ("volumes".equals(fieldName)) { + List volumes = reader.readArray(reader1 -> Volume.fromJson(reader1)); + deserializedJobTemplate.volumes = volumes; + } else { + reader.skipChildren(); + } + } + + return deserializedJobTemplate; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Jobs.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Jobs.java index 0cee44f1bba7..6c0a3b9cb862 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Jobs.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Jobs.java @@ -19,15 +19,13 @@ public interface Jobs { * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of diagnostics for a Container App Job along with {@link Response}. + * @return the list of diagnostics for a Container App Job as paginated response with {@link PagedIterable}. */ - Response listDetectorsWithResponse(String resourceGroupName, String jobName, - Context context); + PagedIterable listDetectors(String resourceGroupName, String jobName); /** * Get the list of diagnostics for a given Container App Job. @@ -36,13 +34,14 @@ Response listDetectorsWithResponse(String resourceGroupNa * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of diagnostics for a Container App Job. + * @return the list of diagnostics for a Container App Job as paginated response with {@link PagedIterable}. */ - DiagnosticsCollection listDetectors(String resourceGroupName, String jobName); + PagedIterable listDetectors(String resourceGroupName, String jobName, Context context); /** * Get the diagnostics data for a given Container App Job. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobsCollection.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobsCollection.java index 7d0d995b3a42..f9d07fc01f73 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobsCollection.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobsCollection.java @@ -6,25 +6,27 @@ 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.appcontainers.fluent.models.JobInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * Container Apps Jobs collection ARM resource. */ @Fluent -public final class JobsCollection { +public final class JobsCollection implements JsonSerializable { /* * Collection of resources. */ - @JsonProperty(value = "value", required = true) private List value; /* * Link to next page of resources. */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; /** @@ -69,12 +71,52 @@ public String nextLink() { */ public void validate() { if (value() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property value in model JobsCollection")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model JobsCollection")); } else { value().forEach(e -> e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(JobsCollection.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of JobsCollection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of JobsCollection 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 JobsCollection. + */ + public static JobsCollection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + JobsCollection deserializedJobsCollection = new JobsCollection(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> JobInner.fromJson(reader1)); + deserializedJobsCollection.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedJobsCollection.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedJobsCollection; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JwtClaimChecks.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JwtClaimChecks.java index b4086c851a89..ff6540250084 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JwtClaimChecks.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JwtClaimChecks.java @@ -5,24 +5,26 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.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; /** * The configuration settings of the checks that should be made while validating the JWT Claims. */ @Fluent -public final class JwtClaimChecks { +public final class JwtClaimChecks implements JsonSerializable { /* * The list of the allowed groups. */ - @JsonProperty(value = "allowedGroups") private List allowedGroups; /* * The list of the allowed client applications. */ - @JsonProperty(value = "allowedClientApplications") private List allowedClientApplications; /** @@ -78,4 +80,47 @@ public JwtClaimChecks withAllowedClientApplications(List allowedClientAp */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("allowedGroups", this.allowedGroups, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("allowedClientApplications", this.allowedClientApplications, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of JwtClaimChecks from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of JwtClaimChecks if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the JwtClaimChecks. + */ + public static JwtClaimChecks fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + JwtClaimChecks deserializedJwtClaimChecks = new JwtClaimChecks(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("allowedGroups".equals(fieldName)) { + List allowedGroups = reader.readArray(reader1 -> reader1.getString()); + deserializedJwtClaimChecks.allowedGroups = allowedGroups; + } else if ("allowedClientApplications".equals(fieldName)) { + List allowedClientApplications = reader.readArray(reader1 -> reader1.getString()); + deserializedJwtClaimChecks.allowedClientApplications = allowedClientApplications; + } else { + reader.skipChildren(); + } + } + + return deserializedJwtClaimChecks; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/KedaConfiguration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/KedaConfiguration.java index af0054b064a1..efa2c552c104 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/KedaConfiguration.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/KedaConfiguration.java @@ -5,17 +5,20 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Configuration properties Keda component. */ @Immutable -public final class KedaConfiguration { +public final class KedaConfiguration implements JsonSerializable { /* * The version of Keda */ - @JsonProperty(value = "version", access = JsonProperty.Access.WRITE_ONLY) private String version; /** @@ -40,4 +43,39 @@ public String version() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KedaConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KedaConfiguration if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the KedaConfiguration. + */ + public static KedaConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KedaConfiguration deserializedKedaConfiguration = new KedaConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("version".equals(fieldName)) { + deserializedKedaConfiguration.version = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedKedaConfiguration; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Kind.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Kind.java new file mode 100644 index 000000000000..6bdc6796467c --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Kind.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.appcontainers.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Metadata used to render different experiences for resources of the same type; e.g. WorkflowApp is a kind of + * Microsoft.App/ContainerApps type. If supported, the resource provider must validate and persist this value. + */ +public final class Kind extends ExpandableStringEnum { + /** + * Static value workflowapp for Kind. + */ + public static final Kind WORKFLOWAPP = fromString("workflowapp"); + + /** + * Creates a new instance of Kind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Kind() { + } + + /** + * Creates or finds a Kind from its string representation. + * + * @param name a name to look for. + * @return the corresponding Kind. + */ + public static Kind fromString(String name) { + return fromString(name, Kind.class); + } + + /** + * Gets known Kind values. + * + * @return known Kind values. + */ + public static Collection values() { + return values(Kind.class); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Level.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Level.java new file mode 100644 index 000000000000..cb7577f3909b --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Level.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.appcontainers.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The specified logger's log level. + */ +public final class Level extends ExpandableStringEnum { + /** + * Static value off for Level. + */ + public static final Level OFF = fromString("off"); + + /** + * Static value error for Level. + */ + public static final Level ERROR = fromString("error"); + + /** + * Static value info for Level. + */ + public static final Level INFO = fromString("info"); + + /** + * Static value debug for Level. + */ + public static final Level DEBUG = fromString("debug"); + + /** + * Static value trace for Level. + */ + public static final Level TRACE = fromString("trace"); + + /** + * Static value warn for Level. + */ + public static final Level WARN = fromString("warn"); + + /** + * Creates a new instance of Level value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Level() { + } + + /** + * Creates or finds a Level from its string representation. + * + * @param name a name to look for. + * @return the corresponding Level. + */ + public static Level fromString(String name) { + return fromString(name, Level.class); + } + + /** + * Gets known Level values. + * + * @return known Level values. + */ + public static Collection values() { + return values(Level.class); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ListUsagesResult.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ListUsagesResult.java index d4a6e587bc76..7bad60f10da3 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ListUsagesResult.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ListUsagesResult.java @@ -5,26 +5,28 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.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.appcontainers.fluent.models.UsageInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * The ListUsagesResult model. */ @Fluent -public final class ListUsagesResult { +public final class ListUsagesResult implements JsonSerializable { /* * The list of compute resource usages. */ - @JsonProperty(value = "value") private List value; /* - * The URI to fetch the next page of compute resource usage information. Call ListNext() with this to fetch the - * next page of compute resource usage information. + * The URI to fetch the next page of compute resource usage information. Call ListNext() with this to fetch the next + * page of compute resource usage information. */ - @JsonProperty(value = "nextLink") private String nextLink; /** @@ -85,4 +87,44 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@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 ListUsagesResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListUsagesResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ListUsagesResult. + */ + public static ListUsagesResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListUsagesResult deserializedListUsagesResult = new ListUsagesResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> UsageInner.fromJson(reader1)); + deserializedListUsagesResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedListUsagesResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedListUsagesResult; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LogAnalyticsConfiguration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LogAnalyticsConfiguration.java index aab153d85785..da8a3c852632 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LogAnalyticsConfiguration.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LogAnalyticsConfiguration.java @@ -5,29 +5,30 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Log Analytics configuration, must only be provided when destination is configured as 'log-analytics'. */ @Fluent -public final class LogAnalyticsConfiguration { +public final class LogAnalyticsConfiguration implements JsonSerializable { /* * Log analytics customer id */ - @JsonProperty(value = "customerId") private String customerId; /* * Log analytics customer key */ - @JsonProperty(value = "sharedKey") private String sharedKey; /* * Boolean indicating whether to parse json string log into dynamic json columns */ - @JsonProperty(value = "dynamicJsonColumns") private Boolean dynamicJsonColumns; /** @@ -105,4 +106,47 @@ public LogAnalyticsConfiguration withDynamicJsonColumns(Boolean dynamicJsonColum */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("customerId", this.customerId); + jsonWriter.writeStringField("sharedKey", this.sharedKey); + jsonWriter.writeBooleanField("dynamicJsonColumns", this.dynamicJsonColumns); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LogAnalyticsConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LogAnalyticsConfiguration if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the LogAnalyticsConfiguration. + */ + public static LogAnalyticsConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LogAnalyticsConfiguration deserializedLogAnalyticsConfiguration = new LogAnalyticsConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("customerId".equals(fieldName)) { + deserializedLogAnalyticsConfiguration.customerId = reader.getString(); + } else if ("sharedKey".equals(fieldName)) { + deserializedLogAnalyticsConfiguration.sharedKey = reader.getString(); + } else if ("dynamicJsonColumns".equals(fieldName)) { + deserializedLogAnalyticsConfiguration.dynamicJsonColumns + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedLogAnalyticsConfiguration; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LogLevel.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LogLevel.java index 18536747ff1b..7243f9058fb1 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LogLevel.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LogLevel.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -47,7 +46,6 @@ public LogLevel() { * @param name a name to look for. * @return the corresponding LogLevel. */ - @JsonCreator public static LogLevel fromString(String name) { return fromString(name, LogLevel.class); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LoggerSetting.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LoggerSetting.java new file mode 100644 index 000000000000..71cec07dd77a --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LoggerSetting.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.appcontainers.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 java.io.IOException; + +/** + * Logger settings for java workloads. + */ +@Fluent +public final class LoggerSetting implements JsonSerializable { + /* + * Logger name. + */ + private String logger; + + /* + * The specified logger's log level. + */ + private Level level; + + /** + * Creates an instance of LoggerSetting class. + */ + public LoggerSetting() { + } + + /** + * Get the logger property: Logger name. + * + * @return the logger value. + */ + public String logger() { + return this.logger; + } + + /** + * Set the logger property: Logger name. + * + * @param logger the logger value to set. + * @return the LoggerSetting object itself. + */ + public LoggerSetting withLogger(String logger) { + this.logger = logger; + return this; + } + + /** + * Get the level property: The specified logger's log level. + * + * @return the level value. + */ + public Level level() { + return this.level; + } + + /** + * Set the level property: The specified logger's log level. + * + * @param level the level value to set. + * @return the LoggerSetting object itself. + */ + public LoggerSetting withLevel(Level level) { + this.level = level; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (logger() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property logger in model LoggerSetting")); + } + if (level() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property level in model LoggerSetting")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(LoggerSetting.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("logger", this.logger); + jsonWriter.writeStringField("level", this.level == null ? null : this.level.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LoggerSetting from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LoggerSetting 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 LoggerSetting. + */ + public static LoggerSetting fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LoggerSetting deserializedLoggerSetting = new LoggerSetting(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("logger".equals(fieldName)) { + deserializedLoggerSetting.logger = reader.getString(); + } else if ("level".equals(fieldName)) { + deserializedLoggerSetting.level = Level.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedLoggerSetting; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LogicApp.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LogicApp.java new file mode 100644 index 000000000000..e1e846984fc1 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LogicApp.java @@ -0,0 +1,234 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appcontainers.fluent.models.LogicAppInner; + +/** + * An immutable client-side representation of LogicApp. + */ +public interface LogicApp { + /** + * 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. + */ + Object properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.appcontainers.fluent.models.LogicAppInner object. + * + * @return the inner object. + */ + LogicAppInner innerModel(); + + /** + * The entirety of the LogicApp definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The LogicApp definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the LogicApp definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the LogicApp definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, containerAppName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @return the next definition stage. + */ + WithCreate withExistingContainerApp(String resourceGroupName, String containerAppName); + } + + /** + * The stage of the LogicApp definition which contains all the minimum required properties for the resource to + * be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + LogicApp create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + LogicApp create(Context context); + } + + /** + * The stage of the LogicApp 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(Object properties); + } + } + + /** + * Begins update for the LogicApp resource. + * + * @return the stage of resource update. + */ + LogicApp.Update update(); + + /** + * The template for LogicApp update. + */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + LogicApp apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + LogicApp apply(Context context); + } + + /** + * The LogicApp update stages. + */ + interface UpdateStages { + /** + * The stage of the LogicApp update 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. + */ + Update withProperties(Object properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + LogicApp refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + LogicApp refresh(Context context); + + /** + * Creates or updates the artifacts for the logic app. + * + * @param workflowArtifacts Application settings and files of the workflow. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown 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}. + */ + Response deployWorkflowArtifactsWithResponse(WorkflowArtifacts workflowArtifacts, Context context); + + /** + * Creates or updates the artifacts for the logic app. + * + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deployWorkflowArtifacts(); + + /** + * Gets logic app's connections. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return logic app's connections along with {@link Response}. + */ + Response listWorkflowsConnectionsWithResponse(Context context); + + /** + * Gets logic app's connections. + * + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return logic app's connections. + */ + WorkflowEnvelope listWorkflowsConnections(); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LogicApps.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LogicApps.java new file mode 100644 index 000000000000..b853015478be --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LogicApps.java @@ -0,0 +1,289 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.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 LogicApps. + */ +public interface LogicApps { + /** + * Gets a logic app extension resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a logic app extension resource along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String containerAppName, String logicAppName, + Context context); + + /** + * Gets a logic app extension resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a logic app extension resource. + */ + LogicApp get(String resourceGroupName, String containerAppName, String logicAppName); + + /** + * Deletes a Logic App extension resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown 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}. + */ + Response deleteWithResponse(String resourceGroupName, String containerAppName, String logicAppName, + Context context); + + /** + * Deletes a Logic App extension resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException 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 containerAppName, String logicAppName); + + /** + * List the workflows for a logic app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of workflow information elements as paginated response with {@link PagedIterable}. + */ + PagedIterable listWorkflows(String resourceGroupName, String containerAppName, + String logicAppName); + + /** + * List the workflows for a logic app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of workflow information elements as paginated response with {@link PagedIterable}. + */ + PagedIterable listWorkflows(String resourceGroupName, String containerAppName, + String logicAppName, Context context); + + /** + * Get workflow information by its name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param workflowName Workflow name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workflow information by its name along with {@link Response}. + */ + Response getWorkflowWithResponse(String resourceGroupName, String containerAppName, + String logicAppName, String workflowName, Context context); + + /** + * Get workflow information by its name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param workflowName Workflow name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workflow information by its name. + */ + WorkflowEnvelope getWorkflow(String resourceGroupName, String containerAppName, String logicAppName, + String workflowName); + + /** + * Creates or updates the artifacts for the logic app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param workflowArtifacts Application settings and files of the workflow. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown 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}. + */ + Response deployWorkflowArtifactsWithResponse(String resourceGroupName, String containerAppName, + String logicAppName, WorkflowArtifacts workflowArtifacts, Context context); + + /** + * Creates or updates the artifacts for the logic app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deployWorkflowArtifacts(String resourceGroupName, String containerAppName, String logicAppName); + + /** + * Gets logic app's connections. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return logic app's connections along with {@link Response}. + */ + Response listWorkflowsConnectionsWithResponse(String resourceGroupName, String containerAppName, + String logicAppName, Context context); + + /** + * Gets logic app's connections. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return logic app's connections. + */ + WorkflowEnvelope listWorkflowsConnections(String resourceGroupName, String containerAppName, String logicAppName); + + /** + * Proxies a the API call to the logic app backed by the container app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the LogicApp App, the extension resource. + * @param xMsLogicAppsProxyPath The proxy path for the API call. + * @param xMsLogicAppsProxyMethod The proxy method for the API call. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object along with {@link Response}. + */ + Response invokeWithResponse(String resourceGroupName, String containerAppName, String logicAppName, + String xMsLogicAppsProxyPath, LogicAppsProxyMethod xMsLogicAppsProxyMethod, Context context); + + /** + * Proxies a the API call to the logic app backed by the container app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the LogicApp App, the extension resource. + * @param xMsLogicAppsProxyPath The proxy path for the API call. + * @param xMsLogicAppsProxyMethod The proxy method for the API call. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + Object invoke(String resourceGroupName, String containerAppName, String logicAppName, String xMsLogicAppsProxyPath, + LogicAppsProxyMethod xMsLogicAppsProxyMethod); + + /** + * Gets a logic app extension resource. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a logic app extension resource along with {@link Response}. + */ + LogicApp getById(String id); + + /** + * Gets a logic app extension resource. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a logic app extension resource along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a Logic App extension resource. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException 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); + + /** + * Deletes a Logic App extension resource. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown 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}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new LogicApp resource. + * + * @param name resource name. + * @return the first stage of the new LogicApp definition. + */ + LogicApp.DefinitionStages.Blank define(String name); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LogicAppsProxyMethod.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LogicAppsProxyMethod.java new file mode 100644 index 000000000000..f4702aad851d --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LogicAppsProxyMethod.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.appcontainers.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for LogicAppsProxyMethod. + */ +public final class LogicAppsProxyMethod extends ExpandableStringEnum { + /** + * Static value GET for LogicAppsProxyMethod. + */ + public static final LogicAppsProxyMethod GET = fromString("GET"); + + /** + * Static value POST for LogicAppsProxyMethod. + */ + public static final LogicAppsProxyMethod POST = fromString("POST"); + + /** + * Creates a new instance of LogicAppsProxyMethod value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LogicAppsProxyMethod() { + } + + /** + * Creates or finds a LogicAppsProxyMethod from its string representation. + * + * @param name a name to look for. + * @return the corresponding LogicAppsProxyMethod. + */ + public static LogicAppsProxyMethod fromString(String name) { + return fromString(name, LogicAppsProxyMethod.class); + } + + /** + * Gets known LogicAppsProxyMethod values. + * + * @return known LogicAppsProxyMethod values. + */ + public static Collection values() { + return values(LogicAppsProxyMethod.class); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Login.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Login.java index d26582e52661..5ba8609f9238 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Login.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Login.java @@ -5,31 +5,32 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.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; /** * The configuration settings of the login flow of users using ContainerApp Service Authentication/Authorization. */ @Fluent -public final class Login { +public final class Login implements JsonSerializable { /* * The routes that specify the endpoints used for login and logout requests. */ - @JsonProperty(value = "routes") private LoginRoutes routes; /* * The configuration settings of the token store. */ - @JsonProperty(value = "tokenStore") private TokenStore tokenStore; /* * true if the fragments from the request are preserved after the login request is made; otherwise, * false. */ - @JsonProperty(value = "preserveUrlFragmentsForLogins") private Boolean preserveUrlFragmentsForLogins; /* @@ -38,19 +39,16 @@ public final class Login { * This is an advanced setting typically only needed by Windows Store application backends. * Note that URLs within the current domain are always implicitly allowed. */ - @JsonProperty(value = "allowedExternalRedirectUrls") private List allowedExternalRedirectUrls; /* * The configuration settings of the session cookie's expiration. */ - @JsonProperty(value = "cookieExpiration") private CookieExpiration cookieExpiration; /* * The configuration settings of the nonce used in the login flow. */ - @JsonProperty(value = "nonce") private Nonce nonce; /** @@ -206,4 +204,57 @@ public void validate() { nonce().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("routes", this.routes); + jsonWriter.writeJsonField("tokenStore", this.tokenStore); + jsonWriter.writeBooleanField("preserveUrlFragmentsForLogins", this.preserveUrlFragmentsForLogins); + jsonWriter.writeArrayField("allowedExternalRedirectUrls", this.allowedExternalRedirectUrls, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("cookieExpiration", this.cookieExpiration); + jsonWriter.writeJsonField("nonce", this.nonce); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Login from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Login if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Login. + */ + public static Login fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Login deserializedLogin = new Login(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("routes".equals(fieldName)) { + deserializedLogin.routes = LoginRoutes.fromJson(reader); + } else if ("tokenStore".equals(fieldName)) { + deserializedLogin.tokenStore = TokenStore.fromJson(reader); + } else if ("preserveUrlFragmentsForLogins".equals(fieldName)) { + deserializedLogin.preserveUrlFragmentsForLogins = reader.getNullable(JsonReader::getBoolean); + } else if ("allowedExternalRedirectUrls".equals(fieldName)) { + List allowedExternalRedirectUrls = reader.readArray(reader1 -> reader1.getString()); + deserializedLogin.allowedExternalRedirectUrls = allowedExternalRedirectUrls; + } else if ("cookieExpiration".equals(fieldName)) { + deserializedLogin.cookieExpiration = CookieExpiration.fromJson(reader); + } else if ("nonce".equals(fieldName)) { + deserializedLogin.nonce = Nonce.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedLogin; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LoginRoutes.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LoginRoutes.java index 367f861eef9d..0cf8abaaa2af 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LoginRoutes.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LoginRoutes.java @@ -5,17 +5,20 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The routes that specify the endpoints used for login and logout requests. */ @Fluent -public final class LoginRoutes { +public final class LoginRoutes implements JsonSerializable { /* * The endpoint at which a logout request should be made. */ - @JsonProperty(value = "logoutEndpoint") private String logoutEndpoint; /** @@ -51,4 +54,40 @@ public LoginRoutes withLogoutEndpoint(String logoutEndpoint) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("logoutEndpoint", this.logoutEndpoint); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LoginRoutes from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LoginRoutes if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the LoginRoutes. + */ + public static LoginRoutes fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LoginRoutes deserializedLoginRoutes = new LoginRoutes(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("logoutEndpoint".equals(fieldName)) { + deserializedLoginRoutes.logoutEndpoint = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLoginRoutes; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LoginScopes.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LoginScopes.java index 13755be204d0..f35b2f4abad4 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LoginScopes.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LoginScopes.java @@ -5,18 +5,21 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.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; /** * The configuration settings of the login flow, including the scopes that should be requested. */ @Fluent -public final class LoginScopes { +public final class LoginScopes implements JsonSerializable { /* * A list of the scopes that should be requested while authenticating. */ - @JsonProperty(value = "scopes") private List scopes; /** @@ -52,4 +55,41 @@ public LoginScopes withScopes(List scopes) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("scopes", this.scopes, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LoginScopes from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LoginScopes if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the LoginScopes. + */ + public static LoginScopes fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LoginScopes deserializedLoginScopes = new LoginScopes(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("scopes".equals(fieldName)) { + List scopes = reader.readArray(reader1 -> reader1.getString()); + deserializedLoginScopes.scopes = scopes; + } else { + reader.skipChildren(); + } + } + + return deserializedLoginScopes; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LogsConfiguration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LogsConfiguration.java index 0f25acc6ec6b..eb495caff890 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LogsConfiguration.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LogsConfiguration.java @@ -5,18 +5,21 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.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; /** * Configuration of Open Telemetry logs. */ @Fluent -public final class LogsConfiguration { +public final class LogsConfiguration implements JsonSerializable { /* * Open telemetry logs destinations */ - @JsonProperty(value = "destinations") private List destinations; /** @@ -52,4 +55,41 @@ public LogsConfiguration withDestinations(List destinations) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("destinations", this.destinations, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LogsConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LogsConfiguration if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the LogsConfiguration. + */ + public static LogsConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LogsConfiguration deserializedLogsConfiguration = new LogsConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("destinations".equals(fieldName)) { + List destinations = reader.readArray(reader1 -> reader1.getString()); + deserializedLogsConfiguration.destinations = destinations; + } else { + reader.skipChildren(); + } + } + + return deserializedLogsConfiguration; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedCertificateCollection.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedCertificateCollection.java index c086402c9706..840749f6ffbb 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedCertificateCollection.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedCertificateCollection.java @@ -6,25 +6,27 @@ 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.appcontainers.fluent.models.ManagedCertificateInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * Collection of Managed Certificates. */ @Fluent -public final class ManagedCertificateCollection { +public final class ManagedCertificateCollection implements JsonSerializable { /* * Collection of resources. */ - @JsonProperty(value = "value", required = true) private List value; /* * Link to next page of resources. */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; /** @@ -69,12 +71,54 @@ public String nextLink() { */ public void validate() { if (value() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property value in model ManagedCertificateCollection")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model ManagedCertificateCollection")); } else { value().forEach(e -> e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(ManagedCertificateCollection.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedCertificateCollection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedCertificateCollection 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 ManagedCertificateCollection. + */ + public static ManagedCertificateCollection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedCertificateCollection deserializedManagedCertificateCollection = new ManagedCertificateCollection(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ManagedCertificateInner.fromJson(reader1)); + deserializedManagedCertificateCollection.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedManagedCertificateCollection.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedCertificateCollection; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedCertificateDomainControlValidation.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedCertificateDomainControlValidation.java index 5b63fa644a27..bcab6ba0fdbb 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedCertificateDomainControlValidation.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedCertificateDomainControlValidation.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -43,7 +42,6 @@ public ManagedCertificateDomainControlValidation() { * @param name a name to look for. * @return the corresponding ManagedCertificateDomainControlValidation. */ - @JsonCreator public static ManagedCertificateDomainControlValidation fromString(String name) { return fromString(name, ManagedCertificateDomainControlValidation.class); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedCertificatePatch.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedCertificatePatch.java index ccd81e933906..a42c2bde29e2 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedCertificatePatch.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedCertificatePatch.java @@ -5,20 +5,21 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.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; /** * A managed certificate to update. */ @Fluent -public final class ManagedCertificatePatch { +public final class ManagedCertificatePatch implements JsonSerializable { /* * Application-specific metadata in the form of key-value pairs. */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /** @@ -54,4 +55,41 @@ public ManagedCertificatePatch withTags(Map tags) { */ 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 ManagedCertificatePatch from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedCertificatePatch if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedCertificatePatch. + */ + public static ManagedCertificatePatch fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedCertificatePatch deserializedManagedCertificatePatch = new ManagedCertificatePatch(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedManagedCertificatePatch.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedManagedCertificatePatch; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedCertificateProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedCertificateProperties.java index 23f1a397b074..1670c52f5f6b 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedCertificateProperties.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedCertificateProperties.java @@ -5,41 +5,40 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Certificate resource specific properties. */ @Fluent -public final class ManagedCertificateProperties { +public final class ManagedCertificateProperties implements JsonSerializable { /* * Provisioning state of the certificate. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private CertificateProvisioningState provisioningState; /* * Subject name of the certificate. */ - @JsonProperty(value = "subjectName") private String subjectName; /* * Any error occurred during the certificate provision. */ - @JsonProperty(value = "error", access = JsonProperty.Access.WRITE_ONLY) private String error; /* * Selected type of domain control validation for managed certificates. */ - @JsonProperty(value = "domainControlValidation") private ManagedCertificateDomainControlValidation domainControlValidation; /* * A TXT token used for DNS TXT domain control validation when issuing this type of managed certificates. */ - @JsonProperty(value = "validationToken", access = JsonProperty.Access.WRITE_ONLY) private String validationToken; /** @@ -124,4 +123,52 @@ public String validationToken() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("subjectName", this.subjectName); + jsonWriter.writeStringField("domainControlValidation", + this.domainControlValidation == null ? null : this.domainControlValidation.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedCertificateProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedCertificateProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedCertificateProperties. + */ + public static ManagedCertificateProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedCertificateProperties deserializedManagedCertificateProperties = new ManagedCertificateProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedManagedCertificateProperties.provisioningState + = CertificateProvisioningState.fromString(reader.getString()); + } else if ("subjectName".equals(fieldName)) { + deserializedManagedCertificateProperties.subjectName = reader.getString(); + } else if ("error".equals(fieldName)) { + deserializedManagedCertificateProperties.error = reader.getString(); + } else if ("domainControlValidation".equals(fieldName)) { + deserializedManagedCertificateProperties.domainControlValidation + = ManagedCertificateDomainControlValidation.fromString(reader.getString()); + } else if ("validationToken".equals(fieldName)) { + deserializedManagedCertificateProperties.validationToken = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedCertificateProperties; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironment.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironment.java index 1999293a6283..116461604263 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironment.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironment.java @@ -205,6 +205,28 @@ public interface ManagedEnvironment { */ ManagedEnvironmentPropertiesPeerAuthentication peerAuthentication(); + /** + * Gets the peerTrafficConfiguration property: Peer traffic settings for the Managed Environment. + * + * @return the peerTrafficConfiguration value. + */ + ManagedEnvironmentPropertiesPeerTrafficConfiguration peerTrafficConfiguration(); + + /** + * Gets the privateEndpointConnections property: Private endpoint connections to the resource. + * + * @return the privateEndpointConnections value. + */ + List privateEndpointConnections(); + + /** + * Gets the publicNetworkAccess property: Property to allow or block all public traffic. Allowed Values: 'Enabled', + * 'Disabled'. + * + * @return the publicNetworkAccess value. + */ + PublicNetworkAccess publicNetworkAccess(); + /** * Gets the region of the resource. * @@ -295,7 +317,8 @@ interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithKin DefinitionStages.WithOpenTelemetryConfiguration, DefinitionStages.WithZoneRedundant, DefinitionStages.WithCustomDomainConfiguration, DefinitionStages.WithWorkloadProfiles, DefinitionStages.WithKedaConfiguration, DefinitionStages.WithDaprConfiguration, - DefinitionStages.WithInfrastructureResourceGroup, DefinitionStages.WithPeerAuthentication { + DefinitionStages.WithInfrastructureResourceGroup, DefinitionStages.WithPeerAuthentication, + DefinitionStages.WithPeerTrafficConfiguration, DefinitionStages.WithPublicNetworkAccess { /** * Executes the create request. * @@ -533,6 +556,35 @@ interface WithPeerAuthentication { */ WithCreate withPeerAuthentication(ManagedEnvironmentPropertiesPeerAuthentication peerAuthentication); } + + /** + * The stage of the ManagedEnvironment definition allowing to specify peerTrafficConfiguration. + */ + interface WithPeerTrafficConfiguration { + /** + * Specifies the peerTrafficConfiguration property: Peer traffic settings for the Managed Environment. + * + * @param peerTrafficConfiguration Peer traffic settings for the Managed Environment. + * @return the next definition stage. + */ + WithCreate withPeerTrafficConfiguration( + ManagedEnvironmentPropertiesPeerTrafficConfiguration peerTrafficConfiguration); + } + + /** + * The stage of the ManagedEnvironment definition allowing to specify publicNetworkAccess. + */ + interface WithPublicNetworkAccess { + /** + * Specifies the publicNetworkAccess property: Property to allow or block all public traffic. Allowed + * Values: 'Enabled', 'Disabled'.. + * + * @param publicNetworkAccess Property to allow or block all public traffic. Allowed Values: 'Enabled', + * 'Disabled'. + * @return the next definition stage. + */ + WithCreate withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess); + } } /** @@ -550,7 +602,8 @@ interface Update extends UpdateStages.WithTags, UpdateStages.WithKind, UpdateSta UpdateStages.WithVnetConfiguration, UpdateStages.WithAppLogsConfiguration, UpdateStages.WithAppInsightsConfiguration, UpdateStages.WithOpenTelemetryConfiguration, UpdateStages.WithCustomDomainConfiguration, UpdateStages.WithWorkloadProfiles, - UpdateStages.WithKedaConfiguration, UpdateStages.WithDaprConfiguration, UpdateStages.WithPeerAuthentication { + UpdateStages.WithKedaConfiguration, UpdateStages.WithDaprConfiguration, UpdateStages.WithPeerAuthentication, + UpdateStages.WithPeerTrafficConfiguration, UpdateStages.WithPublicNetworkAccess { /** * Executes the update request. * @@ -762,6 +815,35 @@ interface WithPeerAuthentication { */ Update withPeerAuthentication(ManagedEnvironmentPropertiesPeerAuthentication peerAuthentication); } + + /** + * The stage of the ManagedEnvironment update allowing to specify peerTrafficConfiguration. + */ + interface WithPeerTrafficConfiguration { + /** + * Specifies the peerTrafficConfiguration property: Peer traffic settings for the Managed Environment. + * + * @param peerTrafficConfiguration Peer traffic settings for the Managed Environment. + * @return the next definition stage. + */ + Update withPeerTrafficConfiguration( + ManagedEnvironmentPropertiesPeerTrafficConfiguration peerTrafficConfiguration); + } + + /** + * The stage of the ManagedEnvironment update allowing to specify publicNetworkAccess. + */ + interface WithPublicNetworkAccess { + /** + * Specifies the publicNetworkAccess property: Property to allow or block all public traffic. Allowed + * Values: 'Enabled', 'Disabled'.. + * + * @param publicNetworkAccess Property to allow or block all public traffic. Allowed Values: 'Enabled', + * 'Disabled'. + * @return the next definition stage. + */ + Update withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess); + } } /** diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentPrivateEndpointConnections.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentPrivateEndpointConnections.java new file mode 100644 index 000000000000..7bb6dfb9d798 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentPrivateEndpointConnections.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.appcontainers.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 ManagedEnvironmentPrivateEndpointConnections. + */ +public interface ManagedEnvironmentPrivateEndpointConnections { + /** + * List private endpoint connections for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connection associated with the specified resource as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String environmentName); + + /** + * List private endpoint connections for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connection associated with the specified resource as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String environmentName, Context context); + + /** + * Get a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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 private endpoint connection for a given managed environment along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String environmentName, + String privateEndpointConnectionName, Context context); + + /** + * Get a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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 private endpoint connection for a given managed environment. + */ + PrivateEndpointConnection get(String resourceGroupName, String environmentName, + String privateEndpointConnectionName); + + /** + * Delete a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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 resourceGroupName, String environmentName, String privateEndpointConnectionName); + + /** + * Delete a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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 resourceGroupName, String environmentName, String privateEndpointConnectionName, + Context context); + + /** + * Get a private endpoint connection for a given managed environment. + * + * @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 private endpoint connection for a given managed environment along with {@link Response}. + */ + PrivateEndpointConnection getById(String id); + + /** + * Get a private endpoint connection for a given managed environment. + * + * @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 private endpoint connection for a given managed environment along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a private endpoint connection for a given managed environment. + * + * @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 private endpoint connection for a given managed environment. + * + * @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 PrivateEndpointConnection resource. + * + * @param name resource name. + * @return the first stage of the new PrivateEndpointConnection definition. + */ + PrivateEndpointConnection.DefinitionStages.Blank define(String name); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentPrivateLinkResources.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentPrivateLinkResources.java new file mode 100644 index 000000000000..480e3073148a --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentPrivateLinkResources.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** + * Resource collection API of ManagedEnvironmentPrivateLinkResources. + */ +public interface ManagedEnvironmentPrivateLinkResources { + /** + * List private link resources for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 private link resources as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String environmentName); + + /** + * List private link resources for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 private link resources as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String environmentName, Context context); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentPropertiesPeerAuthentication.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentPropertiesPeerAuthentication.java index 53f2f9a2a4ca..d9539e3202d6 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentPropertiesPeerAuthentication.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentPropertiesPeerAuthentication.java @@ -5,17 +5,21 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Peer authentication settings for the Managed Environment. */ @Fluent -public final class ManagedEnvironmentPropertiesPeerAuthentication { +public final class ManagedEnvironmentPropertiesPeerAuthentication + implements JsonSerializable { /* * Mutual TLS authentication settings for the Managed Environment */ - @JsonProperty(value = "mtls") private Mtls mtls; /** @@ -54,4 +58,41 @@ public void validate() { mtls().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("mtls", this.mtls); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedEnvironmentPropertiesPeerAuthentication from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedEnvironmentPropertiesPeerAuthentication if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedEnvironmentPropertiesPeerAuthentication. + */ + public static ManagedEnvironmentPropertiesPeerAuthentication fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedEnvironmentPropertiesPeerAuthentication deserializedManagedEnvironmentPropertiesPeerAuthentication + = new ManagedEnvironmentPropertiesPeerAuthentication(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("mtls".equals(fieldName)) { + deserializedManagedEnvironmentPropertiesPeerAuthentication.mtls = Mtls.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedEnvironmentPropertiesPeerAuthentication; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentPropertiesPeerTrafficConfiguration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentPropertiesPeerTrafficConfiguration.java new file mode 100644 index 000000000000..92e4a2e6fa14 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentPropertiesPeerTrafficConfiguration.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.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Peer traffic settings for the Managed Environment. + */ +@Fluent +public final class ManagedEnvironmentPropertiesPeerTrafficConfiguration + implements JsonSerializable { + /* + * Peer traffic encryption settings for the Managed Environment + */ + private ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption encryption; + + /** + * Creates an instance of ManagedEnvironmentPropertiesPeerTrafficConfiguration class. + */ + public ManagedEnvironmentPropertiesPeerTrafficConfiguration() { + } + + /** + * Get the encryption property: Peer traffic encryption settings for the Managed Environment. + * + * @return the encryption value. + */ + public ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption encryption() { + return this.encryption; + } + + /** + * Set the encryption property: Peer traffic encryption settings for the Managed Environment. + * + * @param encryption the encryption value to set. + * @return the ManagedEnvironmentPropertiesPeerTrafficConfiguration object itself. + */ + public ManagedEnvironmentPropertiesPeerTrafficConfiguration + withEncryption(ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption encryption) { + this.encryption = encryption; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (encryption() != null) { + encryption().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("encryption", this.encryption); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedEnvironmentPropertiesPeerTrafficConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedEnvironmentPropertiesPeerTrafficConfiguration if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedEnvironmentPropertiesPeerTrafficConfiguration. + */ + public static ManagedEnvironmentPropertiesPeerTrafficConfiguration fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + ManagedEnvironmentPropertiesPeerTrafficConfiguration deserializedManagedEnvironmentPropertiesPeerTrafficConfiguration + = new ManagedEnvironmentPropertiesPeerTrafficConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("encryption".equals(fieldName)) { + deserializedManagedEnvironmentPropertiesPeerTrafficConfiguration.encryption + = ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedEnvironmentPropertiesPeerTrafficConfiguration; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption.java new file mode 100644 index 000000000000..4fc1776940a2 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption.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.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Peer traffic encryption settings for the Managed Environment. + */ +@Fluent +public final class ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption + implements JsonSerializable { + /* + * Boolean indicating whether the peer traffic encryption is enabled + */ + private Boolean enabled; + + /** + * Creates an instance of ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption class. + */ + public ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption() { + } + + /** + * Get the enabled property: Boolean indicating whether the peer traffic encryption is enabled. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Boolean indicating whether the peer traffic encryption is enabled. + * + * @param enabled the enabled value to set. + * @return the ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption object itself. + */ + public ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption 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 ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption if the JsonReader was + * pointing to an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the + * ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption. + */ + public static ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption deserializedManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption + = new ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption.enabled + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentStorageProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentStorageProperties.java index ca7eaef51f42..84c56b6a4eee 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentStorageProperties.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentStorageProperties.java @@ -5,23 +5,26 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Storage properties. */ @Fluent -public final class ManagedEnvironmentStorageProperties { +public final class ManagedEnvironmentStorageProperties + implements JsonSerializable { /* * Azure file properties */ - @JsonProperty(value = "azureFile") private AzureFileProperties azureFile; /* * NFS Azure file properties */ - @JsonProperty(value = "nfsAzureFile") private NfsAzureFileProperties nfsAzureFile; /** @@ -83,4 +86,45 @@ public void validate() { nfsAzureFile().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("azureFile", this.azureFile); + jsonWriter.writeJsonField("nfsAzureFile", this.nfsAzureFile); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedEnvironmentStorageProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedEnvironmentStorageProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedEnvironmentStorageProperties. + */ + public static ManagedEnvironmentStorageProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedEnvironmentStorageProperties deserializedManagedEnvironmentStorageProperties + = new ManagedEnvironmentStorageProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("azureFile".equals(fieldName)) { + deserializedManagedEnvironmentStorageProperties.azureFile = AzureFileProperties.fromJson(reader); + } else if ("nfsAzureFile".equals(fieldName)) { + deserializedManagedEnvironmentStorageProperties.nfsAzureFile + = NfsAzureFileProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedEnvironmentStorageProperties; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentsCollection.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentsCollection.java index 3ef87ab8253b..dbc70a1f66ba 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentsCollection.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentsCollection.java @@ -6,25 +6,27 @@ 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.appcontainers.fluent.models.ManagedEnvironmentInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * Collection of Environments. */ @Fluent -public final class ManagedEnvironmentsCollection { +public final class ManagedEnvironmentsCollection implements JsonSerializable { /* * Collection of resources. */ - @JsonProperty(value = "value", required = true) private List value; /* * Link to next page of resources. */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; /** @@ -69,12 +71,55 @@ public String nextLink() { */ public void validate() { if (value() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property value in model ManagedEnvironmentsCollection")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model ManagedEnvironmentsCollection")); } else { value().forEach(e -> e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(ManagedEnvironmentsCollection.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedEnvironmentsCollection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedEnvironmentsCollection 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 ManagedEnvironmentsCollection. + */ + public static ManagedEnvironmentsCollection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedEnvironmentsCollection deserializedManagedEnvironmentsCollection + = new ManagedEnvironmentsCollection(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ManagedEnvironmentInner.fromJson(reader1)); + deserializedManagedEnvironmentsCollection.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedManagedEnvironmentsCollection.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedEnvironmentsCollection; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedServiceIdentity.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedServiceIdentity.java index d4f2c257c015..dd281ce1c675 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedServiceIdentity.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedServiceIdentity.java @@ -6,8 +6,11 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.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; import java.util.UUID; @@ -15,36 +18,30 @@ * Managed service identity (system assigned and/or user assigned identities). */ @Fluent -public final class ManagedServiceIdentity { +public final class ManagedServiceIdentity implements JsonSerializable { /* * The service principal ID of the system assigned identity. This property will only be provided for a system * assigned identity. */ - @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) private UUID principalId; /* * The tenant ID of the system assigned identity. This property will only be provided for a system assigned * identity. */ - @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) private UUID tenantId; /* * Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). */ - @JsonProperty(value = "type", required = true) private ManagedServiceIdentityType type; /* - * The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys - * will be ARM resource ids in the form: + * The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will + * be ARM resource ids in the form: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/ - * userAssignedIdentities/{identityName}. - * The dictionary values can be empty objects ({}) in requests. + * userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests. */ - @JsonProperty(value = "userAssignedIdentities") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map userAssignedIdentities; /** @@ -64,8 +61,8 @@ public UUID principalId() { } /** - * Get the tenantId property: The tenant ID of the system assigned identity. This property will only be provided - * for a system assigned identity. + * Get the tenantId property: The tenant ID of the system assigned identity. This property will only be provided for + * a system assigned identity. * * @return the tenantId value. */ @@ -128,8 +125,8 @@ public ManagedServiceIdentity withUserAssignedIdentities(Map { @@ -141,4 +138,53 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(ManagedServiceIdentity.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeMapField("userAssignedIdentities", this.userAssignedIdentities, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedServiceIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedServiceIdentity 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 ManagedServiceIdentity. + */ + public static ManagedServiceIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedServiceIdentity deserializedManagedServiceIdentity = new ManagedServiceIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedManagedServiceIdentity.type = ManagedServiceIdentityType.fromString(reader.getString()); + } else if ("principalId".equals(fieldName)) { + deserializedManagedServiceIdentity.principalId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("tenantId".equals(fieldName)) { + deserializedManagedServiceIdentity.tenantId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("userAssignedIdentities".equals(fieldName)) { + Map userAssignedIdentities + = reader.readMap(reader1 -> UserAssignedIdentity.fromJson(reader1)); + deserializedManagedServiceIdentity.userAssignedIdentities = userAssignedIdentities; + } else { + reader.skipChildren(); + } + } + + return deserializedManagedServiceIdentity; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedServiceIdentityType.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedServiceIdentityType.java index 5b9996316a96..a1e459c32245 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedServiceIdentityType.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedServiceIdentityType.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -48,7 +47,6 @@ public ManagedServiceIdentityType() { * @param name a name to look for. * @return the corresponding ManagedServiceIdentityType. */ - @JsonCreator public static ManagedServiceIdentityType fromString(String name) { return fromString(name, ManagedServiceIdentityType.class); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/MetricsConfiguration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/MetricsConfiguration.java index 8087166e8689..bcfdb57540db 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/MetricsConfiguration.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/MetricsConfiguration.java @@ -5,18 +5,21 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.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; /** * Configuration of Open Telemetry metrics. */ @Fluent -public final class MetricsConfiguration { +public final class MetricsConfiguration implements JsonSerializable { /* * Open telemetry metrics destinations */ - @JsonProperty(value = "destinations") private List destinations; /** @@ -52,4 +55,41 @@ public MetricsConfiguration withDestinations(List destinations) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("destinations", this.destinations, (writer, element) -> writer.writeString(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 ("destinations".equals(fieldName)) { + List destinations = reader.readArray(reader1 -> reader1.getString()); + deserializedMetricsConfiguration.destinations = destinations; + } else { + reader.skipChildren(); + } + } + + return deserializedMetricsConfiguration; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Mtls.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Mtls.java index cc7e238c927c..b0abfb2e584d 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Mtls.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Mtls.java @@ -5,17 +5,20 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Configuration properties for mutual TLS authentication. */ @Fluent -public final class Mtls { +public final class Mtls implements JsonSerializable { /* * Boolean indicating whether the mutual TLS authentication is enabled */ - @JsonProperty(value = "enabled") private Boolean enabled; /** @@ -51,4 +54,40 @@ public Mtls withEnabled(Boolean enabled) { */ 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 Mtls from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Mtls if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Mtls. + */ + public static Mtls fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Mtls deserializedMtls = new Mtls(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedMtls.enabled = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedMtls; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/NacosComponent.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/NacosComponent.java new file mode 100644 index 000000000000..8e43bdcc3a7b --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/NacosComponent.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.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Nacos properties. + */ +@Fluent +public final class NacosComponent extends JavaComponentProperties { + /* + * Type of the Java Component. + */ + private JavaComponentType componentType = JavaComponentType.NACOS; + + /* + * Java Component Ingress configurations. + */ + private JavaComponentIngress ingress; + + /* + * Provisioning state of the Java Component. + */ + private JavaComponentProvisioningState provisioningState; + + /** + * Creates an instance of NacosComponent class. + */ + public NacosComponent() { + } + + /** + * Get the componentType property: Type of the Java Component. + * + * @return the componentType value. + */ + @Override + public JavaComponentType componentType() { + return this.componentType; + } + + /** + * Get the ingress property: Java Component Ingress configurations. + * + * @return the ingress value. + */ + public JavaComponentIngress ingress() { + return this.ingress; + } + + /** + * Set the ingress property: Java Component Ingress configurations. + * + * @param ingress the ingress value to set. + * @return the NacosComponent object itself. + */ + public NacosComponent withIngress(JavaComponentIngress ingress) { + this.ingress = ingress; + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the Java Component. + * + * @return the provisioningState value. + */ + @Override + public JavaComponentProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * {@inheritDoc} + */ + @Override + public NacosComponent withConfigurations(List configurations) { + super.withConfigurations(configurations); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public NacosComponent withServiceBinds(List serviceBinds) { + super.withServiceBinds(serviceBinds); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (ingress() != null) { + ingress().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("configurations", configurations(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("serviceBinds", serviceBinds(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("componentType", this.componentType == null ? null : this.componentType.toString()); + jsonWriter.writeJsonField("ingress", this.ingress); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NacosComponent from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NacosComponent if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the NacosComponent. + */ + public static NacosComponent fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NacosComponent deserializedNacosComponent = new NacosComponent(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedNacosComponent.provisioningState + = JavaComponentProvisioningState.fromString(reader.getString()); + } else if ("configurations".equals(fieldName)) { + List configurations + = reader.readArray(reader1 -> JavaComponentConfigurationProperty.fromJson(reader1)); + deserializedNacosComponent.withConfigurations(configurations); + } else if ("serviceBinds".equals(fieldName)) { + List serviceBinds + = reader.readArray(reader1 -> JavaComponentServiceBind.fromJson(reader1)); + deserializedNacosComponent.withServiceBinds(serviceBinds); + } else if ("componentType".equals(fieldName)) { + deserializedNacosComponent.componentType = JavaComponentType.fromString(reader.getString()); + } else if ("ingress".equals(fieldName)) { + deserializedNacosComponent.ingress = JavaComponentIngress.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedNacosComponent; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/NfsAzureFileProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/NfsAzureFileProperties.java index 269e2d0149a4..7b05dea106e2 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/NfsAzureFileProperties.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/NfsAzureFileProperties.java @@ -5,29 +5,30 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * NFS Azure File Properties. */ @Fluent -public final class NfsAzureFileProperties { +public final class NfsAzureFileProperties implements JsonSerializable { /* * Server for NFS azure file. */ - @JsonProperty(value = "server") private String server; /* * Access mode for storage */ - @JsonProperty(value = "accessMode") private AccessMode accessMode; /* * NFS Azure file share name. */ - @JsonProperty(value = "shareName") private String shareName; /** @@ -103,4 +104,46 @@ public NfsAzureFileProperties withShareName(String shareName) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("server", this.server); + jsonWriter.writeStringField("accessMode", this.accessMode == null ? null : this.accessMode.toString()); + jsonWriter.writeStringField("shareName", this.shareName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NfsAzureFileProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NfsAzureFileProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the NfsAzureFileProperties. + */ + public static NfsAzureFileProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NfsAzureFileProperties deserializedNfsAzureFileProperties = new NfsAzureFileProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("server".equals(fieldName)) { + deserializedNfsAzureFileProperties.server = reader.getString(); + } else if ("accessMode".equals(fieldName)) { + deserializedNfsAzureFileProperties.accessMode = AccessMode.fromString(reader.getString()); + } else if ("shareName".equals(fieldName)) { + deserializedNfsAzureFileProperties.shareName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNfsAzureFileProperties; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Nonce.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Nonce.java index 804cdd2e4555..0bca70149015 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Nonce.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Nonce.java @@ -5,24 +5,26 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The configuration settings of the nonce used in the login flow. */ @Fluent -public final class Nonce { +public final class Nonce implements JsonSerializable { /* * false if the nonce should not be validated while completing the login flow; otherwise, * true. */ - @JsonProperty(value = "validateNonce") private Boolean validateNonce; /* * The time after the request is made when the nonce should expire. */ - @JsonProperty(value = "nonceExpirationInterval") private String nonceExpirationInterval; /** @@ -80,4 +82,43 @@ public Nonce withNonceExpirationInterval(String nonceExpirationInterval) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("validateNonce", this.validateNonce); + jsonWriter.writeStringField("nonceExpirationInterval", this.nonceExpirationInterval); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Nonce from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Nonce if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Nonce. + */ + public static Nonce fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Nonce deserializedNonce = new Nonce(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("validateNonce".equals(fieldName)) { + deserializedNonce.validateNonce = reader.getNullable(JsonReader::getBoolean); + } else if ("nonceExpirationInterval".equals(fieldName)) { + deserializedNonce.nonceExpirationInterval = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNonce; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/OpenIdConnectClientCredential.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/OpenIdConnectClientCredential.java index 9bfacd2229f5..8b485cce291a 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/OpenIdConnectClientCredential.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/OpenIdConnectClientCredential.java @@ -5,23 +5,25 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The authentication client credentials of the custom Open ID Connect provider. */ @Fluent -public final class OpenIdConnectClientCredential { +public final class OpenIdConnectClientCredential implements JsonSerializable { /* * The method that should be used to authenticate the user. */ - @JsonProperty(value = "method") private ClientCredentialMethod method; /* * The app setting that contains the client secret for the custom Open ID Connect provider. */ - @JsonProperty(value = "clientSecretSettingName") private String clientSecretSettingName; /** @@ -79,4 +81,45 @@ public OpenIdConnectClientCredential withClientSecretSettingName(String clientSe */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("method", this.method == null ? null : this.method.toString()); + jsonWriter.writeStringField("clientSecretSettingName", this.clientSecretSettingName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OpenIdConnectClientCredential from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OpenIdConnectClientCredential if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the OpenIdConnectClientCredential. + */ + public static OpenIdConnectClientCredential fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OpenIdConnectClientCredential deserializedOpenIdConnectClientCredential + = new OpenIdConnectClientCredential(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("method".equals(fieldName)) { + deserializedOpenIdConnectClientCredential.method + = ClientCredentialMethod.fromString(reader.getString()); + } else if ("clientSecretSettingName".equals(fieldName)) { + deserializedOpenIdConnectClientCredential.clientSecretSettingName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOpenIdConnectClientCredential; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/OpenIdConnectConfig.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/OpenIdConnectConfig.java index c35be9b8c3fe..4475c52237f0 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/OpenIdConnectConfig.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/OpenIdConnectConfig.java @@ -5,41 +5,40 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The configuration settings of the endpoints used for the custom Open ID Connect provider. */ @Fluent -public final class OpenIdConnectConfig { +public final class OpenIdConnectConfig implements JsonSerializable { /* * The endpoint to be used to make an authorization request. */ - @JsonProperty(value = "authorizationEndpoint") private String authorizationEndpoint; /* * The endpoint to be used to request a token. */ - @JsonProperty(value = "tokenEndpoint") private String tokenEndpoint; /* * The endpoint that issues the token. */ - @JsonProperty(value = "issuer") private String issuer; /* * The endpoint that provides the keys necessary to validate the token. */ - @JsonProperty(value = "certificationUri") private String certificationUri; /* * The endpoint that contains all the configuration endpoints for the provider. */ - @JsonProperty(value = "wellKnownOpenIdConfiguration") private String wellKnownOpenIdConfiguration; /** @@ -129,8 +128,8 @@ public OpenIdConnectConfig withCertificationUri(String certificationUri) { } /** - * Get the wellKnownOpenIdConfiguration property: The endpoint that contains all the configuration endpoints for - * the provider. + * Get the wellKnownOpenIdConfiguration property: The endpoint that contains all the configuration endpoints for the + * provider. * * @return the wellKnownOpenIdConfiguration value. */ @@ -139,8 +138,8 @@ public String wellKnownOpenIdConfiguration() { } /** - * Set the wellKnownOpenIdConfiguration property: The endpoint that contains all the configuration endpoints for - * the provider. + * Set the wellKnownOpenIdConfiguration property: The endpoint that contains all the configuration endpoints for the + * provider. * * @param wellKnownOpenIdConfiguration the wellKnownOpenIdConfiguration value to set. * @return the OpenIdConnectConfig object itself. @@ -157,4 +156,52 @@ public OpenIdConnectConfig withWellKnownOpenIdConfiguration(String wellKnownOpen */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("authorizationEndpoint", this.authorizationEndpoint); + jsonWriter.writeStringField("tokenEndpoint", this.tokenEndpoint); + jsonWriter.writeStringField("issuer", this.issuer); + jsonWriter.writeStringField("certificationUri", this.certificationUri); + jsonWriter.writeStringField("wellKnownOpenIdConfiguration", this.wellKnownOpenIdConfiguration); + 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 ("authorizationEndpoint".equals(fieldName)) { + deserializedOpenIdConnectConfig.authorizationEndpoint = reader.getString(); + } else if ("tokenEndpoint".equals(fieldName)) { + deserializedOpenIdConnectConfig.tokenEndpoint = reader.getString(); + } else if ("issuer".equals(fieldName)) { + deserializedOpenIdConnectConfig.issuer = reader.getString(); + } else if ("certificationUri".equals(fieldName)) { + deserializedOpenIdConnectConfig.certificationUri = reader.getString(); + } else if ("wellKnownOpenIdConfiguration".equals(fieldName)) { + deserializedOpenIdConnectConfig.wellKnownOpenIdConfiguration = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOpenIdConnectConfig; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/OpenIdConnectLogin.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/OpenIdConnectLogin.java index 48e465c4d0cc..7573976627a8 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/OpenIdConnectLogin.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/OpenIdConnectLogin.java @@ -5,24 +5,26 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.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; /** * The configuration settings of the login flow of the custom Open ID Connect provider. */ @Fluent -public final class OpenIdConnectLogin { +public final class OpenIdConnectLogin implements JsonSerializable { /* * The name of the claim that contains the users name. */ - @JsonProperty(value = "nameClaimType") private String nameClaimType; /* * A list of the scopes that should be requested while authenticating. */ - @JsonProperty(value = "scopes") private List scopes; /** @@ -78,4 +80,44 @@ public OpenIdConnectLogin withScopes(List scopes) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nameClaimType", this.nameClaimType); + jsonWriter.writeArrayField("scopes", this.scopes, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OpenIdConnectLogin from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OpenIdConnectLogin if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OpenIdConnectLogin. + */ + public static OpenIdConnectLogin fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OpenIdConnectLogin deserializedOpenIdConnectLogin = new OpenIdConnectLogin(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nameClaimType".equals(fieldName)) { + deserializedOpenIdConnectLogin.nameClaimType = reader.getString(); + } else if ("scopes".equals(fieldName)) { + List scopes = reader.readArray(reader1 -> reader1.getString()); + deserializedOpenIdConnectLogin.scopes = scopes; + } else { + reader.skipChildren(); + } + } + + return deserializedOpenIdConnectLogin; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/OpenIdConnectRegistration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/OpenIdConnectRegistration.java index 626b6c1fd21c..9bcbbae2afb3 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/OpenIdConnectRegistration.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/OpenIdConnectRegistration.java @@ -5,29 +5,30 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The configuration settings of the app registration for the custom Open ID Connect provider. */ @Fluent -public final class OpenIdConnectRegistration { +public final class OpenIdConnectRegistration implements JsonSerializable { /* * The client id of the custom Open ID Connect provider. */ - @JsonProperty(value = "clientId") private String clientId; /* * The authentication credentials of the custom Open ID Connect provider. */ - @JsonProperty(value = "clientCredential") private OpenIdConnectClientCredential clientCredential; /* * The configuration settings of the endpoints used for the custom Open ID Connect provider. */ - @JsonProperty(value = "openIdConnectConfiguration") private OpenIdConnectConfig openIdConnectConfiguration; /** @@ -77,8 +78,8 @@ public OpenIdConnectRegistration withClientCredential(OpenIdConnectClientCredent } /** - * Get the openIdConnectConfiguration property: The configuration settings of the endpoints used for the custom - * Open ID Connect provider. + * Get the openIdConnectConfiguration property: The configuration settings of the endpoints used for the custom Open + * ID Connect provider. * * @return the openIdConnectConfiguration value. */ @@ -87,8 +88,8 @@ public OpenIdConnectConfig openIdConnectConfiguration() { } /** - * Set the openIdConnectConfiguration property: The configuration settings of the endpoints used for the custom - * Open ID Connect provider. + * Set the openIdConnectConfiguration property: The configuration settings of the endpoints used for the custom Open + * ID Connect provider. * * @param openIdConnectConfiguration the openIdConnectConfiguration value to set. * @return the OpenIdConnectRegistration object itself. @@ -111,4 +112,48 @@ public void validate() { openIdConnectConfiguration().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("clientId", this.clientId); + jsonWriter.writeJsonField("clientCredential", this.clientCredential); + jsonWriter.writeJsonField("openIdConnectConfiguration", this.openIdConnectConfiguration); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OpenIdConnectRegistration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OpenIdConnectRegistration if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the OpenIdConnectRegistration. + */ + public static OpenIdConnectRegistration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OpenIdConnectRegistration deserializedOpenIdConnectRegistration = new OpenIdConnectRegistration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("clientId".equals(fieldName)) { + deserializedOpenIdConnectRegistration.clientId = reader.getString(); + } else if ("clientCredential".equals(fieldName)) { + deserializedOpenIdConnectRegistration.clientCredential + = OpenIdConnectClientCredential.fromJson(reader); + } else if ("openIdConnectConfiguration".equals(fieldName)) { + deserializedOpenIdConnectRegistration.openIdConnectConfiguration + = OpenIdConnectConfig.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOpenIdConnectRegistration; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/OpenTelemetryConfiguration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/OpenTelemetryConfiguration.java index 54c6df96b74b..96a98ff4db40 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/OpenTelemetryConfiguration.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/OpenTelemetryConfiguration.java @@ -5,35 +5,35 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Configuration of Open Telemetry. */ @Fluent -public final class OpenTelemetryConfiguration { +public final class OpenTelemetryConfiguration implements JsonSerializable { /* * Open telemetry destinations configuration */ - @JsonProperty(value = "destinationsConfiguration") private DestinationsConfiguration destinationsConfiguration; /* * Open telemetry trace configuration */ - @JsonProperty(value = "tracesConfiguration") private TracesConfiguration tracesConfiguration; /* * Open telemetry logs configuration */ - @JsonProperty(value = "logsConfiguration") private LogsConfiguration logsConfiguration; /* * Open telemetry metrics configuration */ - @JsonProperty(value = "metricsConfiguration") private MetricsConfiguration metricsConfiguration; /** @@ -142,4 +142,50 @@ public void validate() { metricsConfiguration().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("destinationsConfiguration", this.destinationsConfiguration); + jsonWriter.writeJsonField("tracesConfiguration", this.tracesConfiguration); + jsonWriter.writeJsonField("logsConfiguration", this.logsConfiguration); + jsonWriter.writeJsonField("metricsConfiguration", this.metricsConfiguration); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OpenTelemetryConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OpenTelemetryConfiguration if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the OpenTelemetryConfiguration. + */ + public static OpenTelemetryConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OpenTelemetryConfiguration deserializedOpenTelemetryConfiguration = new OpenTelemetryConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("destinationsConfiguration".equals(fieldName)) { + deserializedOpenTelemetryConfiguration.destinationsConfiguration + = DestinationsConfiguration.fromJson(reader); + } else if ("tracesConfiguration".equals(fieldName)) { + deserializedOpenTelemetryConfiguration.tracesConfiguration = TracesConfiguration.fromJson(reader); + } else if ("logsConfiguration".equals(fieldName)) { + deserializedOpenTelemetryConfiguration.logsConfiguration = LogsConfiguration.fromJson(reader); + } else if ("metricsConfiguration".equals(fieldName)) { + deserializedOpenTelemetryConfiguration.metricsConfiguration = MetricsConfiguration.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOpenTelemetryConfiguration; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/OperationDisplay.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/OperationDisplay.java index a9e2cc05d789..c24950a8cf09 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/OperationDisplay.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/OperationDisplay.java @@ -5,35 +5,35 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Operation display payload. */ @Fluent -public final class OperationDisplay { +public final class OperationDisplay implements JsonSerializable { /* * Resource provider of the operation */ - @JsonProperty(value = "provider") private String provider; /* * Resource of the operation */ - @JsonProperty(value = "resource") private String resource; /* * Localized friendly name for the operation */ - @JsonProperty(value = "operation") private String operation; /* * Localized friendly description for the operation */ - @JsonProperty(value = "description") private String description; /** @@ -129,4 +129,49 @@ public OperationDisplay withDescription(String description) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("provider", this.provider); + jsonWriter.writeStringField("resource", this.resource); + jsonWriter.writeStringField("operation", this.operation); + jsonWriter.writeStringField("description", this.description); + 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/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/OtlpConfiguration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/OtlpConfiguration.java index 019b028484f2..019c556544f5 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/OtlpConfiguration.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/OtlpConfiguration.java @@ -5,36 +5,36 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.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; /** * Configuration of otlp. */ @Fluent -public final class OtlpConfiguration { +public final class OtlpConfiguration implements JsonSerializable { /* * The name of otlp configuration */ - @JsonProperty(value = "name") private String name; /* * The endpoint of otlp configuration */ - @JsonProperty(value = "endpoint") private String endpoint; /* * Boolean indicating if otlp configuration is insecure */ - @JsonProperty(value = "insecure") private Boolean insecure; /* * Headers of otlp configurations */ - @JsonProperty(value = "headers") private List
headers; /** @@ -133,4 +133,50 @@ public void validate() { headers().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("endpoint", this.endpoint); + jsonWriter.writeBooleanField("insecure", this.insecure); + jsonWriter.writeArrayField("headers", this.headers, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OtlpConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OtlpConfiguration if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OtlpConfiguration. + */ + public static OtlpConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OtlpConfiguration deserializedOtlpConfiguration = new OtlpConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedOtlpConfiguration.name = reader.getString(); + } else if ("endpoint".equals(fieldName)) { + deserializedOtlpConfiguration.endpoint = reader.getString(); + } else if ("insecure".equals(fieldName)) { + deserializedOtlpConfiguration.insecure = reader.getNullable(JsonReader::getBoolean); + } else if ("headers".equals(fieldName)) { + List
headers = reader.readArray(reader1 -> Header.fromJson(reader1)); + deserializedOtlpConfiguration.headers = headers; + } else { + reader.skipChildren(); + } + } + + return deserializedOtlpConfiguration; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PatchApplyStatus.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PatchApplyStatus.java new file mode 100644 index 000000000000..4b830fda01be --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PatchApplyStatus.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.appcontainers.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The status of the patch once it has been provisioned. + */ +public final class PatchApplyStatus extends ExpandableStringEnum { + /** + * Static value NotStarted for PatchApplyStatus. + */ + public static final PatchApplyStatus NOT_STARTED = fromString("NotStarted"); + + /** + * Static value RebaseInProgress for PatchApplyStatus. + */ + public static final PatchApplyStatus REBASE_IN_PROGRESS = fromString("RebaseInProgress"); + + /** + * Static value CreatingRevision for PatchApplyStatus. + */ + public static final PatchApplyStatus CREATING_REVISION = fromString("CreatingRevision"); + + /** + * Static value Succeeded for PatchApplyStatus. + */ + public static final PatchApplyStatus SUCCEEDED = fromString("Succeeded"); + + /** + * Static value Canceled for PatchApplyStatus. + */ + public static final PatchApplyStatus CANCELED = fromString("Canceled"); + + /** + * Static value RebaseFailed for PatchApplyStatus. + */ + public static final PatchApplyStatus REBASE_FAILED = fromString("RebaseFailed"); + + /** + * Static value RevisionCreationFailed for PatchApplyStatus. + */ + public static final PatchApplyStatus REVISION_CREATION_FAILED = fromString("RevisionCreationFailed"); + + /** + * Static value ImagePushPullFailed for PatchApplyStatus. + */ + public static final PatchApplyStatus IMAGE_PUSH_PULL_FAILED = fromString("ImagePushPullFailed"); + + /** + * Static value ManuallySkipped for PatchApplyStatus. + */ + public static final PatchApplyStatus MANUALLY_SKIPPED = fromString("ManuallySkipped"); + + /** + * Creates a new instance of PatchApplyStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PatchApplyStatus() { + } + + /** + * Creates or finds a PatchApplyStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding PatchApplyStatus. + */ + public static PatchApplyStatus fromString(String name) { + return fromString(name, PatchApplyStatus.class); + } + + /** + * Gets known PatchApplyStatus values. + * + * @return known PatchApplyStatus values. + */ + public static Collection values() { + return values(PatchApplyStatus.class); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PatchCollection.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PatchCollection.java new file mode 100644 index 000000000000..ec63e8b856c8 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PatchCollection.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.appcontainers.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.appcontainers.fluent.models.ContainerAppsPatchResourceInner; +import java.io.IOException; +import java.util.List; + +/** + * Container App patch collection. + */ +@Fluent +public final class PatchCollection implements JsonSerializable { + /* + * Collection of patch resources. + */ + private List value; + + /* + * the link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of PatchCollection class. + */ + public PatchCollection() { + } + + /** + * Get the value property: Collection of patch resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of patch resources. + * + * @param value the value value to set. + * @return the PatchCollection object itself. + */ + public PatchCollection 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 PatchCollection object itself. + */ + public PatchCollection 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 PatchCollection")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PatchCollection.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 PatchCollection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PatchCollection 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 PatchCollection. + */ + public static PatchCollection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PatchCollection deserializedPatchCollection = new PatchCollection(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ContainerAppsPatchResourceInner.fromJson(reader1)); + deserializedPatchCollection.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedPatchCollection.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPatchCollection; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PatchDetails.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PatchDetails.java new file mode 100644 index 000000000000..9f7536135574 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PatchDetails.java @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Immutable; +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; + +/** + * The detailed info of patch operation performing when applying a patch. + */ +@Immutable +public final class PatchDetails implements JsonSerializable { + /* + * The name of the target container for the patch. + */ + private String targetContainerName; + + /* + * The name of the target image for the patch. + */ + private String targetImage; + + /* + * The UTC timestamp that describes the latest detection was done. + */ + private OffsetDateTime lastDetectionTime; + + /* + * The status of the patch detection. + */ + private DetectionStatus detectionStatus; + + /* + * The name of the new image created by the patch. + */ + private String newImageName; + + /* + * New layer update details in the target image. + */ + private PatchDetailsNewLayer newLayer; + + /* + * The old layer details in the target image. + */ + private PatchDetailsOldLayer oldLayer; + + /* + * The type for the patch. + */ + private PatchType patchType; + + /** + * Creates an instance of PatchDetails class. + */ + public PatchDetails() { + } + + /** + * Get the targetContainerName property: The name of the target container for the patch. + * + * @return the targetContainerName value. + */ + public String targetContainerName() { + return this.targetContainerName; + } + + /** + * Get the targetImage property: The name of the target image for the patch. + * + * @return the targetImage value. + */ + public String targetImage() { + return this.targetImage; + } + + /** + * Get the lastDetectionTime property: The UTC timestamp that describes the latest detection was done. + * + * @return the lastDetectionTime value. + */ + public OffsetDateTime lastDetectionTime() { + return this.lastDetectionTime; + } + + /** + * Get the detectionStatus property: The status of the patch detection. + * + * @return the detectionStatus value. + */ + public DetectionStatus detectionStatus() { + return this.detectionStatus; + } + + /** + * Get the newImageName property: The name of the new image created by the patch. + * + * @return the newImageName value. + */ + public String newImageName() { + return this.newImageName; + } + + /** + * Get the newLayer property: New layer update details in the target image. + * + * @return the newLayer value. + */ + public PatchDetailsNewLayer newLayer() { + return this.newLayer; + } + + /** + * Get the oldLayer property: The old layer details in the target image. + * + * @return the oldLayer value. + */ + public PatchDetailsOldLayer oldLayer() { + return this.oldLayer; + } + + /** + * Get the patchType property: The type for the patch. + * + * @return the patchType value. + */ + public PatchType patchType() { + return this.patchType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (newLayer() != null) { + newLayer().validate(); + } + if (oldLayer() != null) { + oldLayer().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PatchDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PatchDetails 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 PatchDetails. + */ + public static PatchDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PatchDetails deserializedPatchDetails = new PatchDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("targetContainerName".equals(fieldName)) { + deserializedPatchDetails.targetContainerName = reader.getString(); + } else if ("targetImage".equals(fieldName)) { + deserializedPatchDetails.targetImage = reader.getString(); + } else if ("lastDetectionTime".equals(fieldName)) { + deserializedPatchDetails.lastDetectionTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("detectionStatus".equals(fieldName)) { + deserializedPatchDetails.detectionStatus = DetectionStatus.fromString(reader.getString()); + } else if ("newImageName".equals(fieldName)) { + deserializedPatchDetails.newImageName = reader.getString(); + } else if ("newLayer".equals(fieldName)) { + deserializedPatchDetails.newLayer = PatchDetailsNewLayer.fromJson(reader); + } else if ("oldLayer".equals(fieldName)) { + deserializedPatchDetails.oldLayer = PatchDetailsOldLayer.fromJson(reader); + } else if ("patchType".equals(fieldName)) { + deserializedPatchDetails.patchType = PatchType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedPatchDetails; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PatchDetailsNewLayer.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PatchDetailsNewLayer.java new file mode 100644 index 000000000000..0e6f2b59cab2 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PatchDetailsNewLayer.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.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * New layer update details in the target image. + */ +@Fluent +public final class PatchDetailsNewLayer implements JsonSerializable { + /* + * The details of the new layer for the target image. + */ + private String name; + + /* + * The framework and its version in the new run image for the target image. + */ + private String frameworkAndVersion; + + /* + * The OS name and its version in the new run image for the target image. + */ + private String osAndVersion; + + /** + * Creates an instance of PatchDetailsNewLayer class. + */ + public PatchDetailsNewLayer() { + } + + /** + * Get the name property: The details of the new layer for the target image. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The details of the new layer for the target image. + * + * @param name the name value to set. + * @return the PatchDetailsNewLayer object itself. + */ + public PatchDetailsNewLayer withName(String name) { + this.name = name; + return this; + } + + /** + * Get the frameworkAndVersion property: The framework and its version in the new run image for the target image. + * + * @return the frameworkAndVersion value. + */ + public String frameworkAndVersion() { + return this.frameworkAndVersion; + } + + /** + * Set the frameworkAndVersion property: The framework and its version in the new run image for the target image. + * + * @param frameworkAndVersion the frameworkAndVersion value to set. + * @return the PatchDetailsNewLayer object itself. + */ + public PatchDetailsNewLayer withFrameworkAndVersion(String frameworkAndVersion) { + this.frameworkAndVersion = frameworkAndVersion; + return this; + } + + /** + * Get the osAndVersion property: The OS name and its version in the new run image for the target image. + * + * @return the osAndVersion value. + */ + public String osAndVersion() { + return this.osAndVersion; + } + + /** + * Set the osAndVersion property: The OS name and its version in the new run image for the target image. + * + * @param osAndVersion the osAndVersion value to set. + * @return the PatchDetailsNewLayer object itself. + */ + public PatchDetailsNewLayer withOsAndVersion(String osAndVersion) { + this.osAndVersion = osAndVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws 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("frameworkAndVersion", this.frameworkAndVersion); + jsonWriter.writeStringField("osAndVersion", this.osAndVersion); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PatchDetailsNewLayer from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PatchDetailsNewLayer if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the PatchDetailsNewLayer. + */ + public static PatchDetailsNewLayer fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PatchDetailsNewLayer deserializedPatchDetailsNewLayer = new PatchDetailsNewLayer(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedPatchDetailsNewLayer.name = reader.getString(); + } else if ("frameworkAndVersion".equals(fieldName)) { + deserializedPatchDetailsNewLayer.frameworkAndVersion = reader.getString(); + } else if ("osAndVersion".equals(fieldName)) { + deserializedPatchDetailsNewLayer.osAndVersion = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPatchDetailsNewLayer; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PatchDetailsOldLayer.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PatchDetailsOldLayer.java new file mode 100644 index 000000000000..f67ae64e7ec5 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PatchDetailsOldLayer.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.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The old layer details in the target image. + */ +@Fluent +public final class PatchDetailsOldLayer implements JsonSerializable { + /* + * The details of the old layer for the target image. + */ + private String name; + + /* + * The framework and its version in the old run image for the target image. + */ + private String frameworkAndVersion; + + /* + * The OS name and its version in the old run image for the target image. + */ + private String osAndVersion; + + /** + * Creates an instance of PatchDetailsOldLayer class. + */ + public PatchDetailsOldLayer() { + } + + /** + * Get the name property: The details of the old layer for the target image. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The details of the old layer for the target image. + * + * @param name the name value to set. + * @return the PatchDetailsOldLayer object itself. + */ + public PatchDetailsOldLayer withName(String name) { + this.name = name; + return this; + } + + /** + * Get the frameworkAndVersion property: The framework and its version in the old run image for the target image. + * + * @return the frameworkAndVersion value. + */ + public String frameworkAndVersion() { + return this.frameworkAndVersion; + } + + /** + * Set the frameworkAndVersion property: The framework and its version in the old run image for the target image. + * + * @param frameworkAndVersion the frameworkAndVersion value to set. + * @return the PatchDetailsOldLayer object itself. + */ + public PatchDetailsOldLayer withFrameworkAndVersion(String frameworkAndVersion) { + this.frameworkAndVersion = frameworkAndVersion; + return this; + } + + /** + * Get the osAndVersion property: The OS name and its version in the old run image for the target image. + * + * @return the osAndVersion value. + */ + public String osAndVersion() { + return this.osAndVersion; + } + + /** + * Set the osAndVersion property: The OS name and its version in the old run image for the target image. + * + * @param osAndVersion the osAndVersion value to set. + * @return the PatchDetailsOldLayer object itself. + */ + public PatchDetailsOldLayer withOsAndVersion(String osAndVersion) { + this.osAndVersion = osAndVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws 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("frameworkAndVersion", this.frameworkAndVersion); + jsonWriter.writeStringField("osAndVersion", this.osAndVersion); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PatchDetailsOldLayer from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PatchDetailsOldLayer if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the PatchDetailsOldLayer. + */ + public static PatchDetailsOldLayer fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PatchDetailsOldLayer deserializedPatchDetailsOldLayer = new PatchDetailsOldLayer(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedPatchDetailsOldLayer.name = reader.getString(); + } else if ("frameworkAndVersion".equals(fieldName)) { + deserializedPatchDetailsOldLayer.frameworkAndVersion = reader.getString(); + } else if ("osAndVersion".equals(fieldName)) { + deserializedPatchDetailsOldLayer.osAndVersion = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPatchDetailsOldLayer; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PatchProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PatchProperties.java new file mode 100644 index 000000000000..42bd0ccf9f07 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PatchProperties.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.appcontainers.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.util.List; + +/** + * Top level properties that describes current states of the patch resource. + */ +@Fluent +public final class PatchProperties implements JsonSerializable { + /* + * The Azure resource id of the target environment for the patch. + */ + private String targetEnvironmentId; + + /* + * The Azure resource id of the target container app for the patch. + */ + private String targetContainerAppId; + + /* + * The Azure resource id of the target revision for the patch. + */ + private String targetRevisionId; + + /* + * The status of the patch operation. + */ + private PatchApplyStatus patchApplyStatus; + + /* + * The UTC timestamp that describes when the patch object was created. + */ + private OffsetDateTime createdAt; + + /* + * The UTC timestamp that describes when the patch object was last updated. + */ + private OffsetDateTime lastModifiedAt; + + /* + * Detailed info describes the patch operation for the target container app. + */ + private List patchDetails; + + /** + * Creates an instance of PatchProperties class. + */ + public PatchProperties() { + } + + /** + * Get the targetEnvironmentId property: The Azure resource id of the target environment for the patch. + * + * @return the targetEnvironmentId value. + */ + public String targetEnvironmentId() { + return this.targetEnvironmentId; + } + + /** + * Set the targetEnvironmentId property: The Azure resource id of the target environment for the patch. + * + * @param targetEnvironmentId the targetEnvironmentId value to set. + * @return the PatchProperties object itself. + */ + public PatchProperties withTargetEnvironmentId(String targetEnvironmentId) { + this.targetEnvironmentId = targetEnvironmentId; + return this; + } + + /** + * Get the targetContainerAppId property: The Azure resource id of the target container app for the patch. + * + * @return the targetContainerAppId value. + */ + public String targetContainerAppId() { + return this.targetContainerAppId; + } + + /** + * Set the targetContainerAppId property: The Azure resource id of the target container app for the patch. + * + * @param targetContainerAppId the targetContainerAppId value to set. + * @return the PatchProperties object itself. + */ + public PatchProperties withTargetContainerAppId(String targetContainerAppId) { + this.targetContainerAppId = targetContainerAppId; + return this; + } + + /** + * Get the targetRevisionId property: The Azure resource id of the target revision for the patch. + * + * @return the targetRevisionId value. + */ + public String targetRevisionId() { + return this.targetRevisionId; + } + + /** + * Set the targetRevisionId property: The Azure resource id of the target revision for the patch. + * + * @param targetRevisionId the targetRevisionId value to set. + * @return the PatchProperties object itself. + */ + public PatchProperties withTargetRevisionId(String targetRevisionId) { + this.targetRevisionId = targetRevisionId; + return this; + } + + /** + * Get the patchApplyStatus property: The status of the patch operation. + * + * @return the patchApplyStatus value. + */ + public PatchApplyStatus patchApplyStatus() { + return this.patchApplyStatus; + } + + /** + * Get the createdAt property: The UTC timestamp that describes when the patch object was created. + * + * @return the createdAt value. + */ + public OffsetDateTime createdAt() { + return this.createdAt; + } + + /** + * Get the lastModifiedAt property: The UTC timestamp that describes when the patch object was last updated. + * + * @return the lastModifiedAt value. + */ + public OffsetDateTime lastModifiedAt() { + return this.lastModifiedAt; + } + + /** + * Get the patchDetails property: Detailed info describes the patch operation for the target container app. + * + * @return the patchDetails value. + */ + public List patchDetails() { + return this.patchDetails; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (patchDetails() != null) { + patchDetails().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("targetEnvironmentId", this.targetEnvironmentId); + jsonWriter.writeStringField("targetContainerAppId", this.targetContainerAppId); + jsonWriter.writeStringField("targetRevisionId", this.targetRevisionId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PatchProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PatchProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the PatchProperties. + */ + public static PatchProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PatchProperties deserializedPatchProperties = new PatchProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("targetEnvironmentId".equals(fieldName)) { + deserializedPatchProperties.targetEnvironmentId = reader.getString(); + } else if ("targetContainerAppId".equals(fieldName)) { + deserializedPatchProperties.targetContainerAppId = reader.getString(); + } else if ("targetRevisionId".equals(fieldName)) { + deserializedPatchProperties.targetRevisionId = reader.getString(); + } else if ("patchApplyStatus".equals(fieldName)) { + deserializedPatchProperties.patchApplyStatus = PatchApplyStatus.fromString(reader.getString()); + } else if ("createdAt".equals(fieldName)) { + deserializedPatchProperties.createdAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastModifiedAt".equals(fieldName)) { + deserializedPatchProperties.lastModifiedAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("patchDetails".equals(fieldName)) { + List patchDetails = reader.readArray(reader1 -> PatchDetails.fromJson(reader1)); + deserializedPatchProperties.patchDetails = patchDetails; + } else { + reader.skipChildren(); + } + } + + return deserializedPatchProperties; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PatchSkipConfig.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PatchSkipConfig.java new file mode 100644 index 000000000000..8d8868383d61 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PatchSkipConfig.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.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The configuration for patcher to skip a patch or not. + */ +@Fluent +public final class PatchSkipConfig implements JsonSerializable { + /* + * The flag to indicate whether to skip the patch or not. + */ + private Boolean skip; + + /** + * Creates an instance of PatchSkipConfig class. + */ + public PatchSkipConfig() { + } + + /** + * Get the skip property: The flag to indicate whether to skip the patch or not. + * + * @return the skip value. + */ + public Boolean skip() { + return this.skip; + } + + /** + * Set the skip property: The flag to indicate whether to skip the patch or not. + * + * @param skip the skip value to set. + * @return the PatchSkipConfig object itself. + */ + public PatchSkipConfig withSkip(Boolean skip) { + this.skip = skip; + return this; + } + + /** + * Validates the instance. + * + * @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("skip", this.skip); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PatchSkipConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PatchSkipConfig if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the PatchSkipConfig. + */ + public static PatchSkipConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PatchSkipConfig deserializedPatchSkipConfig = new PatchSkipConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("skip".equals(fieldName)) { + deserializedPatchSkipConfig.skip = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedPatchSkipConfig; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PatchType.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PatchType.java new file mode 100644 index 000000000000..3ee6cd1a3fd4 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PatchType.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.appcontainers.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The type for the patch. + */ +public final class PatchType extends ExpandableStringEnum { + /** + * Static value FrameworkSecurity for PatchType. + */ + public static final PatchType FRAMEWORK_SECURITY = fromString("FrameworkSecurity"); + + /** + * Static value OSSecurity for PatchType. + */ + public static final PatchType OSSECURITY = fromString("OSSecurity"); + + /** + * Static value FrameworkAndOSSecurity for PatchType. + */ + public static final PatchType FRAMEWORK_AND_OSSECURITY = fromString("FrameworkAndOSSecurity"); + + /** + * Static value Other for PatchType. + */ + public static final PatchType OTHER = fromString("Other"); + + /** + * Creates a new instance of PatchType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PatchType() { + } + + /** + * Creates or finds a PatchType from its string representation. + * + * @param name a name to look for. + * @return the corresponding PatchType. + */ + public static PatchType fromString(String name) { + return fromString(name, PatchType.class); + } + + /** + * Gets known PatchType values. + * + * @return known PatchType values. + */ + public static Collection values() { + return values(PatchType.class); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PatchingMode.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PatchingMode.java new file mode 100644 index 000000000000..f2f90e3e0956 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PatchingMode.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.appcontainers.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Patching mode for the container app. Null or default in this field will be interpreted as Automatic by RP. Automatic + * mode will automatically apply available patches. Manual mode will require the user to manually apply patches. + * Disabled mode will stop patch detection and auto patching. + */ +public final class PatchingMode extends ExpandableStringEnum { + /** + * Static value Automatic for PatchingMode. + */ + public static final PatchingMode AUTOMATIC = fromString("Automatic"); + + /** + * Static value Manual for PatchingMode. + */ + public static final PatchingMode MANUAL = fromString("Manual"); + + /** + * Static value Disabled for PatchingMode. + */ + public static final PatchingMode DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of PatchingMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PatchingMode() { + } + + /** + * Creates or finds a PatchingMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding PatchingMode. + */ + public static PatchingMode fromString(String name) { + return fromString(name, PatchingMode.class); + } + + /** + * Gets known PatchingMode values. + * + * @return known PatchingMode values. + */ + public static Collection values() { + return values(PatchingMode.class); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PoolManagementType.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PoolManagementType.java new file mode 100644 index 000000000000..a7c307747cd0 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PoolManagementType.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.appcontainers.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The pool management type of the session pool. + */ +public final class PoolManagementType extends ExpandableStringEnum { + /** + * Static value Manual for PoolManagementType. + */ + public static final PoolManagementType MANUAL = fromString("Manual"); + + /** + * Static value Dynamic for PoolManagementType. + */ + public static final PoolManagementType DYNAMIC = fromString("Dynamic"); + + /** + * Creates a new instance of PoolManagementType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PoolManagementType() { + } + + /** + * Creates or finds a PoolManagementType from its string representation. + * + * @param name a name to look for. + * @return the corresponding PoolManagementType. + */ + public static PoolManagementType fromString(String name) { + return fromString(name, PoolManagementType.class); + } + + /** + * Gets known PoolManagementType values. + * + * @return known PoolManagementType values. + */ + public static Collection values() { + return values(PoolManagementType.class); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PreBuildStep.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PreBuildStep.java index 8f67420509b3..cfc480dae4f8 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PreBuildStep.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PreBuildStep.java @@ -5,30 +5,31 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.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; /** * Model representing a pre-build step. */ @Fluent -public final class PreBuildStep { +public final class PreBuildStep implements JsonSerializable { /* * Description of the pre-build step. */ - @JsonProperty(value = "description") private String description; /* * List of custom commands to run. */ - @JsonProperty(value = "scripts") private List scripts; /* * Http get request to send before the build. */ - @JsonProperty(value = "httpGet") private HttpGet httpGet; /** @@ -107,4 +108,47 @@ public void validate() { httpGet().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeArrayField("scripts", this.scripts, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("httpGet", this.httpGet); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PreBuildStep from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PreBuildStep if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the PreBuildStep. + */ + public static PreBuildStep fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PreBuildStep deserializedPreBuildStep = new PreBuildStep(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedPreBuildStep.description = reader.getString(); + } else if ("scripts".equals(fieldName)) { + List scripts = reader.readArray(reader1 -> reader1.getString()); + deserializedPreBuildStep.scripts = scripts; + } else if ("httpGet".equals(fieldName)) { + deserializedPreBuildStep.httpGet = HttpGet.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPreBuildStep; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PrivateEndpoint.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PrivateEndpoint.java new file mode 100644 index 000000000000..93625e4abf73 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PrivateEndpoint.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.appcontainers.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; + +/** + * The Private Endpoint resource. + */ +@Immutable +public final class PrivateEndpoint implements JsonSerializable { + /* + * The ARM identifier for Private Endpoint + */ + private String id; + + /** + * Creates an instance of PrivateEndpoint class. + */ + public PrivateEndpoint() { + } + + /** + * Get the id property: The ARM identifier for Private Endpoint. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Validates the 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 PrivateEndpoint from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpoint if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateEndpoint. + */ + public static PrivateEndpoint fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpoint deserializedPrivateEndpoint = new PrivateEndpoint(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPrivateEndpoint.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpoint; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PrivateEndpointConnection.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PrivateEndpointConnection.java new file mode 100644 index 000000000000..d0cd177423c3 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PrivateEndpointConnection.java @@ -0,0 +1,245 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appcontainers.fluent.models.PrivateEndpointConnectionInner; +import java.util.List; + +/** + * An immutable client-side representation of PrivateEndpointConnection. + */ +public interface PrivateEndpointConnection { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the groupIds property: The group ids for the private endpoint resource. + * + * @return the groupIds value. + */ + List groupIds(); + + /** + * Gets the privateEndpoint property: The resource of private end point. + * + * @return the privateEndpoint value. + */ + PrivateEndpoint privateEndpoint(); + + /** + * Gets the privateLinkServiceConnectionState property: A collection of information about the state of the + * connection between service consumer and provider. + * + * @return the privateLinkServiceConnectionState value. + */ + PrivateLinkServiceConnectionState privateLinkServiceConnectionState(); + + /** + * Gets the provisioningState property: The provisioning state of the private endpoint connection resource. + * + * @return the provisioningState value. + */ + PrivateEndpointConnectionProvisioningState provisioningState(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.appcontainers.fluent.models.PrivateEndpointConnectionInner object. + * + * @return the inner object. + */ + PrivateEndpointConnectionInner innerModel(); + + /** + * The entirety of the PrivateEndpointConnection definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The PrivateEndpointConnection definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the PrivateEndpointConnection definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the PrivateEndpointConnection definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, environmentName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @return the next definition stage. + */ + WithCreate withExistingManagedEnvironment(String resourceGroupName, String environmentName); + } + + /** + * The stage of the PrivateEndpointConnection 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.WithPrivateEndpoint, DefinitionStages.WithPrivateLinkServiceConnectionState { + /** + * Executes the create request. + * + * @return the created resource. + */ + PrivateEndpointConnection create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + PrivateEndpointConnection create(Context context); + } + + /** + * The stage of the PrivateEndpointConnection definition allowing to specify privateEndpoint. + */ + interface WithPrivateEndpoint { + /** + * Specifies the privateEndpoint property: The resource of private end point.. + * + * @param privateEndpoint The resource of private end point. + * @return the next definition stage. + */ + WithCreate withPrivateEndpoint(PrivateEndpoint privateEndpoint); + } + + /** + * The stage of the PrivateEndpointConnection definition allowing to specify privateLinkServiceConnectionState. + */ + interface WithPrivateLinkServiceConnectionState { + /** + * Specifies the privateLinkServiceConnectionState property: A collection of information about the state of + * the connection between service consumer and provider.. + * + * @param privateLinkServiceConnectionState A collection of information about the state of the connection + * between service consumer and provider. + * @return the next definition stage. + */ + WithCreate withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState); + } + } + + /** + * Begins update for the PrivateEndpointConnection resource. + * + * @return the stage of resource update. + */ + PrivateEndpointConnection.Update update(); + + /** + * The template for PrivateEndpointConnection update. + */ + interface Update extends UpdateStages.WithPrivateEndpoint, UpdateStages.WithPrivateLinkServiceConnectionState { + /** + * Executes the update request. + * + * @return the updated resource. + */ + PrivateEndpointConnection apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + PrivateEndpointConnection apply(Context context); + } + + /** + * The PrivateEndpointConnection update stages. + */ + interface UpdateStages { + /** + * The stage of the PrivateEndpointConnection update allowing to specify privateEndpoint. + */ + interface WithPrivateEndpoint { + /** + * Specifies the privateEndpoint property: The resource of private end point.. + * + * @param privateEndpoint The resource of private end point. + * @return the next definition stage. + */ + Update withPrivateEndpoint(PrivateEndpoint privateEndpoint); + } + + /** + * The stage of the PrivateEndpointConnection update allowing to specify privateLinkServiceConnectionState. + */ + interface WithPrivateLinkServiceConnectionState { + /** + * Specifies the privateLinkServiceConnectionState property: A collection of information about the state of + * the connection between service consumer and provider.. + * + * @param privateLinkServiceConnectionState A collection of information about the state of the connection + * between service consumer and provider. + * @return the next definition stage. + */ + Update withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + PrivateEndpointConnection refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + PrivateEndpointConnection refresh(Context context); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PrivateEndpointConnectionListResult.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PrivateEndpointConnectionListResult.java new file mode 100644 index 000000000000..75d88ee3d0b9 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PrivateEndpointConnectionListResult.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.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.appcontainers.fluent.models.PrivateEndpointConnectionInner; +import java.io.IOException; +import java.util.List; + +/** + * List of private endpoint connection associated with the specified resource. + */ +@Fluent +public final class PrivateEndpointConnectionListResult + implements JsonSerializable { + /* + * Array of private endpoint connections + */ + private List value; + + /* + * URL to get the next set of operation list results (if there are any). + */ + private String nextLink; + + /** + * Creates an instance of PrivateEndpointConnectionListResult class. + */ + public PrivateEndpointConnectionListResult() { + } + + /** + * Get the value property: Array of private endpoint connections. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of private endpoint connections. + * + * @param value the value value to set. + * @return the PrivateEndpointConnectionListResult object itself. + */ + public PrivateEndpointConnectionListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * 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(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpointConnectionListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpointConnectionListResult if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateEndpointConnectionListResult. + */ + public static PrivateEndpointConnectionListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpointConnectionListResult deserializedPrivateEndpointConnectionListResult + = new PrivateEndpointConnectionListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> PrivateEndpointConnectionInner.fromJson(reader1)); + deserializedPrivateEndpointConnectionListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedPrivateEndpointConnectionListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpointConnectionListResult; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PrivateEndpointConnectionProvisioningState.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PrivateEndpointConnectionProvisioningState.java new file mode 100644 index 000000000000..8f010fe26dd4 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PrivateEndpointConnectionProvisioningState.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.appcontainers.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The current provisioning state. + */ +public final class PrivateEndpointConnectionProvisioningState + extends ExpandableStringEnum { + /** + * Static value Succeeded for PrivateEndpointConnectionProvisioningState. + */ + public static final PrivateEndpointConnectionProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Static value Failed for PrivateEndpointConnectionProvisioningState. + */ + public static final PrivateEndpointConnectionProvisioningState FAILED = fromString("Failed"); + + /** + * Static value Canceled for PrivateEndpointConnectionProvisioningState. + */ + public static final PrivateEndpointConnectionProvisioningState CANCELED = fromString("Canceled"); + + /** + * Static value Waiting for PrivateEndpointConnectionProvisioningState. + */ + public static final PrivateEndpointConnectionProvisioningState WAITING = fromString("Waiting"); + + /** + * Static value Updating for PrivateEndpointConnectionProvisioningState. + */ + public static final PrivateEndpointConnectionProvisioningState UPDATING = fromString("Updating"); + + /** + * Static value Deleting for PrivateEndpointConnectionProvisioningState. + */ + public static final PrivateEndpointConnectionProvisioningState DELETING = fromString("Deleting"); + + /** + * Static value Pending for PrivateEndpointConnectionProvisioningState. + */ + public static final PrivateEndpointConnectionProvisioningState PENDING = fromString("Pending"); + + /** + * Creates a new instance of PrivateEndpointConnectionProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PrivateEndpointConnectionProvisioningState() { + } + + /** + * Creates or finds a PrivateEndpointConnectionProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding PrivateEndpointConnectionProvisioningState. + */ + public static PrivateEndpointConnectionProvisioningState fromString(String name) { + return fromString(name, PrivateEndpointConnectionProvisioningState.class); + } + + /** + * Gets known PrivateEndpointConnectionProvisioningState values. + * + * @return known PrivateEndpointConnectionProvisioningState values. + */ + public static Collection values() { + return values(PrivateEndpointConnectionProvisioningState.class); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PrivateEndpointServiceConnectionStatus.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PrivateEndpointServiceConnectionStatus.java new file mode 100644 index 000000000000..b56460c10ee8 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PrivateEndpointServiceConnectionStatus.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.appcontainers.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The private endpoint connection status. + */ +public final class PrivateEndpointServiceConnectionStatus + extends ExpandableStringEnum { + /** + * Static value Pending for PrivateEndpointServiceConnectionStatus. + */ + public static final PrivateEndpointServiceConnectionStatus PENDING = fromString("Pending"); + + /** + * Static value Approved for PrivateEndpointServiceConnectionStatus. + */ + public static final PrivateEndpointServiceConnectionStatus APPROVED = fromString("Approved"); + + /** + * Static value Rejected for PrivateEndpointServiceConnectionStatus. + */ + public static final PrivateEndpointServiceConnectionStatus REJECTED = fromString("Rejected"); + + /** + * Static value Disconnected for PrivateEndpointServiceConnectionStatus. + */ + public static final PrivateEndpointServiceConnectionStatus DISCONNECTED = fromString("Disconnected"); + + /** + * Creates a new instance of PrivateEndpointServiceConnectionStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PrivateEndpointServiceConnectionStatus() { + } + + /** + * Creates or finds a PrivateEndpointServiceConnectionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding PrivateEndpointServiceConnectionStatus. + */ + public static PrivateEndpointServiceConnectionStatus fromString(String name) { + return fromString(name, PrivateEndpointServiceConnectionStatus.class); + } + + /** + * Gets known PrivateEndpointServiceConnectionStatus values. + * + * @return known PrivateEndpointServiceConnectionStatus values. + */ + public static Collection values() { + return values(PrivateEndpointServiceConnectionStatus.class); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PrivateLinkResource.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PrivateLinkResource.java new file mode 100644 index 000000000000..43ea727b07d3 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PrivateLinkResource.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.appcontainers.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appcontainers.fluent.models.PrivateLinkResourceInner; +import java.util.List; + +/** + * An immutable client-side representation of PrivateLinkResource. + */ +public interface PrivateLinkResource { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the groupId property: The private link resource group id. + * + * @return the groupId value. + */ + String groupId(); + + /** + * Gets the requiredMembers property: The private link resource required member names. + * + * @return the requiredMembers value. + */ + List requiredMembers(); + + /** + * Gets the requiredZoneNames property: The private link resource private link DNS zone name. + * + * @return the requiredZoneNames value. + */ + List requiredZoneNames(); + + /** + * Gets the inner com.azure.resourcemanager.appcontainers.fluent.models.PrivateLinkResourceInner object. + * + * @return the inner object. + */ + PrivateLinkResourceInner innerModel(); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PrivateLinkResourceListResult.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PrivateLinkResourceListResult.java new file mode 100644 index 000000000000..c6e6c7160c7c --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PrivateLinkResourceListResult.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.appcontainers.models; + +import com.azure.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.appcontainers.fluent.models.PrivateLinkResourceInner; +import java.io.IOException; +import java.util.List; + +/** + * A list of private link resources. + */ +@Fluent +public final class PrivateLinkResourceListResult implements JsonSerializable { + /* + * Array of private link resources + */ + private List value; + + /* + * URL to get the next set of operation list results (if there are any). + */ + private String nextLink; + + /** + * Creates an instance of PrivateLinkResourceListResult class. + */ + public PrivateLinkResourceListResult() { + } + + /** + * Get the value property: Array of private link resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of private link resources. + * + * @param value the value value to set. + * @return the PrivateLinkResourceListResult object itself. + */ + public PrivateLinkResourceListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * 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(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkResourceListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkResourceListResult if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateLinkResourceListResult. + */ + public static PrivateLinkResourceListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkResourceListResult deserializedPrivateLinkResourceListResult + = new PrivateLinkResourceListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> PrivateLinkResourceInner.fromJson(reader1)); + deserializedPrivateLinkResourceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedPrivateLinkResourceListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkResourceListResult; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PrivateLinkServiceConnectionState.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PrivateLinkServiceConnectionState.java new file mode 100644 index 000000000000..0c31b2ae3d9c --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PrivateLinkServiceConnectionState.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.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A collection of information about the state of the connection between service consumer and provider. + */ +@Fluent +public final class PrivateLinkServiceConnectionState implements JsonSerializable { + /* + * Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + */ + private PrivateEndpointServiceConnectionStatus status; + + /* + * The reason for approval/rejection of the connection. + */ + private String description; + + /* + * A message indicating if changes on the service provider require any updates on the consumer. + */ + private String actionsRequired; + + /** + * Creates an instance of PrivateLinkServiceConnectionState class. + */ + public PrivateLinkServiceConnectionState() { + } + + /** + * Get the status property: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the + * service. + * + * @return the status value. + */ + public PrivateEndpointServiceConnectionStatus status() { + return this.status; + } + + /** + * Set the status property: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the + * service. + * + * @param status the status value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withStatus(PrivateEndpointServiceConnectionStatus status) { + this.status = status; + return this; + } + + /** + * Get the description property: The reason for approval/rejection of the connection. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The reason for approval/rejection of the connection. + * + * @param description the description value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the actionsRequired property: A message indicating if changes on the service provider require any updates on + * the consumer. + * + * @return the actionsRequired value. + */ + public String actionsRequired() { + return this.actionsRequired; + } + + /** + * Set the actionsRequired property: A message indicating if changes on the service provider require any updates on + * the consumer. + * + * @param actionsRequired the actionsRequired value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withActionsRequired(String actionsRequired) { + this.actionsRequired = actionsRequired; + return this; + } + + /** + * Validates the instance. + * + * @throws 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()); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("actionsRequired", this.actionsRequired); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkServiceConnectionState from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkServiceConnectionState if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateLinkServiceConnectionState. + */ + public static PrivateLinkServiceConnectionState fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkServiceConnectionState deserializedPrivateLinkServiceConnectionState + = new PrivateLinkServiceConnectionState(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedPrivateLinkServiceConnectionState.status + = PrivateEndpointServiceConnectionStatus.fromString(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedPrivateLinkServiceConnectionState.description = reader.getString(); + } else if ("actionsRequired".equals(fieldName)) { + deserializedPrivateLinkServiceConnectionState.actionsRequired = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkServiceConnectionState; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PublicNetworkAccess.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PublicNetworkAccess.java new file mode 100644 index 000000000000..0dacf1daad39 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PublicNetworkAccess.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.appcontainers.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Property to allow or block all public traffic. Allowed Values: 'Enabled', 'Disabled'. + */ +public final class PublicNetworkAccess extends ExpandableStringEnum { + /** + * Static value Enabled for PublicNetworkAccess. + */ + public static final PublicNetworkAccess ENABLED = fromString("Enabled"); + + /** + * Static value Disabled for PublicNetworkAccess. + */ + public static final PublicNetworkAccess DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of PublicNetworkAccess value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PublicNetworkAccess() { + } + + /** + * Creates or finds a PublicNetworkAccess from its string representation. + * + * @param name a name to look for. + * @return the corresponding PublicNetworkAccess. + */ + public static PublicNetworkAccess fromString(String name) { + return fromString(name, PublicNetworkAccess.class); + } + + /** + * Gets known PublicNetworkAccess values. + * + * @return known PublicNetworkAccess values. + */ + public static Collection values() { + return values(PublicNetworkAccess.class); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/QueueScaleRule.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/QueueScaleRule.java index aef1fb3523f6..207032b0546c 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/QueueScaleRule.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/QueueScaleRule.java @@ -5,38 +5,70 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.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; /** * Container App container Azure Queue based scaling rule. */ @Fluent -public final class QueueScaleRule { +public final class QueueScaleRule implements JsonSerializable { + /* + * Storage account name. required if using managed identity to authenticate + */ + private String accountName; + /* * Queue name. */ - @JsonProperty(value = "queueName") private String queueName; /* * Queue length. */ - @JsonProperty(value = "queueLength") private Integer queueLength; /* * Authentication secrets for the queue scale rule. */ - @JsonProperty(value = "auth") private List auth; + /* + * The resource ID of a user-assigned managed identity that is assigned to the Container App, or 'system' for + * system-assigned identity. + */ + private String identity; + /** * Creates an instance of QueueScaleRule class. */ public QueueScaleRule() { } + /** + * Get the accountName property: Storage account name. required if using managed identity to authenticate. + * + * @return the accountName value. + */ + public String accountName() { + return this.accountName; + } + + /** + * Set the accountName property: Storage account name. required if using managed identity to authenticate. + * + * @param accountName the accountName value to set. + * @return the QueueScaleRule object itself. + */ + public QueueScaleRule withAccountName(String accountName) { + this.accountName = accountName; + return this; + } + /** * Get the queueName property: Queue name. * @@ -97,6 +129,28 @@ public QueueScaleRule withAuth(List auth) { return this; } + /** + * Get the identity property: The resource ID of a user-assigned managed identity that is assigned to the Container + * App, or 'system' for system-assigned identity. + * + * @return the identity value. + */ + public String identity() { + return this.identity; + } + + /** + * Set the identity property: The resource ID of a user-assigned managed identity that is assigned to the Container + * App, or 'system' for system-assigned identity. + * + * @param identity the identity value to set. + * @return the QueueScaleRule object itself. + */ + public QueueScaleRule withIdentity(String identity) { + this.identity = identity; + return this; + } + /** * Validates the instance. * @@ -107,4 +161,53 @@ public void validate() { auth().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("accountName", this.accountName); + jsonWriter.writeStringField("queueName", this.queueName); + jsonWriter.writeNumberField("queueLength", this.queueLength); + jsonWriter.writeArrayField("auth", this.auth, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("identity", this.identity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of QueueScaleRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of QueueScaleRule if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the QueueScaleRule. + */ + public static QueueScaleRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + QueueScaleRule deserializedQueueScaleRule = new QueueScaleRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("accountName".equals(fieldName)) { + deserializedQueueScaleRule.accountName = reader.getString(); + } else if ("queueName".equals(fieldName)) { + deserializedQueueScaleRule.queueName = reader.getString(); + } else if ("queueLength".equals(fieldName)) { + deserializedQueueScaleRule.queueLength = reader.getNullable(JsonReader::getInt); + } else if ("auth".equals(fieldName)) { + List auth = reader.readArray(reader1 -> ScaleRuleAuth.fromJson(reader1)); + deserializedQueueScaleRule.auth = auth; + } else if ("identity".equals(fieldName)) { + deserializedQueueScaleRule.identity = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedQueueScaleRule; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RegistryCredentials.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RegistryCredentials.java index a20caa49d999..0321d642e9a4 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RegistryCredentials.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RegistryCredentials.java @@ -5,36 +5,36 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Container App Private Registry. */ @Fluent -public final class RegistryCredentials { +public final class RegistryCredentials implements JsonSerializable { /* * Container Registry Server */ - @JsonProperty(value = "server") private String server; /* * Container Registry Username */ - @JsonProperty(value = "username") private String username; /* * The name of the Secret that contains the registry login password */ - @JsonProperty(value = "passwordSecretRef") private String passwordSecretRef; /* * A Managed Identity to use to authenticate with Azure Container Registry. For user-assigned identities, use the * full user-assigned identity Resource ID. For system-assigned identities, use 'system' */ - @JsonProperty(value = "identity") private String identity; /** @@ -134,4 +134,49 @@ public RegistryCredentials withIdentity(String identity) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("server", this.server); + jsonWriter.writeStringField("username", this.username); + jsonWriter.writeStringField("passwordSecretRef", this.passwordSecretRef); + jsonWriter.writeStringField("identity", this.identity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RegistryCredentials from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RegistryCredentials if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the RegistryCredentials. + */ + public static RegistryCredentials fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RegistryCredentials deserializedRegistryCredentials = new RegistryCredentials(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("server".equals(fieldName)) { + deserializedRegistryCredentials.server = reader.getString(); + } else if ("username".equals(fieldName)) { + deserializedRegistryCredentials.username = reader.getString(); + } else if ("passwordSecretRef".equals(fieldName)) { + deserializedRegistryCredentials.passwordSecretRef = reader.getString(); + } else if ("identity".equals(fieldName)) { + deserializedRegistryCredentials.identity = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRegistryCredentials; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RegistryInfo.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RegistryInfo.java index ba74fd170270..cd2e6ce356d3 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RegistryInfo.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RegistryInfo.java @@ -5,29 +5,30 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Container App registry information. */ @Fluent -public final class RegistryInfo { +public final class RegistryInfo implements JsonSerializable { /* * registry server Url. */ - @JsonProperty(value = "registryUrl") private String registryUrl; /* * registry username. */ - @JsonProperty(value = "registryUserName") private String registryUsername; /* * registry secret. */ - @JsonProperty(value = "registryPassword") private String registryPassword; /** @@ -103,4 +104,46 @@ public RegistryInfo withRegistryPassword(String registryPassword) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("registryUrl", this.registryUrl); + jsonWriter.writeStringField("registryUserName", this.registryUsername); + jsonWriter.writeStringField("registryPassword", this.registryPassword); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RegistryInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RegistryInfo if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the RegistryInfo. + */ + public static RegistryInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RegistryInfo deserializedRegistryInfo = new RegistryInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("registryUrl".equals(fieldName)) { + deserializedRegistryInfo.registryUrl = reader.getString(); + } else if ("registryUserName".equals(fieldName)) { + deserializedRegistryInfo.registryUsername = reader.getString(); + } else if ("registryPassword".equals(fieldName)) { + deserializedRegistryInfo.registryPassword = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRegistryInfo; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ReplicaContainer.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ReplicaContainer.java index 8f05e41336c6..7e6a12306caa 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ReplicaContainer.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ReplicaContainer.java @@ -5,65 +5,60 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Container object under Container App Revision Replica. */ @Fluent -public final class ReplicaContainer { +public final class ReplicaContainer implements JsonSerializable { /* * The Name of the Container */ - @JsonProperty(value = "name") private String name; /* * The Id of the Container */ - @JsonProperty(value = "containerId") private String containerId; /* * The container ready status */ - @JsonProperty(value = "ready") private Boolean ready; /* * The container start status */ - @JsonProperty(value = "started") private Boolean started; /* * The container restart count */ - @JsonProperty(value = "restartCount") private Integer restartCount; /* * Current running state of the container */ - @JsonProperty(value = "runningState", access = JsonProperty.Access.WRITE_ONLY) private ContainerAppContainerRunningState runningState; /* * The details of container current running state */ - @JsonProperty(value = "runningStateDetails", access = JsonProperty.Access.WRITE_ONLY) private String runningStateDetails; /* * Log Stream endpoint */ - @JsonProperty(value = "logStreamEndpoint", access = JsonProperty.Access.WRITE_ONLY) private String logStreamEndpoint; /* * Container exec endpoint */ - @JsonProperty(value = "execEndpoint", access = JsonProperty.Access.WRITE_ONLY) private String execEndpoint; /** @@ -215,4 +210,61 @@ public String execEndpoint() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("containerId", this.containerId); + jsonWriter.writeBooleanField("ready", this.ready); + jsonWriter.writeBooleanField("started", this.started); + jsonWriter.writeNumberField("restartCount", this.restartCount); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ReplicaContainer from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ReplicaContainer if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ReplicaContainer. + */ + public static ReplicaContainer fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ReplicaContainer deserializedReplicaContainer = new ReplicaContainer(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedReplicaContainer.name = reader.getString(); + } else if ("containerId".equals(fieldName)) { + deserializedReplicaContainer.containerId = reader.getString(); + } else if ("ready".equals(fieldName)) { + deserializedReplicaContainer.ready = reader.getNullable(JsonReader::getBoolean); + } else if ("started".equals(fieldName)) { + deserializedReplicaContainer.started = reader.getNullable(JsonReader::getBoolean); + } else if ("restartCount".equals(fieldName)) { + deserializedReplicaContainer.restartCount = reader.getNullable(JsonReader::getInt); + } else if ("runningState".equals(fieldName)) { + deserializedReplicaContainer.runningState + = ContainerAppContainerRunningState.fromString(reader.getString()); + } else if ("runningStateDetails".equals(fieldName)) { + deserializedReplicaContainer.runningStateDetails = reader.getString(); + } else if ("logStreamEndpoint".equals(fieldName)) { + deserializedReplicaContainer.logStreamEndpoint = reader.getString(); + } else if ("execEndpoint".equals(fieldName)) { + deserializedReplicaContainer.execEndpoint = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedReplicaContainer; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ReplicaExecutionStatus.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ReplicaExecutionStatus.java new file mode 100644 index 000000000000..d8f1625fade8 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ReplicaExecutionStatus.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.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.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; + +/** + * Container Apps Job execution replica status. + */ +@Fluent +public final class ReplicaExecutionStatus implements JsonSerializable { + /* + * Replica Name. + */ + private String name; + + /* + * Containers in the execution replica + */ + private List containers; + + /** + * Creates an instance of ReplicaExecutionStatus class. + */ + public ReplicaExecutionStatus() { + } + + /** + * Get the name property: Replica Name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Replica Name. + * + * @param name the name value to set. + * @return the ReplicaExecutionStatus object itself. + */ + public ReplicaExecutionStatus withName(String name) { + this.name = name; + return this; + } + + /** + * Get the containers property: Containers in the execution replica. + * + * @return the containers value. + */ + public List containers() { + return this.containers; + } + + /** + * Set the containers property: Containers in the execution replica. + * + * @param containers the containers value to set. + * @return the ReplicaExecutionStatus object itself. + */ + public ReplicaExecutionStatus withContainers(List containers) { + this.containers = containers; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (containers() != null) { + containers().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeArrayField("containers", this.containers, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ReplicaExecutionStatus from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ReplicaExecutionStatus if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ReplicaExecutionStatus. + */ + public static ReplicaExecutionStatus fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ReplicaExecutionStatus deserializedReplicaExecutionStatus = new ReplicaExecutionStatus(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedReplicaExecutionStatus.name = reader.getString(); + } else if ("containers".equals(fieldName)) { + List containers + = reader.readArray(reader1 -> ContainerExecutionStatus.fromJson(reader1)); + deserializedReplicaExecutionStatus.containers = containers; + } else { + reader.skipChildren(); + } + } + + return deserializedReplicaExecutionStatus; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RevisionCollection.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RevisionCollection.java index a9efc54b85d5..92a177df8042 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RevisionCollection.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RevisionCollection.java @@ -6,25 +6,27 @@ 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.appcontainers.fluent.models.RevisionInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * Container App Revisions collection ARM resource. */ @Fluent -public final class RevisionCollection { +public final class RevisionCollection implements JsonSerializable { /* * Collection of resources. */ - @JsonProperty(value = "value", required = true) private List value; /* * Link to next page of resources. */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; /** @@ -69,12 +71,52 @@ public String nextLink() { */ public void validate() { if (value() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property value in model RevisionCollection")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model RevisionCollection")); } else { value().forEach(e -> e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(RevisionCollection.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RevisionCollection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RevisionCollection 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 RevisionCollection. + */ + public static RevisionCollection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RevisionCollection deserializedRevisionCollection = new RevisionCollection(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> RevisionInner.fromJson(reader1)); + deserializedRevisionCollection.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedRevisionCollection.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRevisionCollection; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RevisionHealthState.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RevisionHealthState.java index 9c7e078b6837..4a3c0e74cd96 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RevisionHealthState.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RevisionHealthState.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -42,7 +41,6 @@ public RevisionHealthState() { * @param name a name to look for. * @return the corresponding RevisionHealthState. */ - @JsonCreator public static RevisionHealthState fromString(String name) { return fromString(name, RevisionHealthState.class); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RevisionProvisioningState.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RevisionProvisioningState.java index 48a5bb326456..1d30087e32ed 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RevisionProvisioningState.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RevisionProvisioningState.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -52,7 +51,6 @@ public RevisionProvisioningState() { * @param name a name to look for. * @return the corresponding RevisionProvisioningState. */ - @JsonCreator public static RevisionProvisioningState fromString(String name) { return fromString(name, RevisionProvisioningState.class); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RevisionRunningState.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RevisionRunningState.java index 517991e24dc7..d5ec4ea95a50 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RevisionRunningState.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RevisionRunningState.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -57,7 +56,6 @@ public RevisionRunningState() { * @param name a name to look for. * @return the corresponding RevisionRunningState. */ - @JsonCreator public static RevisionRunningState fromString(String name) { return fromString(name, RevisionRunningState.class); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Runtime.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Runtime.java new file mode 100644 index 000000000000..22dc30e0dfea --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Runtime.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.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Container App Runtime configuration. + */ +@Fluent +public final class Runtime implements JsonSerializable { + /* + * Java app configuration + */ + private RuntimeJava java; + + /* + * .NET app configuration + */ + private RuntimeDotnet dotnet; + + /** + * Creates an instance of Runtime class. + */ + public Runtime() { + } + + /** + * Get the java property: Java app configuration. + * + * @return the java value. + */ + public RuntimeJava java() { + return this.java; + } + + /** + * Set the java property: Java app configuration. + * + * @param java the java value to set. + * @return the Runtime object itself. + */ + public Runtime withJava(RuntimeJava java) { + this.java = java; + return this; + } + + /** + * Get the dotnet property: .NET app configuration. + * + * @return the dotnet value. + */ + public RuntimeDotnet dotnet() { + return this.dotnet; + } + + /** + * Set the dotnet property: .NET app configuration. + * + * @param dotnet the dotnet value to set. + * @return the Runtime object itself. + */ + public Runtime withDotnet(RuntimeDotnet dotnet) { + this.dotnet = dotnet; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (java() != null) { + java().validate(); + } + if (dotnet() != null) { + dotnet().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("java", this.java); + jsonWriter.writeJsonField("dotnet", this.dotnet); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Runtime from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Runtime if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Runtime. + */ + public static Runtime fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Runtime deserializedRuntime = new Runtime(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("java".equals(fieldName)) { + deserializedRuntime.java = RuntimeJava.fromJson(reader); + } else if ("dotnet".equals(fieldName)) { + deserializedRuntime.dotnet = RuntimeDotnet.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRuntime; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RuntimeDotnet.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RuntimeDotnet.java new file mode 100644 index 000000000000..7014ac13eed6 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RuntimeDotnet.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.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * .NET app configuration. + */ +@Fluent +public final class RuntimeDotnet implements JsonSerializable { + /* + * Auto configure the ASP.NET Core Data Protection feature + */ + private Boolean autoConfigureDataProtection; + + /** + * Creates an instance of RuntimeDotnet class. + */ + public RuntimeDotnet() { + } + + /** + * Get the autoConfigureDataProtection property: Auto configure the ASP.NET Core Data Protection feature. + * + * @return the autoConfigureDataProtection value. + */ + public Boolean autoConfigureDataProtection() { + return this.autoConfigureDataProtection; + } + + /** + * Set the autoConfigureDataProtection property: Auto configure the ASP.NET Core Data Protection feature. + * + * @param autoConfigureDataProtection the autoConfigureDataProtection value to set. + * @return the RuntimeDotnet object itself. + */ + public RuntimeDotnet withAutoConfigureDataProtection(Boolean autoConfigureDataProtection) { + this.autoConfigureDataProtection = autoConfigureDataProtection; + return this; + } + + /** + * Validates the instance. + * + * @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("autoConfigureDataProtection", this.autoConfigureDataProtection); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RuntimeDotnet from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RuntimeDotnet if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the RuntimeDotnet. + */ + public static RuntimeDotnet fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RuntimeDotnet deserializedRuntimeDotnet = new RuntimeDotnet(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("autoConfigureDataProtection".equals(fieldName)) { + deserializedRuntimeDotnet.autoConfigureDataProtection = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedRuntimeDotnet; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RuntimeJava.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RuntimeJava.java new file mode 100644 index 000000000000..93e9e6efbbd2 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RuntimeJava.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.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Java app configuration. + */ +@Fluent +public final class RuntimeJava implements JsonSerializable { + /* + * Enable jmx core metrics for the java app + */ + private Boolean enableMetrics; + + /* + * Diagnostic capabilities achieved by java agent + */ + private RuntimeJavaAgent javaAgent; + + /** + * Creates an instance of RuntimeJava class. + */ + public RuntimeJava() { + } + + /** + * Get the enableMetrics property: Enable jmx core metrics for the java app. + * + * @return the enableMetrics value. + */ + public Boolean enableMetrics() { + return this.enableMetrics; + } + + /** + * Set the enableMetrics property: Enable jmx core metrics for the java app. + * + * @param enableMetrics the enableMetrics value to set. + * @return the RuntimeJava object itself. + */ + public RuntimeJava withEnableMetrics(Boolean enableMetrics) { + this.enableMetrics = enableMetrics; + return this; + } + + /** + * Get the javaAgent property: Diagnostic capabilities achieved by java agent. + * + * @return the javaAgent value. + */ + public RuntimeJavaAgent javaAgent() { + return this.javaAgent; + } + + /** + * Set the javaAgent property: Diagnostic capabilities achieved by java agent. + * + * @param javaAgent the javaAgent value to set. + * @return the RuntimeJava object itself. + */ + public RuntimeJava withJavaAgent(RuntimeJavaAgent javaAgent) { + this.javaAgent = javaAgent; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (javaAgent() != null) { + javaAgent().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enableMetrics", this.enableMetrics); + jsonWriter.writeJsonField("javaAgent", this.javaAgent); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RuntimeJava from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RuntimeJava if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the RuntimeJava. + */ + public static RuntimeJava fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RuntimeJava deserializedRuntimeJava = new RuntimeJava(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enableMetrics".equals(fieldName)) { + deserializedRuntimeJava.enableMetrics = reader.getNullable(JsonReader::getBoolean); + } else if ("javaAgent".equals(fieldName)) { + deserializedRuntimeJava.javaAgent = RuntimeJavaAgent.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRuntimeJava; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RuntimeJavaAgent.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RuntimeJavaAgent.java new file mode 100644 index 000000000000..4287f43e0134 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RuntimeJavaAgent.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.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Diagnostic capabilities achieved by java agent. + */ +@Fluent +public final class RuntimeJavaAgent implements JsonSerializable { + /* + * Enable java agent injection for the java app. + */ + private Boolean enabled; + + /* + * Capabilities on the java logging scenario. + */ + private RuntimeJavaAgentLogging logging; + + /** + * Creates an instance of RuntimeJavaAgent class. + */ + public RuntimeJavaAgent() { + } + + /** + * Get the enabled property: Enable java agent injection for the java app. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Enable java agent injection for the java app. + * + * @param enabled the enabled value to set. + * @return the RuntimeJavaAgent object itself. + */ + public RuntimeJavaAgent withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the logging property: Capabilities on the java logging scenario. + * + * @return the logging value. + */ + public RuntimeJavaAgentLogging logging() { + return this.logging; + } + + /** + * Set the logging property: Capabilities on the java logging scenario. + * + * @param logging the logging value to set. + * @return the RuntimeJavaAgent object itself. + */ + public RuntimeJavaAgent withLogging(RuntimeJavaAgentLogging logging) { + this.logging = logging; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (logging() != null) { + logging().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeJsonField("logging", this.logging); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RuntimeJavaAgent from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RuntimeJavaAgent if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the RuntimeJavaAgent. + */ + public static RuntimeJavaAgent fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RuntimeJavaAgent deserializedRuntimeJavaAgent = new RuntimeJavaAgent(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedRuntimeJavaAgent.enabled = reader.getNullable(JsonReader::getBoolean); + } else if ("logging".equals(fieldName)) { + deserializedRuntimeJavaAgent.logging = RuntimeJavaAgentLogging.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRuntimeJavaAgent; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RuntimeJavaAgentLogging.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RuntimeJavaAgentLogging.java new file mode 100644 index 000000000000..eeda05ff1b8d --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RuntimeJavaAgentLogging.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.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.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; + +/** + * Capabilities on the java logging scenario. + */ +@Fluent +public final class RuntimeJavaAgentLogging implements JsonSerializable { + /* + * Settings of the logger for the java app. + */ + private List loggerSettings; + + /** + * Creates an instance of RuntimeJavaAgentLogging class. + */ + public RuntimeJavaAgentLogging() { + } + + /** + * Get the loggerSettings property: Settings of the logger for the java app. + * + * @return the loggerSettings value. + */ + public List loggerSettings() { + return this.loggerSettings; + } + + /** + * Set the loggerSettings property: Settings of the logger for the java app. + * + * @param loggerSettings the loggerSettings value to set. + * @return the RuntimeJavaAgentLogging object itself. + */ + public RuntimeJavaAgentLogging withLoggerSettings(List loggerSettings) { + this.loggerSettings = loggerSettings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (loggerSettings() != null) { + loggerSettings().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("loggerSettings", this.loggerSettings, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RuntimeJavaAgentLogging from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RuntimeJavaAgentLogging if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the RuntimeJavaAgentLogging. + */ + public static RuntimeJavaAgentLogging fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RuntimeJavaAgentLogging deserializedRuntimeJavaAgentLogging = new RuntimeJavaAgentLogging(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("loggerSettings".equals(fieldName)) { + List loggerSettings = reader.readArray(reader1 -> LoggerSetting.fromJson(reader1)); + deserializedRuntimeJavaAgentLogging.loggerSettings = loggerSettings; + } else { + reader.skipChildren(); + } + } + + return deserializedRuntimeJavaAgentLogging; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Scale.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Scale.java index 99a5cfe707b4..c60016286de4 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Scale.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Scale.java @@ -5,30 +5,31 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.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; /** * Container App scaling configurations. */ @Fluent -public final class Scale { +public final class Scale implements JsonSerializable { /* * Optional. Minimum number of container replicas. */ - @JsonProperty(value = "minReplicas") private Integer minReplicas; /* * Optional. Maximum number of container replicas. Defaults to 10 if not set. */ - @JsonProperty(value = "maxReplicas") private Integer maxReplicas; /* * Scaling rules. */ - @JsonProperty(value = "rules") private List rules; /** @@ -107,4 +108,47 @@ public void validate() { rules().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("minReplicas", this.minReplicas); + jsonWriter.writeNumberField("maxReplicas", this.maxReplicas); + jsonWriter.writeArrayField("rules", this.rules, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Scale from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Scale if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Scale. + */ + public static Scale fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Scale deserializedScale = new Scale(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("minReplicas".equals(fieldName)) { + deserializedScale.minReplicas = reader.getNullable(JsonReader::getInt); + } else if ("maxReplicas".equals(fieldName)) { + deserializedScale.maxReplicas = reader.getNullable(JsonReader::getInt); + } else if ("rules".equals(fieldName)) { + List rules = reader.readArray(reader1 -> ScaleRule.fromJson(reader1)); + deserializedScale.rules = rules; + } else { + reader.skipChildren(); + } + } + + return deserializedScale; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ScaleConfiguration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ScaleConfiguration.java new file mode 100644 index 000000000000..2450afb2fa28 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ScaleConfiguration.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.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Scale configuration. + */ +@Fluent +public final class ScaleConfiguration implements JsonSerializable { + /* + * The maximum count of sessions at the same time. + */ + private Integer maxConcurrentSessions; + + /* + * The minimum count of ready session instances. + */ + private Integer readySessionInstances; + + /** + * Creates an instance of ScaleConfiguration class. + */ + public ScaleConfiguration() { + } + + /** + * Get the maxConcurrentSessions property: The maximum count of sessions at the same time. + * + * @return the maxConcurrentSessions value. + */ + public Integer maxConcurrentSessions() { + return this.maxConcurrentSessions; + } + + /** + * Set the maxConcurrentSessions property: The maximum count of sessions at the same time. + * + * @param maxConcurrentSessions the maxConcurrentSessions value to set. + * @return the ScaleConfiguration object itself. + */ + public ScaleConfiguration withMaxConcurrentSessions(Integer maxConcurrentSessions) { + this.maxConcurrentSessions = maxConcurrentSessions; + return this; + } + + /** + * Get the readySessionInstances property: The minimum count of ready session instances. + * + * @return the readySessionInstances value. + */ + public Integer readySessionInstances() { + return this.readySessionInstances; + } + + /** + * Set the readySessionInstances property: The minimum count of ready session instances. + * + * @param readySessionInstances the readySessionInstances value to set. + * @return the ScaleConfiguration object itself. + */ + public ScaleConfiguration withReadySessionInstances(Integer readySessionInstances) { + this.readySessionInstances = readySessionInstances; + return this; + } + + /** + * Validates the instance. + * + * @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("maxConcurrentSessions", this.maxConcurrentSessions); + jsonWriter.writeNumberField("readySessionInstances", this.readySessionInstances); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ScaleConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ScaleConfiguration if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ScaleConfiguration. + */ + public static ScaleConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ScaleConfiguration deserializedScaleConfiguration = new ScaleConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("maxConcurrentSessions".equals(fieldName)) { + deserializedScaleConfiguration.maxConcurrentSessions = reader.getNullable(JsonReader::getInt); + } else if ("readySessionInstances".equals(fieldName)) { + deserializedScaleConfiguration.readySessionInstances = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedScaleConfiguration; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ScaleRule.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ScaleRule.java index 84dbae8b7efc..1600f1fe5965 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ScaleRule.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ScaleRule.java @@ -5,41 +5,40 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Container App container scaling rule. */ @Fluent -public final class ScaleRule { +public final class ScaleRule implements JsonSerializable { /* * Scale Rule Name */ - @JsonProperty(value = "name") private String name; /* * Azure Queue based scaling. */ - @JsonProperty(value = "azureQueue") private QueueScaleRule azureQueue; /* * Custom scale rule. */ - @JsonProperty(value = "custom") private CustomScaleRule custom; /* * HTTP requests based scaling. */ - @JsonProperty(value = "http") private HttpScaleRule http; /* * Tcp requests based scaling. */ - @JsonProperty(value = "tcp") private TcpScaleRule tcp; /** @@ -167,4 +166,52 @@ public void validate() { tcp().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeJsonField("azureQueue", this.azureQueue); + jsonWriter.writeJsonField("custom", this.custom); + jsonWriter.writeJsonField("http", this.http); + jsonWriter.writeJsonField("tcp", this.tcp); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ScaleRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ScaleRule if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the ScaleRule. + */ + public static ScaleRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ScaleRule deserializedScaleRule = new ScaleRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedScaleRule.name = reader.getString(); + } else if ("azureQueue".equals(fieldName)) { + deserializedScaleRule.azureQueue = QueueScaleRule.fromJson(reader); + } else if ("custom".equals(fieldName)) { + deserializedScaleRule.custom = CustomScaleRule.fromJson(reader); + } else if ("http".equals(fieldName)) { + deserializedScaleRule.http = HttpScaleRule.fromJson(reader); + } else if ("tcp".equals(fieldName)) { + deserializedScaleRule.tcp = TcpScaleRule.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedScaleRule; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ScaleRuleAuth.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ScaleRuleAuth.java index d957279f9c95..484986dbf8e0 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ScaleRuleAuth.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ScaleRuleAuth.java @@ -5,23 +5,25 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Auth Secrets for Scale Rule. */ @Fluent -public final class ScaleRuleAuth { +public final class ScaleRuleAuth implements JsonSerializable { /* * Name of the secret from which to pull the auth params. */ - @JsonProperty(value = "secretRef") private String secretRef; /* * Trigger Parameter that uses the secret */ - @JsonProperty(value = "triggerParameter") private String triggerParameter; /** @@ -77,4 +79,43 @@ public ScaleRuleAuth withTriggerParameter(String triggerParameter) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("secretRef", this.secretRef); + jsonWriter.writeStringField("triggerParameter", this.triggerParameter); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ScaleRuleAuth from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ScaleRuleAuth if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ScaleRuleAuth. + */ + public static ScaleRuleAuth fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ScaleRuleAuth deserializedScaleRuleAuth = new ScaleRuleAuth(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("secretRef".equals(fieldName)) { + deserializedScaleRuleAuth.secretRef = reader.getString(); + } else if ("triggerParameter".equals(fieldName)) { + deserializedScaleRuleAuth.triggerParameter = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedScaleRuleAuth; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Scheme.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Scheme.java index 84f4c144aa00..7e5db52178ca 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Scheme.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Scheme.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public Scheme() { * @param name a name to look for. * @return the corresponding Scheme. */ - @JsonCreator public static Scheme fromString(String name) { return fromString(name, Scheme.class); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Secret.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Secret.java index 984042a638af..34838a2bb6e5 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Secret.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Secret.java @@ -5,36 +5,36 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Secret definition. */ @Fluent -public final class Secret { +public final class Secret implements JsonSerializable { /* * Secret Name. */ - @JsonProperty(value = "name") private String name; /* * Secret Value. */ - @JsonProperty(value = "value") private String value; /* * Resource ID of a managed identity to authenticate with Azure Key Vault, or System to use a system-assigned * identity. */ - @JsonProperty(value = "identity") private String identity; /* * Azure Key Vault URL pointing to the secret referenced by the container app. */ - @JsonProperty(value = "keyVaultUrl") private String keyVaultUrl; /** @@ -132,4 +132,49 @@ public Secret withKeyVaultUrl(String keyVaultUrl) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("value", this.value); + jsonWriter.writeStringField("identity", this.identity); + jsonWriter.writeStringField("keyVaultUrl", this.keyVaultUrl); + 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 ("value".equals(fieldName)) { + deserializedSecret.value = reader.getString(); + } else if ("identity".equals(fieldName)) { + deserializedSecret.identity = reader.getString(); + } else if ("keyVaultUrl".equals(fieldName)) { + deserializedSecret.keyVaultUrl = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSecret; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SecretVolumeItem.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SecretVolumeItem.java index 55d91e2015a8..c1bc22b58433 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SecretVolumeItem.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SecretVolumeItem.java @@ -5,23 +5,25 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Secret to be added to volume. */ @Fluent -public final class SecretVolumeItem { +public final class SecretVolumeItem implements JsonSerializable { /* * Name of the Container App secret from which to pull the secret value. */ - @JsonProperty(value = "secretRef") private String secretRef; /* * Path to project secret to. If no path is provided, path defaults to name of secret listed in secretRef. */ - @JsonProperty(value = "path") private String path; /** @@ -79,4 +81,43 @@ public SecretVolumeItem withPath(String path) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("secretRef", this.secretRef); + jsonWriter.writeStringField("path", this.path); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecretVolumeItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecretVolumeItem if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SecretVolumeItem. + */ + public static SecretVolumeItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecretVolumeItem deserializedSecretVolumeItem = new SecretVolumeItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("secretRef".equals(fieldName)) { + deserializedSecretVolumeItem.secretRef = reader.getString(); + } else if ("path".equals(fieldName)) { + deserializedSecretVolumeItem.path = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSecretVolumeItem; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Service.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Service.java index af26a69c5fe2..df27e5741c47 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Service.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Service.java @@ -6,17 +6,20 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Container App to be a dev service. */ @Fluent -public final class Service { +public final class Service implements JsonSerializable { /* * Dev ContainerApp service type */ - @JsonProperty(value = "type", required = true) private String type; /** @@ -52,10 +55,46 @@ public Service withType(String type) { */ public void validate() { if (type() == null) { - throw LOGGER - .logExceptionAsError(new IllegalArgumentException("Missing required property type in model Service")); + throw LOGGER.atError().log(new IllegalArgumentException("Missing required property type in model Service")); } } private static final ClientLogger LOGGER = new ClientLogger(Service.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Service from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Service 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 Service. + */ + public static Service fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Service deserializedService = new Service(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedService.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedService; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ServiceBind.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ServiceBind.java index f78914381442..07493cbd84d3 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ServiceBind.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ServiceBind.java @@ -5,38 +5,36 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.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; /** * Configuration to bind a ContainerApp to a dev ContainerApp Service. */ @Fluent -public final class ServiceBind { +public final class ServiceBind implements JsonSerializable { /* * Resource id of the target service */ - @JsonProperty(value = "serviceId") private String serviceId; /* * Name of the service bind */ - @JsonProperty(value = "name") private String name; /* * Type of the client to be used to connect to the service */ - @JsonProperty(value = "clientType") private String clientType; /* * Customized keys for customizing injected values to the app */ - @JsonProperty(value = "customizedKeys") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map customizedKeys; /** @@ -132,4 +130,51 @@ public ServiceBind withCustomizedKeys(Map customizedKeys) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("serviceId", this.serviceId); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("clientType", this.clientType); + jsonWriter.writeMapField("customizedKeys", this.customizedKeys, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServiceBind from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServiceBind if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ServiceBind. + */ + public static ServiceBind fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServiceBind deserializedServiceBind = new ServiceBind(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("serviceId".equals(fieldName)) { + deserializedServiceBind.serviceId = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedServiceBind.name = reader.getString(); + } else if ("clientType".equals(fieldName)) { + deserializedServiceBind.clientType = reader.getString(); + } else if ("customizedKeys".equals(fieldName)) { + Map customizedKeys = reader.readMap(reader1 -> reader1.getString()); + deserializedServiceBind.customizedKeys = customizedKeys; + } else { + reader.skipChildren(); + } + } + + return deserializedServiceBind; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionContainer.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionContainer.java new file mode 100644 index 000000000000..f762c588cbc3 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionContainer.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.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.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; + +/** + * Container definitions for the sessions of the session pool. + */ +@Fluent +public final class SessionContainer implements JsonSerializable { + /* + * Container image tag. + */ + private String image; + + /* + * Custom container name. + */ + private String name; + + /* + * Container start command. + */ + private List command; + + /* + * Container start command arguments. + */ + private List args; + + /* + * Container environment variables. + */ + private List env; + + /* + * Container resource requirements. + */ + private SessionContainerResources resources; + + /** + * Creates an instance of SessionContainer class. + */ + public SessionContainer() { + } + + /** + * Get the image property: Container image tag. + * + * @return the image value. + */ + public String image() { + return this.image; + } + + /** + * Set the image property: Container image tag. + * + * @param image the image value to set. + * @return the SessionContainer object itself. + */ + public SessionContainer withImage(String image) { + this.image = image; + return this; + } + + /** + * Get the name property: Custom container name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Custom container name. + * + * @param name the name value to set. + * @return the SessionContainer object itself. + */ + public SessionContainer withName(String name) { + this.name = name; + return this; + } + + /** + * Get the command property: Container start command. + * + * @return the command value. + */ + public List command() { + return this.command; + } + + /** + * Set the command property: Container start command. + * + * @param command the command value to set. + * @return the SessionContainer object itself. + */ + public SessionContainer withCommand(List command) { + this.command = command; + return this; + } + + /** + * Get the args property: Container start command arguments. + * + * @return the args value. + */ + public List args() { + return this.args; + } + + /** + * Set the args property: Container start command arguments. + * + * @param args the args value to set. + * @return the SessionContainer object itself. + */ + public SessionContainer withArgs(List args) { + this.args = args; + return this; + } + + /** + * Get the env property: Container environment variables. + * + * @return the env value. + */ + public List env() { + return this.env; + } + + /** + * Set the env property: Container environment variables. + * + * @param env the env value to set. + * @return the SessionContainer object itself. + */ + public SessionContainer withEnv(List env) { + this.env = env; + return this; + } + + /** + * Get the resources property: Container resource requirements. + * + * @return the resources value. + */ + public SessionContainerResources resources() { + return this.resources; + } + + /** + * Set the resources property: Container resource requirements. + * + * @param resources the resources value to set. + * @return the SessionContainer object itself. + */ + public SessionContainer withResources(SessionContainerResources resources) { + this.resources = resources; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (env() != null) { + env().forEach(e -> e.validate()); + } + if (resources() != null) { + resources().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("image", this.image); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeArrayField("command", this.command, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("args", this.args, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("env", this.env, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("resources", this.resources); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SessionContainer from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SessionContainer if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SessionContainer. + */ + public static SessionContainer fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SessionContainer deserializedSessionContainer = new SessionContainer(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("image".equals(fieldName)) { + deserializedSessionContainer.image = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedSessionContainer.name = reader.getString(); + } else if ("command".equals(fieldName)) { + List command = reader.readArray(reader1 -> reader1.getString()); + deserializedSessionContainer.command = command; + } else if ("args".equals(fieldName)) { + List args = reader.readArray(reader1 -> reader1.getString()); + deserializedSessionContainer.args = args; + } else if ("env".equals(fieldName)) { + List env = reader.readArray(reader1 -> EnvironmentVar.fromJson(reader1)); + deserializedSessionContainer.env = env; + } else if ("resources".equals(fieldName)) { + deserializedSessionContainer.resources = SessionContainerResources.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSessionContainer; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionContainerResources.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionContainerResources.java new file mode 100644 index 000000000000..3a8dc5ac072f --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionContainerResources.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.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Container resource requirements for sessions of the session pool. + */ +@Fluent +public final class SessionContainerResources implements JsonSerializable { + /* + * Required CPU in cores, e.g. 0.5 + */ + private Double cpu; + + /* + * Required memory, e.g. "250Mb" + */ + private String memory; + + /** + * Creates an instance of SessionContainerResources class. + */ + public SessionContainerResources() { + } + + /** + * Get the cpu property: Required CPU in cores, e.g. 0.5. + * + * @return the cpu value. + */ + public Double cpu() { + return this.cpu; + } + + /** + * Set the cpu property: Required CPU in cores, e.g. 0.5. + * + * @param cpu the cpu value to set. + * @return the SessionContainerResources object itself. + */ + public SessionContainerResources withCpu(Double cpu) { + this.cpu = cpu; + return this; + } + + /** + * Get the memory property: Required memory, e.g. "250Mb". + * + * @return the memory value. + */ + public String memory() { + return this.memory; + } + + /** + * Set the memory property: Required memory, e.g. "250Mb". + * + * @param memory the memory value to set. + * @return the SessionContainerResources object itself. + */ + public SessionContainerResources withMemory(String memory) { + this.memory = memory; + return this; + } + + /** + * Validates the instance. + * + * @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("cpu", this.cpu); + jsonWriter.writeStringField("memory", this.memory); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SessionContainerResources from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SessionContainerResources if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SessionContainerResources. + */ + public static SessionContainerResources fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SessionContainerResources deserializedSessionContainerResources = new SessionContainerResources(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("cpu".equals(fieldName)) { + deserializedSessionContainerResources.cpu = reader.getNullable(JsonReader::getDouble); + } else if ("memory".equals(fieldName)) { + deserializedSessionContainerResources.memory = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSessionContainerResources; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionIngress.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionIngress.java new file mode 100644 index 000000000000..59b318068c96 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionIngress.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.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Session pool ingress configuration. + */ +@Fluent +public final class SessionIngress implements JsonSerializable { + /* + * Target port in containers for traffic from ingress + */ + private Integer targetPort; + + /** + * Creates an instance of SessionIngress class. + */ + public SessionIngress() { + } + + /** + * Get the targetPort property: Target port in containers for traffic from ingress. + * + * @return the targetPort value. + */ + public Integer targetPort() { + return this.targetPort; + } + + /** + * Set the targetPort property: Target port in containers for traffic from ingress. + * + * @param targetPort the targetPort value to set. + * @return the SessionIngress object itself. + */ + public SessionIngress withTargetPort(Integer targetPort) { + this.targetPort = targetPort; + return this; + } + + /** + * Validates the instance. + * + * @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("targetPort", this.targetPort); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SessionIngress from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SessionIngress if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SessionIngress. + */ + public static SessionIngress fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SessionIngress deserializedSessionIngress = new SessionIngress(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("targetPort".equals(fieldName)) { + deserializedSessionIngress.targetPort = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedSessionIngress; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionNetworkConfiguration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionNetworkConfiguration.java new file mode 100644 index 000000000000..36279a48ba12 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionNetworkConfiguration.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.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Session network configuration. + */ +@Fluent +public final class SessionNetworkConfiguration implements JsonSerializable { + /* + * Network status for the sessions. + */ + private SessionNetworkStatus status; + + /** + * Creates an instance of SessionNetworkConfiguration class. + */ + public SessionNetworkConfiguration() { + } + + /** + * Get the status property: Network status for the sessions. + * + * @return the status value. + */ + public SessionNetworkStatus status() { + return this.status; + } + + /** + * Set the status property: Network status for the sessions. + * + * @param status the status value to set. + * @return the SessionNetworkConfiguration object itself. + */ + public SessionNetworkConfiguration withStatus(SessionNetworkStatus 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 SessionNetworkConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SessionNetworkConfiguration if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SessionNetworkConfiguration. + */ + public static SessionNetworkConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SessionNetworkConfiguration deserializedSessionNetworkConfiguration = new SessionNetworkConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedSessionNetworkConfiguration.status + = SessionNetworkStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSessionNetworkConfiguration; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionNetworkStatus.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionNetworkStatus.java new file mode 100644 index 000000000000..e6e7e6b37e90 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionNetworkStatus.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.appcontainers.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Network status for the sessions. + */ +public final class SessionNetworkStatus extends ExpandableStringEnum { + /** + * Static value EgressEnabled for SessionNetworkStatus. + */ + public static final SessionNetworkStatus EGRESS_ENABLED = fromString("EgressEnabled"); + + /** + * Static value EgressDisabled for SessionNetworkStatus. + */ + public static final SessionNetworkStatus EGRESS_DISABLED = fromString("EgressDisabled"); + + /** + * Creates a new instance of SessionNetworkStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SessionNetworkStatus() { + } + + /** + * Creates or finds a SessionNetworkStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding SessionNetworkStatus. + */ + public static SessionNetworkStatus fromString(String name) { + return fromString(name, SessionNetworkStatus.class); + } + + /** + * Gets known SessionNetworkStatus values. + * + * @return known SessionNetworkStatus values. + */ + public static Collection values() { + return values(SessionNetworkStatus.class); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionPool.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionPool.java new file mode 100644 index 000000000000..563164248f5c --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionPool.java @@ -0,0 +1,481 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appcontainers.fluent.models.SessionPoolInner; +import java.util.List; +import java.util.Map; + +/** + * An immutable client-side representation of SessionPool. + */ +public interface SessionPool { + /** + * 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 systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the environmentId property: Resource ID of the session pool's environment. + * + * @return the environmentId value. + */ + String environmentId(); + + /** + * Gets the containerType property: The container type of the sessions. + * + * @return the containerType value. + */ + ContainerType containerType(); + + /** + * Gets the poolManagementType property: The pool management type of the session pool. + * + * @return the poolManagementType value. + */ + PoolManagementType poolManagementType(); + + /** + * Gets the nodeCount property: The number of nodes the session pool is using. + * + * @return the nodeCount value. + */ + Integer nodeCount(); + + /** + * Gets the scaleConfiguration property: The scale configuration of the session pool. + * + * @return the scaleConfiguration value. + */ + ScaleConfiguration scaleConfiguration(); + + /** + * Gets the secrets property: The secrets of the session pool. + * + * @return the secrets value. + */ + List secrets(); + + /** + * Gets the dynamicPoolConfiguration property: The pool configuration if the poolManagementType is dynamic. + * + * @return the dynamicPoolConfiguration value. + */ + DynamicPoolConfiguration dynamicPoolConfiguration(); + + /** + * Gets the customContainerTemplate property: The custom container configuration if the containerType is + * CustomContainer. + * + * @return the customContainerTemplate value. + */ + CustomContainerTemplate customContainerTemplate(); + + /** + * Gets the sessionNetworkConfiguration property: The network configuration of the sessions in the session pool. + * + * @return the sessionNetworkConfiguration value. + */ + SessionNetworkConfiguration sessionNetworkConfiguration(); + + /** + * Gets the poolManagementEndpoint property: The endpoint to manage the pool. + * + * @return the poolManagementEndpoint value. + */ + String poolManagementEndpoint(); + + /** + * Gets the provisioningState property: Provisioning state of the session pool. + * + * @return the provisioningState value. + */ + SessionPoolProvisioningState provisioningState(); + + /** + * 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.appcontainers.fluent.models.SessionPoolInner object. + * + * @return the inner object. + */ + SessionPoolInner innerModel(); + + /** + * The entirety of the SessionPool definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The SessionPool definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the SessionPool definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the SessionPool 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 SessionPool 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 SessionPool 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.WithEnvironmentId, DefinitionStages.WithContainerType, + DefinitionStages.WithPoolManagementType, DefinitionStages.WithScaleConfiguration, + DefinitionStages.WithSecrets, DefinitionStages.WithDynamicPoolConfiguration, + DefinitionStages.WithCustomContainerTemplate, DefinitionStages.WithSessionNetworkConfiguration { + /** + * Executes the create request. + * + * @return the created resource. + */ + SessionPool create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SessionPool create(Context context); + } + + /** + * The stage of the SessionPool 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 SessionPool definition allowing to specify environmentId. + */ + interface WithEnvironmentId { + /** + * Specifies the environmentId property: Resource ID of the session pool's environment.. + * + * @param environmentId Resource ID of the session pool's environment. + * @return the next definition stage. + */ + WithCreate withEnvironmentId(String environmentId); + } + + /** + * The stage of the SessionPool definition allowing to specify containerType. + */ + interface WithContainerType { + /** + * Specifies the containerType property: The container type of the sessions.. + * + * @param containerType The container type of the sessions. + * @return the next definition stage. + */ + WithCreate withContainerType(ContainerType containerType); + } + + /** + * The stage of the SessionPool definition allowing to specify poolManagementType. + */ + interface WithPoolManagementType { + /** + * Specifies the poolManagementType property: The pool management type of the session pool.. + * + * @param poolManagementType The pool management type of the session pool. + * @return the next definition stage. + */ + WithCreate withPoolManagementType(PoolManagementType poolManagementType); + } + + /** + * The stage of the SessionPool definition allowing to specify scaleConfiguration. + */ + interface WithScaleConfiguration { + /** + * Specifies the scaleConfiguration property: The scale configuration of the session pool.. + * + * @param scaleConfiguration The scale configuration of the session pool. + * @return the next definition stage. + */ + WithCreate withScaleConfiguration(ScaleConfiguration scaleConfiguration); + } + + /** + * The stage of the SessionPool definition allowing to specify secrets. + */ + interface WithSecrets { + /** + * Specifies the secrets property: The secrets of the session pool.. + * + * @param secrets The secrets of the session pool. + * @return the next definition stage. + */ + WithCreate withSecrets(List secrets); + } + + /** + * The stage of the SessionPool definition allowing to specify dynamicPoolConfiguration. + */ + interface WithDynamicPoolConfiguration { + /** + * Specifies the dynamicPoolConfiguration property: The pool configuration if the poolManagementType is + * dynamic.. + * + * @param dynamicPoolConfiguration The pool configuration if the poolManagementType is dynamic. + * @return the next definition stage. + */ + WithCreate withDynamicPoolConfiguration(DynamicPoolConfiguration dynamicPoolConfiguration); + } + + /** + * The stage of the SessionPool definition allowing to specify customContainerTemplate. + */ + interface WithCustomContainerTemplate { + /** + * Specifies the customContainerTemplate property: The custom container configuration if the containerType + * is CustomContainer.. + * + * @param customContainerTemplate The custom container configuration if the containerType is + * CustomContainer. + * @return the next definition stage. + */ + WithCreate withCustomContainerTemplate(CustomContainerTemplate customContainerTemplate); + } + + /** + * The stage of the SessionPool definition allowing to specify sessionNetworkConfiguration. + */ + interface WithSessionNetworkConfiguration { + /** + * Specifies the sessionNetworkConfiguration property: The network configuration of the sessions in the + * session pool.. + * + * @param sessionNetworkConfiguration The network configuration of the sessions in the session pool. + * @return the next definition stage. + */ + WithCreate withSessionNetworkConfiguration(SessionNetworkConfiguration sessionNetworkConfiguration); + } + } + + /** + * Begins update for the SessionPool resource. + * + * @return the stage of resource update. + */ + SessionPool.Update update(); + + /** + * The template for SessionPool update. + */ + interface Update extends UpdateStages.WithScaleConfiguration, UpdateStages.WithSecrets, + UpdateStages.WithDynamicPoolConfiguration, UpdateStages.WithCustomContainerTemplate, + UpdateStages.WithSessionNetworkConfiguration { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SessionPool apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SessionPool apply(Context context); + } + + /** + * The SessionPool update stages. + */ + interface UpdateStages { + /** + * The stage of the SessionPool update allowing to specify scaleConfiguration. + */ + interface WithScaleConfiguration { + /** + * Specifies the scaleConfiguration property: The scale configuration of the session pool.. + * + * @param scaleConfiguration The scale configuration of the session pool. + * @return the next definition stage. + */ + Update withScaleConfiguration(ScaleConfiguration scaleConfiguration); + } + + /** + * The stage of the SessionPool update allowing to specify secrets. + */ + interface WithSecrets { + /** + * Specifies the secrets property: The secrets of the session pool.. + * + * @param secrets The secrets of the session pool. + * @return the next definition stage. + */ + Update withSecrets(List secrets); + } + + /** + * The stage of the SessionPool update allowing to specify dynamicPoolConfiguration. + */ + interface WithDynamicPoolConfiguration { + /** + * Specifies the dynamicPoolConfiguration property: The pool configuration if the poolManagementType is + * dynamic.. + * + * @param dynamicPoolConfiguration The pool configuration if the poolManagementType is dynamic. + * @return the next definition stage. + */ + Update withDynamicPoolConfiguration(DynamicPoolConfiguration dynamicPoolConfiguration); + } + + /** + * The stage of the SessionPool update allowing to specify customContainerTemplate. + */ + interface WithCustomContainerTemplate { + /** + * Specifies the customContainerTemplate property: The custom container configuration if the containerType + * is CustomContainer.. + * + * @param customContainerTemplate The custom container configuration if the containerType is + * CustomContainer. + * @return the next definition stage. + */ + Update withCustomContainerTemplate(CustomContainerTemplate customContainerTemplate); + } + + /** + * The stage of the SessionPool update allowing to specify sessionNetworkConfiguration. + */ + interface WithSessionNetworkConfiguration { + /** + * Specifies the sessionNetworkConfiguration property: The network configuration of the sessions in the + * session pool.. + * + * @param sessionNetworkConfiguration The network configuration of the sessions in the session pool. + * @return the next definition stage. + */ + Update withSessionNetworkConfiguration(SessionNetworkConfiguration sessionNetworkConfiguration); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SessionPool refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SessionPool refresh(Context context); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionPoolCollection.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionPoolCollection.java new file mode 100644 index 000000000000..17bf43464241 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionPoolCollection.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.appcontainers.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.appcontainers.fluent.models.SessionPoolInner; +import java.io.IOException; +import java.util.List; + +/** + * Session pool collection Azure resource. + */ +@Fluent +public final class SessionPoolCollection implements JsonSerializable { + /* + * Collection of resources. + */ + private List value; + + /* + * Link to next page of resources. + */ + private String nextLink; + + /** + * Creates an instance of SessionPoolCollection class. + */ + public SessionPoolCollection() { + } + + /** + * Get the value property: Collection of resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of resources. + * + * @param value the value value to set. + * @return the SessionPoolCollection object itself. + */ + public SessionPoolCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to next page of resources. + * + * @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) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model SessionPoolCollection")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SessionPoolCollection.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SessionPoolCollection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SessionPoolCollection 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 SessionPoolCollection. + */ + public static SessionPoolCollection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SessionPoolCollection deserializedSessionPoolCollection = new SessionPoolCollection(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> SessionPoolInner.fromJson(reader1)); + deserializedSessionPoolCollection.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedSessionPoolCollection.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSessionPoolCollection; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionPoolProvisioningState.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionPoolProvisioningState.java new file mode 100644 index 000000000000..8b4fd83bbc76 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionPoolProvisioningState.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.appcontainers.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Provisioning state of the session pool. + */ +public final class SessionPoolProvisioningState extends ExpandableStringEnum { + /** + * Static value InProgress for SessionPoolProvisioningState. + */ + public static final SessionPoolProvisioningState IN_PROGRESS = fromString("InProgress"); + + /** + * Static value Succeeded for SessionPoolProvisioningState. + */ + public static final SessionPoolProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Static value Failed for SessionPoolProvisioningState. + */ + public static final SessionPoolProvisioningState FAILED = fromString("Failed"); + + /** + * Static value Canceled for SessionPoolProvisioningState. + */ + public static final SessionPoolProvisioningState CANCELED = fromString("Canceled"); + + /** + * Static value Deleting for SessionPoolProvisioningState. + */ + public static final SessionPoolProvisioningState DELETING = fromString("Deleting"); + + /** + * Creates a new instance of SessionPoolProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SessionPoolProvisioningState() { + } + + /** + * Creates or finds a SessionPoolProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding SessionPoolProvisioningState. + */ + public static SessionPoolProvisioningState fromString(String name) { + return fromString(name, SessionPoolProvisioningState.class); + } + + /** + * Gets known SessionPoolProvisioningState values. + * + * @return known SessionPoolProvisioningState values. + */ + public static Collection values() { + return values(SessionPoolProvisioningState.class); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionPoolSecret.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionPoolSecret.java new file mode 100644 index 000000000000..4d80150f7cf5 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionPoolSecret.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.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Secret definition. + */ +@Fluent +public final class SessionPoolSecret implements JsonSerializable { + /* + * Secret Name. + */ + private String name; + + /* + * Secret Value. + */ + private String value; + + /** + * Creates an instance of SessionPoolSecret class. + */ + public SessionPoolSecret() { + } + + /** + * Get the name property: Secret Name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Secret Name. + * + * @param name the name value to set. + * @return the SessionPoolSecret object itself. + */ + public SessionPoolSecret withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value property: Secret Value. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: Secret Value. + * + * @param value the value value to set. + * @return the SessionPoolSecret object itself. + */ + public SessionPoolSecret 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 SessionPoolSecret from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SessionPoolSecret if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SessionPoolSecret. + */ + public static SessionPoolSecret fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SessionPoolSecret deserializedSessionPoolSecret = new SessionPoolSecret(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedSessionPoolSecret.name = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedSessionPoolSecret.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSessionPoolSecret; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionPoolUpdatableProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionPoolUpdatableProperties.java new file mode 100644 index 000000000000..de08b47b1586 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionPoolUpdatableProperties.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.appcontainers.models; + +import com.azure.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.appcontainers.fluent.models.SessionPoolUpdatablePropertiesProperties; +import java.io.IOException; +import java.util.List; + +/** + * Container App session pool updatable properties. + */ +@Fluent +public final class SessionPoolUpdatableProperties implements JsonSerializable { + /* + * Session pool resource specific updatable properties. + */ + private SessionPoolUpdatablePropertiesProperties innerProperties; + + /** + * Creates an instance of SessionPoolUpdatableProperties class. + */ + public SessionPoolUpdatableProperties() { + } + + /** + * Get the innerProperties property: Session pool resource specific updatable properties. + * + * @return the innerProperties value. + */ + private SessionPoolUpdatablePropertiesProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the scaleConfiguration property: The scale configuration of the session pool. + * + * @return the scaleConfiguration value. + */ + public ScaleConfiguration scaleConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().scaleConfiguration(); + } + + /** + * Set the scaleConfiguration property: The scale configuration of the session pool. + * + * @param scaleConfiguration the scaleConfiguration value to set. + * @return the SessionPoolUpdatableProperties object itself. + */ + public SessionPoolUpdatableProperties withScaleConfiguration(ScaleConfiguration scaleConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new SessionPoolUpdatablePropertiesProperties(); + } + this.innerProperties().withScaleConfiguration(scaleConfiguration); + return this; + } + + /** + * Get the secrets property: The secrets of the session pool. + * + * @return the secrets value. + */ + public List secrets() { + return this.innerProperties() == null ? null : this.innerProperties().secrets(); + } + + /** + * Set the secrets property: The secrets of the session pool. + * + * @param secrets the secrets value to set. + * @return the SessionPoolUpdatableProperties object itself. + */ + public SessionPoolUpdatableProperties withSecrets(List secrets) { + if (this.innerProperties() == null) { + this.innerProperties = new SessionPoolUpdatablePropertiesProperties(); + } + this.innerProperties().withSecrets(secrets); + return this; + } + + /** + * Get the dynamicPoolConfiguration property: The pool configuration if the poolManagementType is dynamic. + * + * @return the dynamicPoolConfiguration value. + */ + public DynamicPoolConfiguration dynamicPoolConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().dynamicPoolConfiguration(); + } + + /** + * Set the dynamicPoolConfiguration property: The pool configuration if the poolManagementType is dynamic. + * + * @param dynamicPoolConfiguration the dynamicPoolConfiguration value to set. + * @return the SessionPoolUpdatableProperties object itself. + */ + public SessionPoolUpdatableProperties + withDynamicPoolConfiguration(DynamicPoolConfiguration dynamicPoolConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new SessionPoolUpdatablePropertiesProperties(); + } + this.innerProperties().withDynamicPoolConfiguration(dynamicPoolConfiguration); + return this; + } + + /** + * Get the customContainerTemplate property: The custom container configuration if the containerType is + * CustomContainer. + * + * @return the customContainerTemplate value. + */ + public CustomContainerTemplate customContainerTemplate() { + return this.innerProperties() == null ? null : this.innerProperties().customContainerTemplate(); + } + + /** + * Set the customContainerTemplate property: The custom container configuration if the containerType is + * CustomContainer. + * + * @param customContainerTemplate the customContainerTemplate value to set. + * @return the SessionPoolUpdatableProperties object itself. + */ + public SessionPoolUpdatableProperties withCustomContainerTemplate(CustomContainerTemplate customContainerTemplate) { + if (this.innerProperties() == null) { + this.innerProperties = new SessionPoolUpdatablePropertiesProperties(); + } + this.innerProperties().withCustomContainerTemplate(customContainerTemplate); + return this; + } + + /** + * Get the sessionNetworkConfiguration property: The network configuration of the sessions in the session pool. + * + * @return the sessionNetworkConfiguration value. + */ + public SessionNetworkConfiguration sessionNetworkConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().sessionNetworkConfiguration(); + } + + /** + * Set the sessionNetworkConfiguration property: The network configuration of the sessions in the session pool. + * + * @param sessionNetworkConfiguration the sessionNetworkConfiguration value to set. + * @return the SessionPoolUpdatableProperties object itself. + */ + public SessionPoolUpdatableProperties + withSessionNetworkConfiguration(SessionNetworkConfiguration sessionNetworkConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new SessionPoolUpdatablePropertiesProperties(); + } + this.innerProperties().withSessionNetworkConfiguration(sessionNetworkConfiguration); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SessionPoolUpdatableProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SessionPoolUpdatableProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SessionPoolUpdatableProperties. + */ + public static SessionPoolUpdatableProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SessionPoolUpdatableProperties deserializedSessionPoolUpdatableProperties + = new SessionPoolUpdatableProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedSessionPoolUpdatableProperties.innerProperties + = SessionPoolUpdatablePropertiesProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSessionPoolUpdatableProperties; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionRegistryCredentials.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionRegistryCredentials.java new file mode 100644 index 000000000000..8284b71e8d32 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionRegistryCredentials.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.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Session pool private registry credentials. + */ +@Fluent +public final class SessionRegistryCredentials implements JsonSerializable { + /* + * Container registry server. + */ + private String registryServer; + + /* + * Container registry username. + */ + private String username; + + /* + * The name of the secret that contains the registry login password + */ + private String passwordSecretRef; + + /** + * Creates an instance of SessionRegistryCredentials class. + */ + public SessionRegistryCredentials() { + } + + /** + * Get the registryServer property: Container registry server. + * + * @return the registryServer value. + */ + public String registryServer() { + return this.registryServer; + } + + /** + * Set the registryServer property: Container registry server. + * + * @param registryServer the registryServer value to set. + * @return the SessionRegistryCredentials object itself. + */ + public SessionRegistryCredentials withRegistryServer(String registryServer) { + this.registryServer = registryServer; + return this; + } + + /** + * Get the username property: Container registry username. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Set the username property: Container registry username. + * + * @param username the username value to set. + * @return the SessionRegistryCredentials object itself. + */ + public SessionRegistryCredentials withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the passwordSecretRef property: The name of the secret that contains the registry login password. + * + * @return the passwordSecretRef value. + */ + public String passwordSecretRef() { + return this.passwordSecretRef; + } + + /** + * Set the passwordSecretRef property: The name of the secret that contains the registry login password. + * + * @param passwordSecretRef the passwordSecretRef value to set. + * @return the SessionRegistryCredentials object itself. + */ + public SessionRegistryCredentials withPasswordSecretRef(String passwordSecretRef) { + this.passwordSecretRef = passwordSecretRef; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("registryServer", this.registryServer); + jsonWriter.writeStringField("username", this.username); + jsonWriter.writeStringField("passwordSecretRef", this.passwordSecretRef); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SessionRegistryCredentials from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SessionRegistryCredentials if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SessionRegistryCredentials. + */ + public static SessionRegistryCredentials fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SessionRegistryCredentials deserializedSessionRegistryCredentials = new SessionRegistryCredentials(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("registryServer".equals(fieldName)) { + deserializedSessionRegistryCredentials.registryServer = reader.getString(); + } else if ("username".equals(fieldName)) { + deserializedSessionRegistryCredentials.username = reader.getString(); + } else if ("passwordSecretRef".equals(fieldName)) { + deserializedSessionRegistryCredentials.passwordSecretRef = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSessionRegistryCredentials; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SmbStorage.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SmbStorage.java new file mode 100644 index 000000000000..c5667f1d4fb2 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SmbStorage.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.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * SMB storage properties. + */ +@Fluent +public final class SmbStorage implements JsonSerializable { + /* + * The host name or IP address of the SMB server. + */ + private String host; + + /* + * The path to the SMB shared folder. + */ + private String shareName; + + /* + * The user to log on to the SMB server. + */ + private String username; + + /* + * The domain name for the user. + */ + private String domain; + + /* + * The password for the user. + */ + private String password; + + /* + * Access mode for storage + */ + private AccessMode accessMode; + + /** + * Creates an instance of SmbStorage class. + */ + public SmbStorage() { + } + + /** + * Get the host property: The host name or IP address of the SMB server. + * + * @return the host value. + */ + public String host() { + return this.host; + } + + /** + * Set the host property: The host name or IP address of the SMB server. + * + * @param host the host value to set. + * @return the SmbStorage object itself. + */ + public SmbStorage withHost(String host) { + this.host = host; + return this; + } + + /** + * Get the shareName property: The path to the SMB shared folder. + * + * @return the shareName value. + */ + public String shareName() { + return this.shareName; + } + + /** + * Set the shareName property: The path to the SMB shared folder. + * + * @param shareName the shareName value to set. + * @return the SmbStorage object itself. + */ + public SmbStorage withShareName(String shareName) { + this.shareName = shareName; + return this; + } + + /** + * Get the username property: The user to log on to the SMB server. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Set the username property: The user to log on to the SMB server. + * + * @param username the username value to set. + * @return the SmbStorage object itself. + */ + public SmbStorage withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the domain property: The domain name for the user. + * + * @return the domain value. + */ + public String domain() { + return this.domain; + } + + /** + * Set the domain property: The domain name for the user. + * + * @param domain the domain value to set. + * @return the SmbStorage object itself. + */ + public SmbStorage withDomain(String domain) { + this.domain = domain; + return this; + } + + /** + * Get the password property: The password for the user. + * + * @return the password value. + */ + public String password() { + return this.password; + } + + /** + * Set the password property: The password for the user. + * + * @param password the password value to set. + * @return the SmbStorage object itself. + */ + public SmbStorage withPassword(String password) { + this.password = password; + return this; + } + + /** + * Get the accessMode property: Access mode for storage. + * + * @return the accessMode value. + */ + public AccessMode accessMode() { + return this.accessMode; + } + + /** + * Set the accessMode property: Access mode for storage. + * + * @param accessMode the accessMode value to set. + * @return the SmbStorage object itself. + */ + public SmbStorage withAccessMode(AccessMode accessMode) { + this.accessMode = accessMode; + return this; + } + + /** + * Validates the instance. + * + * @throws 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("shareName", this.shareName); + jsonWriter.writeStringField("username", this.username); + jsonWriter.writeStringField("domain", this.domain); + jsonWriter.writeStringField("password", this.password); + jsonWriter.writeStringField("accessMode", this.accessMode == null ? null : this.accessMode.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SmbStorage from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SmbStorage if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the SmbStorage. + */ + public static SmbStorage fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SmbStorage deserializedSmbStorage = new SmbStorage(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("host".equals(fieldName)) { + deserializedSmbStorage.host = reader.getString(); + } else if ("shareName".equals(fieldName)) { + deserializedSmbStorage.shareName = reader.getString(); + } else if ("username".equals(fieldName)) { + deserializedSmbStorage.username = reader.getString(); + } else if ("domain".equals(fieldName)) { + deserializedSmbStorage.domain = reader.getString(); + } else if ("password".equals(fieldName)) { + deserializedSmbStorage.password = reader.getString(); + } else if ("accessMode".equals(fieldName)) { + deserializedSmbStorage.accessMode = AccessMode.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSmbStorage; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SourceControlCollection.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SourceControlCollection.java index 652bfc58a835..62806179f538 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SourceControlCollection.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SourceControlCollection.java @@ -6,25 +6,27 @@ 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.appcontainers.fluent.models.SourceControlInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * SourceControl collection ARM resource. */ @Fluent -public final class SourceControlCollection { +public final class SourceControlCollection implements JsonSerializable { /* * Collection of resources. */ - @JsonProperty(value = "value", required = true) private List value; /* * Link to next page of resources. */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; /** @@ -69,12 +71,52 @@ public String nextLink() { */ public void validate() { if (value() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property value in model SourceControlCollection")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model SourceControlCollection")); } else { value().forEach(e -> e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(SourceControlCollection.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SourceControlCollection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SourceControlCollection 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 SourceControlCollection. + */ + public static SourceControlCollection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SourceControlCollection deserializedSourceControlCollection = new SourceControlCollection(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> SourceControlInner.fromJson(reader1)); + deserializedSourceControlCollection.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedSourceControlCollection.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSourceControlCollection; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SourceControlOperationState.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SourceControlOperationState.java index ce792cdf36ab..512eb73c3744 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SourceControlOperationState.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SourceControlOperationState.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -47,7 +46,6 @@ public SourceControlOperationState() { * @param name a name to look for. * @return the corresponding SourceControlOperationState. */ - @JsonCreator public static SourceControlOperationState fromString(String name) { return fromString(name, SourceControlOperationState.class); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SpringBootAdminComponent.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SpringBootAdminComponent.java new file mode 100644 index 000000000000..4318656a3904 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SpringBootAdminComponent.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.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Spring Boot Admin properties. + */ +@Fluent +public final class SpringBootAdminComponent extends JavaComponentProperties { + /* + * Type of the Java Component. + */ + private JavaComponentType componentType = JavaComponentType.SPRING_BOOT_ADMIN; + + /* + * Java Component Ingress configurations. + */ + private JavaComponentIngress ingress; + + /* + * Provisioning state of the Java Component. + */ + private JavaComponentProvisioningState provisioningState; + + /** + * Creates an instance of SpringBootAdminComponent class. + */ + public SpringBootAdminComponent() { + } + + /** + * Get the componentType property: Type of the Java Component. + * + * @return the componentType value. + */ + @Override + public JavaComponentType componentType() { + return this.componentType; + } + + /** + * Get the ingress property: Java Component Ingress configurations. + * + * @return the ingress value. + */ + public JavaComponentIngress ingress() { + return this.ingress; + } + + /** + * Set the ingress property: Java Component Ingress configurations. + * + * @param ingress the ingress value to set. + * @return the SpringBootAdminComponent object itself. + */ + public SpringBootAdminComponent withIngress(JavaComponentIngress ingress) { + this.ingress = ingress; + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the Java Component. + * + * @return the provisioningState value. + */ + @Override + public JavaComponentProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * {@inheritDoc} + */ + @Override + public SpringBootAdminComponent withConfigurations(List configurations) { + super.withConfigurations(configurations); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SpringBootAdminComponent withServiceBinds(List serviceBinds) { + super.withServiceBinds(serviceBinds); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (ingress() != null) { + ingress().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("configurations", configurations(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("serviceBinds", serviceBinds(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("componentType", this.componentType == null ? null : this.componentType.toString()); + jsonWriter.writeJsonField("ingress", this.ingress); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SpringBootAdminComponent from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SpringBootAdminComponent if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SpringBootAdminComponent. + */ + public static SpringBootAdminComponent fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SpringBootAdminComponent deserializedSpringBootAdminComponent = new SpringBootAdminComponent(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedSpringBootAdminComponent.provisioningState + = JavaComponentProvisioningState.fromString(reader.getString()); + } else if ("configurations".equals(fieldName)) { + List configurations + = reader.readArray(reader1 -> JavaComponentConfigurationProperty.fromJson(reader1)); + deserializedSpringBootAdminComponent.withConfigurations(configurations); + } else if ("serviceBinds".equals(fieldName)) { + List serviceBinds + = reader.readArray(reader1 -> JavaComponentServiceBind.fromJson(reader1)); + deserializedSpringBootAdminComponent.withServiceBinds(serviceBinds); + } else if ("componentType".equals(fieldName)) { + deserializedSpringBootAdminComponent.componentType + = JavaComponentType.fromString(reader.getString()); + } else if ("ingress".equals(fieldName)) { + deserializedSpringBootAdminComponent.ingress = JavaComponentIngress.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSpringBootAdminComponent; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SpringCloudConfigComponent.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SpringCloudConfigComponent.java new file mode 100644 index 000000000000..20712411314a --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SpringCloudConfigComponent.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.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Spring Cloud Config properties. + */ +@Fluent +public final class SpringCloudConfigComponent extends JavaComponentProperties { + /* + * Type of the Java Component. + */ + private JavaComponentType componentType = JavaComponentType.SPRING_CLOUD_CONFIG; + + /* + * Provisioning state of the Java Component. + */ + private JavaComponentProvisioningState provisioningState; + + /** + * Creates an instance of SpringCloudConfigComponent class. + */ + public SpringCloudConfigComponent() { + } + + /** + * Get the componentType property: Type of the Java Component. + * + * @return the componentType value. + */ + @Override + public JavaComponentType componentType() { + return this.componentType; + } + + /** + * Get the provisioningState property: Provisioning state of the Java Component. + * + * @return the provisioningState value. + */ + @Override + public JavaComponentProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * {@inheritDoc} + */ + @Override + public SpringCloudConfigComponent withConfigurations(List configurations) { + super.withConfigurations(configurations); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SpringCloudConfigComponent withServiceBinds(List serviceBinds) { + super.withServiceBinds(serviceBinds); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("configurations", configurations(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("serviceBinds", serviceBinds(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("componentType", this.componentType == null ? null : this.componentType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SpringCloudConfigComponent from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SpringCloudConfigComponent if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SpringCloudConfigComponent. + */ + public static SpringCloudConfigComponent fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SpringCloudConfigComponent deserializedSpringCloudConfigComponent = new SpringCloudConfigComponent(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedSpringCloudConfigComponent.provisioningState + = JavaComponentProvisioningState.fromString(reader.getString()); + } else if ("configurations".equals(fieldName)) { + List configurations + = reader.readArray(reader1 -> JavaComponentConfigurationProperty.fromJson(reader1)); + deserializedSpringCloudConfigComponent.withConfigurations(configurations); + } else if ("serviceBinds".equals(fieldName)) { + List serviceBinds + = reader.readArray(reader1 -> JavaComponentServiceBind.fromJson(reader1)); + deserializedSpringCloudConfigComponent.withServiceBinds(serviceBinds); + } else if ("componentType".equals(fieldName)) { + deserializedSpringCloudConfigComponent.componentType + = JavaComponentType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSpringCloudConfigComponent; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SpringCloudEurekaComponent.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SpringCloudEurekaComponent.java new file mode 100644 index 000000000000..8ec5e46d1dee --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SpringCloudEurekaComponent.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.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Spring Cloud Eureka properties. + */ +@Fluent +public final class SpringCloudEurekaComponent extends JavaComponentProperties { + /* + * Type of the Java Component. + */ + private JavaComponentType componentType = JavaComponentType.SPRING_CLOUD_EUREKA; + + /* + * Java Component Ingress configurations. + */ + private JavaComponentIngress ingress; + + /* + * Provisioning state of the Java Component. + */ + private JavaComponentProvisioningState provisioningState; + + /** + * Creates an instance of SpringCloudEurekaComponent class. + */ + public SpringCloudEurekaComponent() { + } + + /** + * Get the componentType property: Type of the Java Component. + * + * @return the componentType value. + */ + @Override + public JavaComponentType componentType() { + return this.componentType; + } + + /** + * Get the ingress property: Java Component Ingress configurations. + * + * @return the ingress value. + */ + public JavaComponentIngress ingress() { + return this.ingress; + } + + /** + * Set the ingress property: Java Component Ingress configurations. + * + * @param ingress the ingress value to set. + * @return the SpringCloudEurekaComponent object itself. + */ + public SpringCloudEurekaComponent withIngress(JavaComponentIngress ingress) { + this.ingress = ingress; + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the Java Component. + * + * @return the provisioningState value. + */ + @Override + public JavaComponentProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * {@inheritDoc} + */ + @Override + public SpringCloudEurekaComponent withConfigurations(List configurations) { + super.withConfigurations(configurations); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SpringCloudEurekaComponent withServiceBinds(List serviceBinds) { + super.withServiceBinds(serviceBinds); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (ingress() != null) { + ingress().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("configurations", configurations(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("serviceBinds", serviceBinds(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("componentType", this.componentType == null ? null : this.componentType.toString()); + jsonWriter.writeJsonField("ingress", this.ingress); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SpringCloudEurekaComponent from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SpringCloudEurekaComponent if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SpringCloudEurekaComponent. + */ + public static SpringCloudEurekaComponent fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SpringCloudEurekaComponent deserializedSpringCloudEurekaComponent = new SpringCloudEurekaComponent(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedSpringCloudEurekaComponent.provisioningState + = JavaComponentProvisioningState.fromString(reader.getString()); + } else if ("configurations".equals(fieldName)) { + List configurations + = reader.readArray(reader1 -> JavaComponentConfigurationProperty.fromJson(reader1)); + deserializedSpringCloudEurekaComponent.withConfigurations(configurations); + } else if ("serviceBinds".equals(fieldName)) { + List serviceBinds + = reader.readArray(reader1 -> JavaComponentServiceBind.fromJson(reader1)); + deserializedSpringCloudEurekaComponent.withServiceBinds(serviceBinds); + } else if ("componentType".equals(fieldName)) { + deserializedSpringCloudEurekaComponent.componentType + = JavaComponentType.fromString(reader.getString()); + } else if ("ingress".equals(fieldName)) { + deserializedSpringCloudEurekaComponent.ingress = JavaComponentIngress.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSpringCloudEurekaComponent; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/StorageType.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/StorageType.java index 07da6d736766..b99a84237d6d 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/StorageType.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/StorageType.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -32,6 +31,11 @@ public final class StorageType extends ExpandableStringEnum { */ public static final StorageType NFS_AZURE_FILE = fromString("NfsAzureFile"); + /** + * Static value Smb for StorageType. + */ + public static final StorageType SMB = fromString("Smb"); + /** * Creates a new instance of StorageType value. * @@ -47,7 +51,6 @@ public StorageType() { * @param name a name to look for. * @return the corresponding StorageType. */ - @JsonCreator public static StorageType fromString(String name) { return fromString(name, StorageType.class); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/TcpConnectionPool.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/TcpConnectionPool.java index 041eb1c8dde5..e99cce94111d 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/TcpConnectionPool.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/TcpConnectionPool.java @@ -5,17 +5,20 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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 parameters for tcp connection pooling. */ @Fluent -public final class TcpConnectionPool { +public final class TcpConnectionPool implements JsonSerializable { /* * Maximum number of tcp connections allowed */ - @JsonProperty(value = "maxConnections") private Integer maxConnections; /** @@ -51,4 +54,40 @@ public TcpConnectionPool withMaxConnections(Integer maxConnections) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("maxConnections", this.maxConnections); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TcpConnectionPool from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TcpConnectionPool if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TcpConnectionPool. + */ + public static TcpConnectionPool fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TcpConnectionPool deserializedTcpConnectionPool = new TcpConnectionPool(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("maxConnections".equals(fieldName)) { + deserializedTcpConnectionPool.maxConnections = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedTcpConnectionPool; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/TcpRetryPolicy.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/TcpRetryPolicy.java index 885dd643742c..f53b603c908f 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/TcpRetryPolicy.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/TcpRetryPolicy.java @@ -5,17 +5,20 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Policy that defines tcp request retry conditions. */ @Fluent -public final class TcpRetryPolicy { +public final class TcpRetryPolicy implements JsonSerializable { /* * Maximum number of attempts to connect to the tcp service */ - @JsonProperty(value = "maxConnectAttempts") private Integer maxConnectAttempts; /** @@ -51,4 +54,40 @@ public TcpRetryPolicy withMaxConnectAttempts(Integer maxConnectAttempts) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("maxConnectAttempts", this.maxConnectAttempts); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TcpRetryPolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TcpRetryPolicy if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TcpRetryPolicy. + */ + public static TcpRetryPolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TcpRetryPolicy deserializedTcpRetryPolicy = new TcpRetryPolicy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("maxConnectAttempts".equals(fieldName)) { + deserializedTcpRetryPolicy.maxConnectAttempts = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedTcpRetryPolicy; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/TcpScaleRule.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/TcpScaleRule.java index d8b26124d95c..721410594a0f 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/TcpScaleRule.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/TcpScaleRule.java @@ -5,8 +5,11 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.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; @@ -14,20 +17,23 @@ * Container App container Tcp scaling rule. */ @Fluent -public final class TcpScaleRule { +public final class TcpScaleRule implements JsonSerializable { /* * Metadata properties to describe tcp scale rule. */ - @JsonProperty(value = "metadata") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map metadata; /* * Authentication secrets for the tcp scale rule. */ - @JsonProperty(value = "auth") private List auth; + /* + * The resource ID of a user-assigned managed identity that is assigned to the Container App, or 'system' for + * system-assigned identity. + */ + private String identity; + /** * Creates an instance of TcpScaleRule class. */ @@ -74,6 +80,28 @@ public TcpScaleRule withAuth(List auth) { return this; } + /** + * Get the identity property: The resource ID of a user-assigned managed identity that is assigned to the Container + * App, or 'system' for system-assigned identity. + * + * @return the identity value. + */ + public String identity() { + return this.identity; + } + + /** + * Set the identity property: The resource ID of a user-assigned managed identity that is assigned to the Container + * App, or 'system' for system-assigned identity. + * + * @param identity the identity value to set. + * @return the TcpScaleRule object itself. + */ + public TcpScaleRule withIdentity(String identity) { + this.identity = identity; + return this; + } + /** * Validates the instance. * @@ -84,4 +112,48 @@ public void validate() { auth().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("metadata", this.metadata, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("auth", this.auth, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("identity", this.identity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TcpScaleRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TcpScaleRule if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TcpScaleRule. + */ + public static TcpScaleRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TcpScaleRule deserializedTcpScaleRule = new TcpScaleRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("metadata".equals(fieldName)) { + Map metadata = reader.readMap(reader1 -> reader1.getString()); + deserializedTcpScaleRule.metadata = metadata; + } else if ("auth".equals(fieldName)) { + List auth = reader.readArray(reader1 -> ScaleRuleAuth.fromJson(reader1)); + deserializedTcpScaleRule.auth = auth; + } else if ("identity".equals(fieldName)) { + deserializedTcpScaleRule.identity = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTcpScaleRule; + }); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Template.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Template.java index a5b91a04bc38..bbdc4873cf84 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Template.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Template.java @@ -5,7 +5,11 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.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; /** @@ -14,50 +18,43 @@ * Any changes to this section Will result in a new revision being created. */ @Fluent -public final class Template { +public final class Template implements JsonSerializable