diff --git a/eng/pipelines/templates/jobs/ci.yml b/eng/pipelines/templates/jobs/ci.yml index 6e92a8cdd4f86..ab9251e275736 100644 --- a/eng/pipelines/templates/jobs/ci.yml +++ b/eng/pipelines/templates/jobs/ci.yml @@ -278,6 +278,11 @@ jobs: filePath: $(Build.SourcesDirectory)/eng/versioning/pom_file_version_scanner.ps1 arguments: -Debug:$$(IsDebug) + - task: PythonScript@0 + displayName: 'Verify version text files' + inputs: + scriptPath: eng/versioning/find_unused_dependencies.py + - template: /eng/pipelines/templates/steps/generate-project-list-and-cache-maven-repository.yml parameters: JobType: 'Analyze' diff --git a/eng/pipelines/templates/stages/archetype-sdk-client-patch.yml b/eng/pipelines/templates/stages/archetype-sdk-client-patch.yml index 057b04362350f..049407da743c3 100644 --- a/eng/pipelines/templates/stages/archetype-sdk-client-patch.yml +++ b/eng/pipelines/templates/stages/archetype-sdk-client-patch.yml @@ -252,6 +252,11 @@ extends: filePath: eng/versioning/pom_file_version_scanner.ps1 arguments: -Debug:$$(IsDebug) + - task: PythonScript@0 + displayName: 'Verify version text files' + inputs: + scriptPath: eng/versioning/find_unused_dependencies.py + # Do all the verifications for all the artifacts after the sparse-checkout. - pwsh: | $ArtifactsList = $('$(ArtifactsJson)' | ConvertFrom-Json | Select-Object name, groupId) diff --git a/eng/versioning/external_dependencies.txt b/eng/versioning/external_dependencies.txt index 46b2935401bc8..926dc20de2212 100644 --- a/eng/versioning/external_dependencies.txt +++ b/eng/versioning/external_dependencies.txt @@ -16,11 +16,9 @@ com.fasterxml.jackson.core:jackson-core;2.17.2 com.fasterxml.jackson.core:jackson-databind;2.17.2 com.fasterxml.jackson.dataformat:jackson-dataformat-avro;2.17.2 com.fasterxml.jackson.dataformat:jackson-dataformat-xml;2.17.2 -com.fasterxml.jackson.datatype:jackson-datatype-jdk8;2.17.2 com.fasterxml.jackson.datatype:jackson-datatype-jsr310;2.17.2 com.fasterxml.jackson.module:jackson-module-afterburner;2.17.2 com.fasterxml.jackson.module:jackson-module-blackbird;2.17.2 -com.fasterxml.jackson.module:jackson-module-parameter-names;2.17.2 com.fasterxml.jackson.module:jackson-module-scala_2.12;2.17.2 com.github.spotbugs:spotbugs;4.8.3 com.github.spotbugs:spotbugs-annotations;4.8.3 @@ -30,28 +28,17 @@ com.google.guava:guava;33.1.0-jre com.h2database:h2;2.2.220 com.h3xstream.findsecbugs:findsecbugs-plugin;1.9.0 com.knuddels:jtokkit;1.0.0 -com.microsoft.azure:applicationinsights-core;3.4.1 -com.microsoft.azure:azure-annotations;1.7.0 -com.microsoft.azure:azure-arm-client-runtime;1.7.14 com.microsoft.azure:azure-client-authentication;1.7.14 com.microsoft.azure:azure-client-runtime;1.7.14 com.microsoft.azure:azure-core;0.9.8 -com.microsoft.azure:azure-cosmos;3.7.3 -com.microsoft.azure:azure-eventhubs-eph;3.3.0 com.microsoft.azure:azure-keyvault-cryptography;1.2.2 -com.microsoft.azure:azure-media;0.9.8 -com.microsoft.azure:azure-servicebus;3.6.1 -com.microsoft.azure:azure-servicebus-jms;1.0.0 com.microsoft.azure:qpid-proton-j-extensions;1.2.5 com.microsoft.azure.sdk.iot:iot-service-client;1.30.0 com.microsoft.rest:client-runtime;1.7.4 -com.microsoft.rest.v2:client-runtime;2.1.1 com.microsoft.sqlserver:mssql-jdbc;10.2.3.jre8 -com.microsoft.azure:spring-data-cosmosdb;2.3.0 com.microsoft.azure:azure-functions-maven-plugin;1.30.0 com.microsoft.azure.functions:azure-functions-java-library;2.2.0 com.mysql:mysql-connector-j;9.0.0 -com.squareup.okhttp3:mockwebserver;4.12.0 com.squareup.okhttp3:okhttp;4.12.0 commons-codec:commons-codec;1.15 commons-net:commons-net;3.9.0 @@ -66,22 +53,16 @@ io.netty:netty-common;4.1.115.Final io.netty:netty-codec;4.1.115.Final io.netty:netty-codec-http;4.1.115.Final io.netty:netty-codec-http2;4.1.115.Final -io.netty:netty-transport;4.1.115.Final io.netty:netty-handler;4.1.115.Final io.netty:netty-handler-proxy;4.1.115.Final -io.netty:netty-tcnative;2.0.69.Final io.netty:netty-tcnative-boringssl-static;2.0.69.Final io.netty:netty-transport-native-epoll;4.1.115.Final io.netty:netty-transport-native-unix-common;4.1.115.Final io.netty:netty-transport-native-kqueue;4.1.115.Final -io.projectreactor.netty:reactor-netty;1.0.48 io.projectreactor.netty:reactor-netty-http;1.0.48 io.projectreactor:reactor-core;3.4.41 io.vertx:vertx-codegen;4.5.10 io.vertx:vertx-core;4.5.10 -io.vertx:vertx-reactive-streams;4.5.10 -javax.annotation:javax.annotation-api;1.3.2 -javax.json:javax.json-api;1.1.4 javax.websocket:javax.websocket-api;1.1 org.apache.commons:commons-compress;1.26.0 org.apache.ant:ant;1.10.14 @@ -95,7 +76,6 @@ org.apache.logging.log4j:log4j-slf4j-impl;2.17.2 org.apache.maven:maven-core;3.9.9 org.apache.maven.archetype:archetype-packaging;3.3.0 org.apache.maven.plugins:maven-archetype-plugin;3.3.0 -org.apache.maven.plugins:maven-gpg-plugin;3.2.7 org.apache.qpid:proton-j;0.34.1 org.asynchttpclient:async-http-client;2.12.1 org.codehaus.groovy:groovy-jsr223;3.0.19 @@ -119,66 +99,12 @@ testdep_net.bytebuddy:byte-buddy;1.15.5 testdep_net.bytebuddy:byte-buddy-agent;1.15.5 ## Spring boot dependency versions -org.springframework.boot:spring-boot-dependencies;2.7.18 -org.springframework.boot:spring-boot-actuator;2.7.18 -org.springframework.boot:spring-boot-actuator-autoconfigure;2.7.18 -org.springframework.boot:spring-boot-autoconfigure-processor;2.7.18 -org.springframework.boot:spring-boot-autoconfigure;2.7.18 -org.springframework.boot:spring-boot-configuration-metadata;2.7.18 -org.springframework.boot:spring-boot-configuration-processor;2.7.18 org.springframework.boot:spring-boot-maven-plugin;2.7.18 -org.springframework.boot:spring-boot-starter-actuator;2.7.18 -org.springframework.boot:spring-boot-starter-aop;2.7.18 -org.springframework.boot:spring-boot-starter-cache;2.7.18 -org.springframework.boot:spring-boot-starter-data-redis;2.7.18 -org.springframework.boot:spring-boot-starter-data-jdbc;2.7.18 -org.springframework.boot:spring-boot-starter-integration;2.7.18 -org.springframework.boot:spring-boot-starter-logging;2.7.18 org.springframework.boot:spring-boot-starter-test;2.7.18 -org.springframework.boot:spring-boot-starter-validation;2.7.18 -org.springframework.boot:spring-boot-starter-web;2.7.18 org.springframework.boot:spring-boot-starter;2.7.18 -org.springframework.boot:spring-boot-test;2.7.18 -org.springframework.boot:spring-boot;2.7.18 -org.springframework.data:spring-data-commons;2.7.18 -org.springframework.data:spring-data-mongodb;3.4.18 -org.springframework.data:spring-data-redis;2.7.18 -org.springframework.experimental:spring-aot;0.11.4 -org.springframework.experimental:spring-aot-maven-plugin;0.11.4 -org.springframework.integration:spring-integration-core;5.5.20 -org.springframework.kafka:spring-kafka;2.9.11 -org.springframework.security:spring-security-config;5.7.11 -org.springframework.security:spring-security-core;5.7.11 -org.springframework.security:spring-security-oauth2-client;5.7.11 -org.springframework.security:spring-security-oauth2-resource-server;5.7.11 -org.springframework.security:spring-security-oauth2-core;5.7.11 -org.springframework.security:spring-security-oauth2-jose;5.7.11 -org.springframework.security:spring-security-web;5.7.11 -org.springframework:spring-beans;5.3.32 -org.springframework:spring-context-support;5.3.32 -org.springframework:spring-context;5.3.32 org.springframework:spring-core;5.3.32 -org.springframework:spring-expression;5.3.32 -org.springframework:spring-jdbc;5.3.32 -org.springframework:spring-jms;5.3.32 -org.springframework:spring-messaging;5.3.32 -org.springframework:spring-tx;5.3.32 -org.springframework:spring-web;5.3.32 -org.springframework:spring-webmvc;5.3.32 -org.springframework:spring-test;5.3.32 -org.springframework.retry:spring-retry;1.3.4 org.springframework.boot:spring-boot-starter-parent;2.7.18 -## Spring cloud dependency versions -org.springframework.cloud:spring-cloud-dependencies;2021.0.9 -org.springframework.cloud:spring-cloud-starter-bootstrap;3.1.8 -org.springframework.cloud:spring-cloud-bus;3.1.3 -org.springframework.cloud:spring-cloud-context;3.1.8 -org.springframework.cloud:spring-cloud-sleuth-api;3.1.10 -org.springframework.cloud:spring-cloud-starter-sleuth;3.1.10 -org.springframework.cloud:spring-cloud-starter-stream-kafka;3.2.10 -org.springframework.cloud:spring-cloud-stream-binder-test;3.2.10 -org.springframework.cloud:spring-cloud-stream;3.2.10 ## Test dependency versions com.github.docker-java:docker-java;3.4.0 @@ -189,7 +115,6 @@ com.microsoft.azure:azure-mgmt-graph-rbac;1.3.0 com.microsoft.azure:azure-mgmt-keyvault;1.11.1 com.microsoft.azure:azure-mgmt-network;1.33.0 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.17.2 @@ -219,7 +144,6 @@ org.assertj:assertj-core;3.22.0 org.bouncycastle:bcprov-jdk15to18;1.78.1 org.bouncycastle:bcprov-jdk18on;1.78.1 org.bouncycastle:bcpkix-lts8on;2.73.6 -org.eclipse.jetty:jetty-http;9.4.56.v20240826 org.eclipse.jetty:jetty-server;9.4.56.v20240826 org.eclipse.jetty:jetty-servlet;9.4.56.v20240826 org.hamcrest:hamcrest;2.2 @@ -279,7 +203,6 @@ org.apache.maven.plugins:maven-surefire-plugin;3.5.1 org.codehaus.mojo:animal-sniffer-maven-plugin;1.24 org.codehaus.mojo:build-helper-maven-plugin;3.6.0 org.codehaus.mojo:exec-maven-plugin;3.4.1 -org.codehaus.mojo:properties-maven-plugin;1.2.1 org.codehaus.mojo:xml-maven-plugin;1.1.0 org.eclipse.jetty:jetty-maven-plugin;9.4.33.v20201020 org.eclipse.m2e:lifecycle-mapping;1.0.0 @@ -313,17 +236,12 @@ test_jar_com.microsoft.azure:azure-mgmt-resources;1.3.1-SNAPSHOT # everything under sdk\cosmos cosmos_com.google.guava:guava;33.0.0-jre -cosmos_com.microsoft.data.encryption:cryptography;0.2.2.jre8-preview -cosmos_com.microsoft.data.encryption:azure-key-vault-keystoreprovider;0.2.2.jre8-preview cosmos_io.dropwizard.metrics:metrics-core;4.1.0 cosmos_io.dropwizard.metrics:metrics-graphite;4.1.0 cosmos_io.dropwizard.metrics:metrics-jvm;4.1.0 cosmos_org.mpierce.metrics.reservoir:hdrhistogram-metrics-reservoir;1.1.0 cosmos_org.hdrhistogram:HdrHistogram;2.1.12 -cosmos_org.codehaus.mojo:build-helper-maven-plugin;3.5.0 -cosmos_com.fasterxml.jackson.datatype:jackson-datatype-jsr310;2.15.2 cosmos_com.fasterxml.jackson.core:jackson-databind;2.15.2 -cosmos_com.fasterxml.jackson.module:jackson-module-afterburner;2.15.2 cosmos_com.fasterxml.jackson.module:jackson-module-scala_2.12;2.15.2 ## Cosmos Spark connector under sdk\cosmos\azure-cosmos-spark_3-1_2-12\pom.xml @@ -369,7 +287,6 @@ cosmos_org.sourcelab:kafka-connect-client;4.0.4 cosmos_io.confluent:kafka-avro-serializer;7.6.0 cosmos_org.apache.avro:avro;1.11.3 # Maven Tools for Cosmos Kafka connector only -cosmos_io.confluent:kafka-connect-maven-plugin;0.12.0 # sdk\core\azure-core-serializer-avro-jackson\pom.xml # This dependency is needed since Jackson Avro uses an older dependency on Apache Avro which is another library. @@ -438,7 +355,6 @@ springboot3_org.apache.maven.plugins:maven-failsafe-plugin;3.5.2 springboot3_org.apache.maven.plugins:maven-jar-plugin;3.4.2 springboot3_org.apache.maven.plugins:maven-javadoc-plugin;3.10.1 springboot3_org.apache.maven.plugins:maven-surefire-plugin;3.5.2 -springboot3_org.apache.qpid:qpid-jms-client;2.0.0 springboot3_org.assertj:assertj-core;3.26.3 springboot3_org.hibernate.validator:hibernate-validator;8.0.1.Final springboot3_org.javatuples:javatuples;1.2 @@ -455,7 +371,6 @@ springboot3_org.springframework.boot:spring-boot-actuator;3.4.0 springboot3_org.springframework.boot:spring-boot-autoconfigure;3.4.0 springboot3_org.springframework.boot:spring-boot-configuration-metadata;3.4.0 springboot3_org.springframework.boot:spring-boot-configuration-processor;3.4.0 -springboot3_org.springframework.boot:spring-boot-dependencies;3.4.0 springboot3_org.springframework.boot:spring-boot-docker-compose;3.4.0 springboot3_org.springframework.boot:spring-boot-starter-actuator;3.4.0 springboot3_org.springframework.boot:spring-boot-starter-data-jdbc;3.4.0 @@ -468,7 +383,6 @@ springboot3_org.springframework.boot:spring-boot-test;3.4.0 springboot3_org.springframework.boot:spring-boot-testcontainers;3.4.0 springboot3_org.springframework.cloud:spring-cloud-bus;4.2.0 springboot3_org.springframework.cloud:spring-cloud-context;4.2.0 -springboot3_org.springframework.cloud:spring-cloud-dependencies;2024.0.0 springboot3_org.springframework.cloud:spring-cloud-starter-bootstrap;4.2.0 springboot3_org.springframework.cloud:spring-cloud-starter-stream-kafka;4.2.0 springboot3_org.springframework.cloud:spring-cloud-stream-test-binder;4.2.0 @@ -496,7 +410,6 @@ springboot3_org.springframework:spring-test;6.2.0 springboot3_org.springframework:spring-tx;6.2.0 springboot3_org.springframework:spring-web;6.2.0 springboot3_org.springframework:spring-webmvc;6.2.0 -springboot3_org.testcontainers:testcontainers;1.20.4 springboot3_org.testcontainers:junit-jupiter;1.20.4 springboot3_org.testcontainers:azure;1.20.4 diff --git a/eng/versioning/find_unused_dependencies.py b/eng/versioning/find_unused_dependencies.py new file mode 100644 index 0000000000000..698e7fe31d5ba --- /dev/null +++ b/eng/versioning/find_unused_dependencies.py @@ -0,0 +1,63 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +# This script is used to find unused dependencies in the version_client.txt and external_dependencies.txt files. +# It is used in the CI pipeline to ensure that all dependencies are used in the codebase. + +import argparse +import os + +from utils import load_version_map_from_file +from utils import version_update_marker + +def fixup_version_map(version_file, version_map): + # uses the util function to load the version map from the file, then adds a bool to each entry to track if it is visisted + load_version_map_from_file(version_file, version_map) + for key in version_map: + val = version_map[key] + version_map[key] = (False, val) + +def find_unused_dependencies(dep_map, message): + unused_deps = [key for key in dep_map if not dep_map[key][0]] + if unused_deps: + print(message) + for dep in unused_deps: + print(" " + dep) + return bool(unused_deps) + +def main(): + version_map = {} + ext_dep_map = {} + + version_file = os.path.normpath("eng/versioning/version_client.txt") + dependency_file = os.path.normpath("eng/versioning/external_dependencies.txt") + + fixup_version_map(version_file, version_map) + fixup_version_map(dependency_file, ext_dep_map) + + + for root, _, files in os.walk("."): + try: + for file in files: + if file.startswith("pom") and file.endswith(".xml"): + with open(os.path.join(root, file), encoding="utf-8") as f: + for line in f: + match = version_update_marker.search(line) + if match: + module_name, version_type = match.group(1), match.group(2) + if module_name in ext_dep_map or module_name in version_map: + if version_type == "external_dependency": + ext_dep_map[module_name] = (True, ext_dep_map[module_name][1]) + else: + version_map[module_name] = (True, version_map[module_name][1]) + except KeyError as e: + print(str(e) + " was not found in the right place. Please investigate.") + + unused_dependencies = find_unused_dependencies(version_map, "Unused version_client.txt entries:") + unused_ext_dep = find_unused_dependencies(ext_dep_map, "Unused external_dependencies.txt entries:") + + if unused_dependencies or unused_ext_dep: + exit(1) + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/eng/versioning/update_versions.py b/eng/versioning/update_versions.py index f223ffc06c379..ae8be37ece681 100644 --- a/eng/versioning/update_versions.py +++ b/eng/versioning/update_versions.py @@ -39,6 +39,7 @@ import traceback from utils import BuildType from utils import CodeModule +from utils import load_version_map_from_file from utils import external_dependency_version_regex from utils import external_dependency_include_regex from utils import run_check_call @@ -185,29 +186,6 @@ def update_changelog(pom_file, is_increment, library_array): else: print('There is no CHANGELOG.md file in {}, skipping update'.format(dirname)) -def load_version_map_from_file(the_file, version_map): - with open(the_file) as f: - for raw_line in f: - stripped_line = raw_line.strip() - if not stripped_line or stripped_line.startswith('#'): - continue - module = CodeModule(stripped_line) - # verify no duplicate entries - if (module.name in version_map): - raise ValueError('Version file: {0} contains a duplicate entry: {1}'.format(the_file, module.name)) - # verify that if the module is beta_ or unreleased_ that there's a matching non-beta_ or non-unreleased_ entry - if (module.name.startswith('beta_') or module.name.startswith('unreleased_')): - tempName = module.name - if tempName.startswith('beta_'): - tempName = module.name[len('beta_'):] - else: - tempName = module.name[len('unreleased_'):] - # if there isn't a non beta or unreleased entry then raise an issue - if tempName not in version_map: - raise ValueError('Version file: {0} does not contain a non-beta or non-unreleased entry for beta_/unreleased_ library: {1}'.format(the_file, module.name)) - - version_map[module.name] = module - def load_version_overrides(the_file, version_map, overrides_name): with open(the_file) as f: data = json.load(f) diff --git a/eng/versioning/utils.py b/eng/versioning/utils.py index 39a3ea3e9773f..0de583835dafe 100644 --- a/eng/versioning/utils.py +++ b/eng/versioning/utils.py @@ -156,4 +156,28 @@ def run_check_call( if always_exit: exit(1) else: - return err \ No newline at end of file + return err + + +def load_version_map_from_file(the_file, version_map): + with open(the_file) as f: + for raw_line in f: + stripped_line = raw_line.strip() + if not stripped_line or stripped_line.startswith('#'): + continue + module = CodeModule(stripped_line) + # verify no duplicate entries + if (module.name in version_map): + raise ValueError('Version file: {0} contains a duplicate entry: {1}'.format(the_file, module.name)) + # verify that if the module is beta_ or unreleased_ that there's a matching non-beta_ or non-unreleased_ entry + if (module.name.startswith('beta_') or module.name.startswith('unreleased_')): + tempName = module.name + if tempName.startswith('beta_'): + tempName = module.name[len('beta_'):] + else: + tempName = module.name[len('unreleased_'):] + # if there isn't a non beta or unreleased entry then raise an issue + if tempName not in version_map: + raise ValueError('Version file: {0} does not contain a non-beta or non-unreleased entry for beta_/unreleased_ library: {1}'.format(the_file, module.name)) + version_map[module.name] = module + \ No newline at end of file diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index e14afa437207c..e9c65f4751032 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -33,7 +33,6 @@ # performed. So, if com.azure:azure-new-library is added with major version 2 it'll use # com.azure:azure-new-library;2.0.0-beta.1;2.0.0-beta.1 as its initial version tag. -com.azure:azure-sdk-all;1.0.0;1.0.0 com.azure:azure-sdk-parent;1.6.0;1.6.0 com.azure:azure-client-sdk-parent;1.7.0;1.7.0 com.azure:azure-ai-anomalydetector;3.0.0-beta.5;3.0.0-beta.6 @@ -209,7 +208,6 @@ com.azure:identity-test-function;1.0.0-beta.1;1.0.0-beta.1 com.azure:identity-test-vm;1.0.0-beta.1;1.0.0-beta.1 com.azure:identity-test-webapp;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-ai-vision-face;1.0.0-beta.2;1.0.0-beta.3 -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;5.19.0;5.20.0-beta.1 com.azure.spring:spring-cloud-azure-appconfiguration-config;5.19.0;5.20.0-beta.1 @@ -297,7 +295,7 @@ com.azure.resourcemanager:azure-resourcemanager-mysql;1.0.2;1.1.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-postgresql;1.0.2;1.1.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-hdinsight;1.0.0;1.1.0-beta.3 com.azure.resourcemanager:azure-resourcemanager-sqlvirtualmachine;1.0.0-beta.5;1.0.0-beta.6 -com.azure.resourcemanager:azure-resourcemanager-relay;1.0.0-beta.3;1.0.0-beta.4 +com.azure.resourcemanager:azure-resourcemanager-relay;1.0.0-beta.3;1.1.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-costmanagement;1.0.0-beta.7;1.0.0-beta.8 com.azure.resourcemanager:azure-resourcemanager-recoveryservices;1.3.0;1.4.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-kusto;1.1.0;1.2.0-beta.1 @@ -385,7 +383,7 @@ com.azure.resourcemanager:azure-resourcemanager-security;1.0.0-beta.7;1.0.0-beta com.azure.resourcemanager:azure-resourcemanager-azurearcdata;1.0.0-beta.4;1.0.0-beta.5 com.azure.resourcemanager:azure-resourcemanager-hybridnetwork;1.1.0;1.2.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-purview;1.0.0-beta.3;1.0.0-beta.4 -com.azure.resourcemanager:azure-resourcemanager-mysqlflexibleserver;1.0.0-beta.6;1.0.0-beta.7 +com.azure.resourcemanager:azure-resourcemanager-mysqlflexibleserver;1.0.0-beta.6;1.1.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-baremetalinfrastructure;1.0.0-beta.4;1.0.0-beta.5 com.azure.resourcemanager:azure-resourcemanager-quota;1.0.0;1.1.0-beta.3 com.azure.resourcemanager:azure-resourcemanager-extendedlocation;1.0.0-beta.3;1.0.0-beta.4 diff --git a/eng/versioning/version_data_java_files.txt b/eng/versioning/version_data_java_files.txt index 8f7578becf2c5..1c397edad352f 100644 --- a/eng/versioning/version_data_java_files.txt +++ b/eng/versioning/version_data_java_files.txt @@ -3,5 +3,4 @@ # has been fixed this file and the update logic in update_versions.py should no longer be necessary. # The file format here should be the relative path from the root of the azure-sdk-for-java -sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/ClientConstants.java -sdk/storage/microsoft-azure-storage-blob/src/main/java/com/microsoft/azure/storage/blob/Constants.java +sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/ClientConstants.java \ No newline at end of file diff --git a/sdk/appcomplianceautomation/azure-resourcemanager-appcomplianceautomation/src/main/java/module-info.java b/sdk/appcomplianceautomation/azure-resourcemanager-appcomplianceautomation/src/main/java/module-info.java index e801d63d763f4..c3c1fa1efa76e 100644 --- a/sdk/appcomplianceautomation/azure-resourcemanager-appcomplianceautomation/src/main/java/module-info.java +++ b/sdk/appcomplianceautomation/azure-resourcemanager-appcomplianceautomation/src/main/java/module-info.java @@ -12,5 +12,5 @@ opens com.azure.resourcemanager.appcomplianceautomation.fluent.models to com.azure.core, com.fasterxml.jackson.databind; - opens com.azure.resourcemanager.appcomplianceautomation.models to com.azure.core, com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.appcomplianceautomation.models to com.azure.core; } diff --git a/sdk/clientcore/README.md b/sdk/clientcore/README.md index 11033fe8ffd8e..b99b23724f3a8 100644 --- a/sdk/clientcore/README.md +++ b/sdk/clientcore/README.md @@ -1,32 +1,24 @@ -# Azure Core shared library for Java +# Client Core shared library for Java -[![Build Documentation](https://img.shields.io/badge/documentation-published-blue.svg)](https://azure.github.io/azure-sdk-for-java) +Client Core provides shared primitives, abstractions, and helpers for modern SDK client libraries. These libraries +can be easily identified by package names starting with `io.clientcore`, e.g. `io.clientcore.core` would be found within +the `/sdk/clientcore/core` directory. -Azure Core provides shared primitives, abstractions, and helpers for modern Java Azure SDK client libraries. These libraries follow the [Azure SDK Design Guidelines for Java](https://azure.github.io/azure-sdk/java_introduction.html) and can be easily identified by package names starting with `io.clientcore` and module names starting with `azure-`, e.g. `io.clientcore.storage.blobs` would be found within the `/sdk/storage/azure-storage-blob` directory. A more complete list of client libraries using Azure Core can be found [here](https://azure.github.io/azure-sdk/releases/latest/#java-packages). +Client Core allows client libraries to expose common functionality in a consistent fashion, so that once you learn how +to use these APIs in one client library, you will know how to use them in other client libraries. -Azure Core allows client libraries to expose common functionality in a consistent fashion, so that once you learn how to use these APIs in one client library, you will know how to use them in other client libraries. - -The main shared concepts of Azure Core (and therefore all Azure client libraries using Azure Core) include: +The main shared concepts of Client Core include: - Configuring service clients, e.g. configuring retries, logging, etc. - Accessing HTTP response details (`Response`). -- Calling long running operations (`Poller`). -- Paging and asynchronous streams (`PagedFlux`). - Exceptions for reporting errors from service requests in a consistent fashion. -- Abstractions for representing Azure SDK credentials. +- Abstractions for representing credentials. ## Sub-projects -Azure Core is split into a number of sub-components: - -- [https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core) is the primary library, used by all client libraries to offer the functionality outlined above. -- [https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-amqp](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-amqp) provides functionality related to AMQP (Advanced Message Queuing Protocol). -- [https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty) provides a Netty derived HTTP client. -- [https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-okhttp](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-okhttp) provides an OkHttp derived HTTP client. -- [https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-management](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-management) provides APIs used by the Azure management libraries, but which are redundant to client libraries. -- [https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-test](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-test) provides utilities and API to make writing tests for Azure Core simpler and consistent. -- [https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-tracing-opentelemetry](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-tracing-opentelemetry) provides an OpenTelemetry based tracing library. +Client Core is split into a number of sub-components: -For documentation on using Azure Core, refer to the [https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core readme](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core). +- [https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/clientcore/core](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/clientcore/core) is the primary library, used by all client libraries to offer the functionality outlined above. +- [https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/clientcore/http-okhttp3](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/clientcore/http-okhttp3) provides an OkHttp derived HTTP client. -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Fcore%2FREADME.png) +For documentation on using Client Core, refer to the [https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/clientcore/core readme](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/clientcore/core). diff --git a/sdk/clientcore/core/README.md b/sdk/clientcore/core/README.md index 225c649ff3831..f1e7402fea790 100644 --- a/sdk/clientcore/core/README.md +++ b/sdk/clientcore/core/README.md @@ -1,23 +1,17 @@ # Core shared library for Java -[![Build Documentation](https://img.shields.io/badge/documentation-published-blue.svg)](https://azure.github.io/azure-sdk-for-java) +Client Core provides shared primitives, abstractions, and helpers for modern SDK client libraries. These libraries +can be easily identified by package names starting with `io.clientcore`, e.g. `io.clientcore.core` would be found within +the `/sdk/clientcore/core` directory. -Core provides shared primitives, abstractions, and helpers for modern Java Core SDK client libraries. -These libraries follow -the [SDK Design Guidelines for Java](https://azure.github.io/azure-sdk/java_introduction.html) -and can be easily identified by package names starting with `io.clientcore` and module names starting with `clientcore`, -e.g. `io.clientcore.core` would be found within the `/sdk/clientcore/core` directory. A more complete -list of client libraries using Core can be found [here](https://azure.github.io/azure-sdk/releases/latest/#java-packages). - -Core allows client libraries to expose common functionality consistently, so that once you learn how to use these +Client Core allows client libraries to expose common functionality consistently, so that once you learn how to use these APIs in one client library, you will know how to use them in other client libraries. ## 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). +- A Java Development Kit (JDK), version 17 or later. ### Include the package @@ -161,11 +155,10 @@ the necessary functionality. #### HttpTrait `HttpTrait` contains methods for setting key configurations for HTTP-based clients. This interface will allow you to -configure the `HttpClient`, `HttpPipeline`, `HttpPipelinePolicy`s, `RetryOptions`, `HttpLogOptions`, and `ClientOptions` -(preferably `HttpClientOptions` as it is more specific for HTTP-based service clients). +configure the `HttpClient`, `HttpPipeline`, `HttpPipelinePolicy`s, `RetryOptions`, and `HttpLogOptions`. For builders that expose `HttpTrait`, if an `HttpPipeline` or `HttpClient` isn't set a default instance will be -created based on classpath configurations and the `ClientOptions` based to the builder. This can cause confusion if +created based on classpath configurations. This can cause confusion if you're expecting specific behavior for your client, such as using a proxy that wasn't loaded from the environment. To avoid this, it is recommended to always set the `HttpPipeline` or `HttpClient` in all clients if you're building if your configurations aren't based on the environment running the application. @@ -195,49 +188,16 @@ passing credentials to some client builders that support it, and more. Core SDKs provide a few, consistent ways to configure timeouts on API calls. Each timeout effects a different scope of the Core SDKs and calling application. -#### HTTP Timeouts - -HTTP timeouts are the lowest level of timeout handling the Core SDKs provide. These timeouts can be configured when -building `HttpClient`s or using `HttpClientOptions` when building service clients without configuring an `HttpClient` -yourself. The following table lists the HTTP timeout, the corresponding `HttpClientOptions` method that can be used to -set it, environment variable to control the default value, the default value if the environment value isn't set, and a -brief description of what the timeout effects. - -| HTTP Timeout | `HttpClientOptions` Method | Environment Variable | Default Value | Description | -|------------------|--------------------------------|--------------------------------|---------------|-------------------------------------------------------------------------------------------------------------------| -| Connect Timeout | `setConnectTimeout(Duration)` | AZURE_REQUEST_CONNECT_TIMEOUT | 10 seconds | The amount of time for a connection to be established before timing out. | -| Write Timeout | `setWriteTimeout(Duration)` | AZURE_REQUEST_WRITE_TIMEOUT | 60 seconds | The amount of time between each request data write to the network before timing out. | -| Response Timeout | `setResponseTimeout(Duration)` | AZURE_REQUEST_RESPONSE_TIMEOUT | 60 seconds | The amount of time between finishing sending the request to receiving the first response bytes before timing out. | -| Read Timeout | `setReadTimeout(Duration)` | AZURE_REQUEST_READ_TIMEOUT | 60 seconds | The amount of time between each response data read from the network before timing out. | - -Since these timeouts are closest to the network, if they trigger they will be propagated back through the `HttpPipeline` -and generally should be retried by the `RetryPolicy`. - #### HttpPipeline Timeouts -HttpPipeline timeouts are the next level of timeout handling the Azure SDKs provide. These timeouts are configured using -an `HttpPipelinePolicy` and configuring a timeout using either `Mono.timeout` for asynchronous requests or an -`ExecutorService` with a timed `get(long, TimeUnit)` for synchronous requests. +HttpPipeline timeouts are the next level of timeout handling Client Core provides. These timeouts are configured using +an `HttpPipelinePolicy` and configuring an `ExecutorService` with a timed `get(long, TimeUnit)`. Depending on the location within the `HttpPipeline`, these timeouts may be captured by the `RetryPolicy` and retried. If the timeout policy is `PER_RETRY` (`HttpPipelinePolicy.getPipelinePosition()`) the timeout will be captured by the `RetryPolicy` as it will be positioned after the `RetryPolicy`, therefore in its capture scope, if it is `PER_CALL` retrying the request will need to be handled by application logic. -#### Service Client Timeouts - -Service client timeouts are the highest level of timeout handling the Azure SDKs provide. These timeouts are configured -by passing `Duration timeout` into synchronous service methods that support timeouts or by using `Mono.timeout` or -`Flux.timeout` on asynchronous service methods. - -Since these timeouts are on the API call itself they cannot be captured by any retry mechanisms within the Azure SDKs -and must be handled by application logic. - -## Next steps - -Get started with Azure libraries that -are [built using Azure Core](https://azure.github.io/azure-sdk/releases/latest/#java). - ## Troubleshooting If you encounter any bugs, please file issues @@ -246,24 +206,24 @@ or checkout [StackOverflow for Azure Java SDK](https://stackoverflow.com/questio ### Enabling Logging -Azure SDKs for Java provide a consistent logging story to help aid in troubleshooting application errors and expedite +Client Core provides a consistent logging story to help aid in troubleshooting application errors and expedite their resolution. The logs produced will capture the flow of an application before reaching the terminal state to help -locate the root issue. View the [logging][logging] documentation for guidance about enabling logging. +locate the root issue. #### HTTP Request and Response Logging HTTP request and response logging can be enabled by setting `HttpLogDetailLevel` in the `HttpLogOptions` used to create -an HTTP-based service client or by setting the environment variable or system property `AZURE_HTTP_LOG_DETAIL_LEVEL`. -The following table displays the valid options for `AZURE_HTTP_LOG_DETAIL_LEVEL` and the `HttpLogDetailLevel` it +an HTTP-based service client or by setting the environment variable or system property `HTTP_LOG_DETAIL_LEVEL`. +The following table displays the valid options for `HTTP_LOG_DETAIL_LEVEL` and the `HttpLogDetailLevel` it correlates to (valid options are case-insensitive): -| `AZURE_HTTP_LOG_DETAIL_LEVEL` value | `HttpLogDetailLevel` enum | -|-------------------------------------|---------------------------------------| -| `basic` | `HttpLogDetailLevel.BASIC` | -| `headers` | `HttpLogDetailLevel.HEADERS` | -| `body` | `HttpLogDetailLevel.BODY` | -| `body_and_headers` | `HttpLogDetailLevel.BODY_AND_HEADERS` | -| `bodyandheaders` | `HttpLogDetailLevel.BODY_AND_HEADERS` | +| `HTTP_LOG_DETAIL_LEVEL` value | `HttpLogDetailLevel` enum | +|-------------------------------|---------------------------------------| +| `basic` | `HttpLogDetailLevel.BASIC` | +| `headers` | `HttpLogDetailLevel.HEADERS` | +| `body` | `HttpLogDetailLevel.BODY` | +| `body_and_headers` | `HttpLogDetailLevel.BODY_AND_HEADERS` | +| `bodyandheaders` | `HttpLogDetailLevel.BODY_AND_HEADERS` | All other values, or unsupported values, result in `HttpLogDetailLevel.NONE`, or disabled HTTP request and response logging. Logging [must be enabled](#enabling-logging) to log HTTP requests and responses. Logging of HTTP headers @@ -288,11 +248,3 @@ the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/C 3. Commit your changes (`git commit -am 'Add some feature'`) 4. Push to the branch (`git push origin my-new-feature`) 5. Create new Pull Request - - - -[logging]: https://learn.microsoft.com/azure/developer/java/sdk/logging-overview - -[jdk_link]: https://docs.microsoft.com/java/azure/jdk/?view=azure-java-stable - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Fcore%2Fgeneric-core%2FREADME.png) diff --git a/sdk/clientcore/core/pom.xml b/sdk/clientcore/core/pom.xml index 9c43e77f25dda..8a09ee9449942 100644 --- a/sdk/clientcore/core/pom.xml +++ b/sdk/clientcore/core/pom.xml @@ -17,7 +17,7 @@ jar 1.0.0-beta.1 - Java Core Library for building client libraries for accessing web services. + Core Library for building Java client libraries for accessing web services. This library contains core types for building Java client libraries for accessing web services. https://github.com/Azure/azure-sdk-for-java diff --git a/sdk/clientcore/core/src/main/java/io/clientcore/core/http/client/implementation/BodyPublisherUtils.java b/sdk/clientcore/core/src/main/java/io/clientcore/core/http/client/implementation/BodyPublisherUtils.java index 8f54037f86a2d..794b38073b12b 100644 --- a/sdk/clientcore/core/src/main/java/io/clientcore/core/http/client/implementation/BodyPublisherUtils.java +++ b/sdk/clientcore/core/src/main/java/io/clientcore/core/http/client/implementation/BodyPublisherUtils.java @@ -32,9 +32,9 @@ private BodyPublisherUtils() { */ public static HttpRequest.BodyPublisher toBodyPublisher(io.clientcore.core.http.models.HttpRequest request, Duration writeTimeout) { - // TODO (alzimmer): azure-core was using Flux.timeout to handle write timeouts. The logic will need to be - // re-implemented to handle write timeouts in a similar manner. + // TODO (alzimmer): Handle write timeouts. BinaryData body = request.getBody(); + if (body == null) { return noBody(); } diff --git a/sdk/clientcore/core/src/main/java/io/clientcore/core/http/models/ProxyOptions.java b/sdk/clientcore/core/src/main/java/io/clientcore/core/http/models/ProxyOptions.java index 026b299529901..8c676bfb72237 100644 --- a/sdk/clientcore/core/src/main/java/io/clientcore/core/http/models/ProxyOptions.java +++ b/sdk/clientcore/core/src/main/java/io/clientcore/core/http/models/ProxyOptions.java @@ -205,8 +205,8 @@ public String getNonProxyHosts() { *
  • Java HTTP
  • * * - * Azure proxy configurations will be preferred over Java proxy configurations as they are more closely scoped to - * the purpose of the SDK. Additionally, more secure protocols, HTTPS vs HTTP, will be preferred. + * Client Core proxy configurations will be preferred over Java proxy configurations as they are more closely scoped + * to the purpose of the SDK. Additionally, more secure protocols, HTTPS vs HTTP, will be preferred. * *

    * {@code null} will be returned if no proxy was found in the environment. @@ -229,14 +229,14 @@ public static ProxyOptions fromConfiguration(Configuration configuration) { *

    * Environment configurations are loaded in this order: *

      - *
    1. Azure HTTPS
    2. - *
    3. Azure HTTP
    4. + *
    5. Client Core HTTPS
    6. + *
    7. Client Core HTTP
    8. *
    9. Java HTTPS
    10. *
    11. Java HTTP
    12. *
    * - * Azure proxy configurations will be preferred over Java proxy configurations as they are more closely scoped to - * the purpose of the SDK. Additionally, more secure protocols, HTTPS vs HTTP, will be preferred. + * Client Core proxy configurations will be preferred over Java proxy configurations as they are more closely scoped + * to the purpose of the SDK. Additionally, more secure protocols, HTTPS vs HTTP, will be preferred. *

    * {@code null} will be returned if no proxy was found in the environment. * @@ -491,7 +491,7 @@ private static String sanitizeNonProxyHosts(String[] nonProxyHosts) { /* * Replace the non-proxy host with the sanitized value. * - * The body of the non-proxy host is quoted to handle scenarios such a '127.0.0.1' or '*.azure.com' + * The body of the non-proxy host is quoted to handle scenarios such a '127.0.0.1' or '*.somecloud.com' * where without quoting the '.' in the string would be treated as the match any character instead of * the literal '.' character. */ diff --git a/sdk/clientcore/core/src/main/java/io/clientcore/core/implementation/ReflectionSerializable.java b/sdk/clientcore/core/src/main/java/io/clientcore/core/implementation/ReflectionSerializable.java index 1a95c9c04ddeb..f4479e52df753 100644 --- a/sdk/clientcore/core/src/main/java/io/clientcore/core/implementation/ReflectionSerializable.java +++ b/sdk/clientcore/core/src/main/java/io/clientcore/core/implementation/ReflectionSerializable.java @@ -20,9 +20,6 @@ /** * Utility class that handles creating and using {@code JsonSerializable} and {@code XmlSerializable} reflectively while * they are in beta. - *

    - * Once {@code azure-json} and {@code azure-xml} GA this can be replaced with direct usage of the types. This is - * separated out from what uses it to keep those code paths clean. */ public final class ReflectionSerializable { private static final ClientLogger LOGGER = new ClientLogger(ReflectionSerializable.class); diff --git a/sdk/clientcore/core/src/main/java/io/clientcore/core/implementation/ReflectionUtils.java b/sdk/clientcore/core/src/main/java/io/clientcore/core/implementation/ReflectionUtils.java index de28460f3887c..ed24898b9269f 100644 --- a/sdk/clientcore/core/src/main/java/io/clientcore/core/implementation/ReflectionUtils.java +++ b/sdk/clientcore/core/src/main/java/io/clientcore/core/implementation/ReflectionUtils.java @@ -38,36 +38,36 @@ public static ReflectiveInvoker getMethodInvoker(Class targetClass, Method me * to alleviate this issue, if {@code targetClass} is null {@link Method#getDeclaringClass()} will be used to infer * the class. *

    - * {@code scopeToAzure} is only when used when MethodHandles are being used and Java 9+ modules are being used. This - * will determine whether to use a MethodHandles.Lookup scoped to {@code core} or to use a public + * {@code scopeToClientCore} is only when used when MethodHandles are being used and Java 9+ modules are being used. + * This will determine whether to use a MethodHandles.Lookup scoped to {@code core} or to use a public * MethodHandles.Lookup. Scoping a MethodHandles.Lookup to {@code core} requires to module containing the - * class to open or export to {@code core} which generally only holds true for other Azure SDKs, for example + * class to open or export to {@code core} which generally only holds true for other SDKs, for example * there are cases where a reflective invocation is needed to Jackson which won't open or export to * {@code core} and the only APIs invoked reflectively are public APIs so the public MethodHandles.Lookup will * be used. * * @param targetClass The class that contains the method. * @param method The method to invoke. - * @param scopeToGenericCore If Java 9+ modules is being used this will scope MethodHandle-based reflection to using + * @param scopeToClientCore If Java 9+ modules is being used this will scope MethodHandle-based reflection to using * {@code core} as the scoped module, otherwise this is ignored. * @return An {@link ReflectiveInvoker} instance that will invoke the method. * @throws NullPointerException If {@code method} is null. * @throws Exception If the {@link ReflectiveInvoker} cannot be created. */ - public static ReflectiveInvoker getMethodInvoker(Class targetClass, Method method, boolean scopeToGenericCore) + public static ReflectiveInvoker getMethodInvoker(Class targetClass, Method method, boolean scopeToClientCore) throws Exception { if (method == null) { throw LOGGER.logThrowableAsError(new NullPointerException("'method' cannot be null.")); } targetClass = (targetClass == null) ? method.getDeclaringClass() : targetClass; - return INSTANCE.getMethodInvoker(targetClass, method, scopeToGenericCore); + return INSTANCE.getMethodInvoker(targetClass, method, scopeToClientCore); } /** * Creates an {@link ReflectiveInvoker} instance that will invoke a {@link Constructor}. *

    - * Calls {@link #getConstructorInvoker(Class, Constructor, boolean)} with {@code scopeToAzureCore} set to true. + * Calls {@link #getConstructorInvoker(Class, Constructor, boolean)} with {@code scopeToClientCore} set to true. * * @param targetClass The class that contains the constructor. * @param constructor The constructor to invoke. @@ -88,30 +88,30 @@ public static ReflectiveInvoker getConstructorInvoker(Class targetClass, Cons * to alleviate this issue, if {@code targetClass} is null {@link Constructor#getDeclaringClass()} will be used to * infer the class. *

    - * {@code scopeToAzure} is only when used when MethodHandles are being used and Java 9+ modules are being used. This - * will determine whether to use a MethodHandles.Lookup scoped to {@code core} or to use a public + * {@code scopeToClientCore} is only when used when MethodHandles are being used and Java 9+ modules are being used. + * This will determine whether to use a MethodHandles.Lookup scoped to {@code core} or to use a public * MethodHandles.Lookup. Scoping a MethodHandles.Lookup to {@code core} requires to module containing the - * class to open or export to {@code core} which generally only holds true for other Azure SDKs, for example + * class to open or export to {@code core} which generally only holds true for other SDKs, for example * there are cases where a reflective invocation is needed to Jackson which won't open or export to * {@code core} and the only APIs invoked reflectively are public APIs so the public MethodHandles.Lookup will * be used. * * @param targetClass The class that contains the constructor. * @param constructor The constructor to invoke. - * @param scopeToAzureCore If Java 9+ modules is being used this will scope MethodHandle-based reflection to using + * @param scopeToClientCore If Java 9+ modules is being used this will scope MethodHandle-based reflection to using * {@code core} as the scoped module, otherwise this is ignored. * @return An {@link ReflectiveInvoker} instance that will invoke the constructor. * @throws NullPointerException If {@code constructor} is null. * @throws Exception If the {@link ReflectiveInvoker} cannot be created. */ public static ReflectiveInvoker getConstructorInvoker(Class targetClass, Constructor constructor, - boolean scopeToAzureCore) throws Exception { + boolean scopeToClientCore) throws Exception { if (constructor == null) { throw LOGGER.logThrowableAsError(new NullPointerException("'constructor' cannot be null.")); } targetClass = (targetClass == null) ? constructor.getDeclaringClass() : targetClass; - return INSTANCE.getConstructorInvoker(targetClass, constructor, scopeToAzureCore); + return INSTANCE.getConstructorInvoker(targetClass, constructor, scopeToClientCore); } /** diff --git a/sdk/clientcore/core/src/main/java/io/clientcore/core/implementation/http/rest/RangeReplaceSubstitution.java b/sdk/clientcore/core/src/main/java/io/clientcore/core/implementation/http/rest/RangeReplaceSubstitution.java index bf9ce39cbc1a9..9fb1e15fe6924 100644 --- a/sdk/clientcore/core/src/main/java/io/clientcore/core/implementation/http/rest/RangeReplaceSubstitution.java +++ b/sdk/clientcore/core/src/main/java/io/clientcore/core/implementation/http/rest/RangeReplaceSubstitution.java @@ -11,7 +11,7 @@ * A range replace substitution is a substitution that replaces a range of characters in a String with the supplied * value. This type of substitution is commonly used for host and path replacements where the Swagger interface will * have a definition such as {@code @Host("{uri}")} which will be replaced with a value such as - * {@code https://myhost.com}. + * {@code https://somecloud.com}. *

    * Before the introduction of this replacement {@link String#replace(CharSequence, CharSequence)} was used which would * generate a {@code Pattern} to perform replacing. diff --git a/sdk/clientcore/core/src/main/java/io/clientcore/core/implementation/http/serializer/HttpResponseDecodeData.java b/sdk/clientcore/core/src/main/java/io/clientcore/core/implementation/http/serializer/HttpResponseDecodeData.java index f95c65c5eade4..26c5cc5db92a2 100644 --- a/sdk/clientcore/core/src/main/java/io/clientcore/core/implementation/http/serializer/HttpResponseDecodeData.java +++ b/sdk/clientcore/core/src/main/java/io/clientcore/core/implementation/http/serializer/HttpResponseDecodeData.java @@ -97,7 +97,7 @@ default boolean isReturnTypeDecodable() { * Whether the return type contains strongly-typed headers. *

    * If the response contains strongly-typed headers this is an indication to the HttpClient that the headers should - * be eagerly converted from the header format used by the HttpClient implementation to Azure Core HttpHeaders. + * be eagerly converted from the header format used by the HttpClient implementation to Client Core HttpHeaders. * * @return Whether the return type contains strongly-typed headers. */ diff --git a/sdk/clientcore/core/src/main/java/io/clientcore/core/implementation/util/DefaultLogger.java b/sdk/clientcore/core/src/main/java/io/clientcore/core/implementation/util/DefaultLogger.java index e2a5fd400b5ef..18c3e58042d49 100644 --- a/sdk/clientcore/core/src/main/java/io/clientcore/core/implementation/util/DefaultLogger.java +++ b/sdk/clientcore/core/src/main/java/io/clientcore/core/implementation/util/DefaultLogger.java @@ -19,10 +19,9 @@ * This class is an internal implementation of slf4j logger. */ public final class DefaultLogger { - // The template for the log message: // YYYY-MM-DD HH:MM:ss.SSS [thread] [level] classpath - message - // E.g: 2020-01-09 12:35:14.232 [main] [WARN] com.azure.core.DefaultLogger - This is my log message. + // E.g: 2020-01-09 12:35:14.232 [main] [WARN] io.clientcore.core.DefaultLogger - This is my log message. private static final String WHITESPACE = " "; private static final String HYPHEN = " - "; private static final String OPEN_BRACKET = " ["; diff --git a/sdk/clientcore/core/src/main/java/io/clientcore/core/implementation/util/UriBuilder.java b/sdk/clientcore/core/src/main/java/io/clientcore/core/implementation/util/UriBuilder.java index 77868512b8cc3..96f08637f66d2 100644 --- a/sdk/clientcore/core/src/main/java/io/clientcore/core/implementation/util/UriBuilder.java +++ b/sdk/clientcore/core/src/main/java/io/clientcore/core/implementation/util/UriBuilder.java @@ -220,9 +220,6 @@ public UriBuilder clearQuery() { public Map getQuery() { initializeQuery(); - // This contains a map of key=value query parameters, replacing - // multiple values for a single key with a list of values under the same name, - // joined together with a comma. As discussed in https://github.com/Azure/azure-sdk-for-java/pull/21203. return query.entrySet() .stream() // get all parameters joined by a comma. diff --git a/sdk/clientcore/core/src/main/java/io/clientcore/core/serialization/json/implementation/StringBuilderWriter.java b/sdk/clientcore/core/src/main/java/io/clientcore/core/serialization/json/implementation/StringBuilderWriter.java index 93b61b80cf532..29ef9e9e84c3f 100644 --- a/sdk/clientcore/core/src/main/java/io/clientcore/core/serialization/json/implementation/StringBuilderWriter.java +++ b/sdk/clientcore/core/src/main/java/io/clientcore/core/serialization/json/implementation/StringBuilderWriter.java @@ -8,9 +8,7 @@ import java.util.Objects; /** - * Implementation of {@link Writer} that write content to a {@link StringBuilder}. This is copied directly from - * sdk/core/azure-core/src/main/java/com/azure/core/implementation/StringBuilderWriter.java in order to avoid a - * dependency on azure-core. + * Implementation of {@link Writer} that write content to a {@link StringBuilder}. *

    * Given the backing store of this {@link Writer} is a {@link StringBuilder} this is not thread-safe. */ diff --git a/sdk/clientcore/core/src/main/java/io/clientcore/core/serialization/json/implementation/jackson/core/sym/CharsToNameCanonicalizer.java b/sdk/clientcore/core/src/main/java/io/clientcore/core/serialization/json/implementation/jackson/core/sym/CharsToNameCanonicalizer.java index a5864d690ddbe..4db3ccd56059e 100644 --- a/sdk/clientcore/core/src/main/java/io/clientcore/core/serialization/json/implementation/jackson/core/sym/CharsToNameCanonicalizer.java +++ b/sdk/clientcore/core/src/main/java/io/clientcore/core/serialization/json/implementation/jackson/core/sym/CharsToNameCanonicalizer.java @@ -82,10 +82,9 @@ public final class CharsToNameCanonicalizer { * collision chains. * Started with static value of 100 entries for the longest legal chain, * but increased in Jackson 2.13 to 150 to work around specific test case. - *

    + *

    * Note: longest chain we have been able to produce without malicious - * intent has been 38 (with "com.azure.json.implementation.jackson.core.main.TestWithTonsaSymbols"); - * our setting should be reasonable here. + * intent has been 38, so our setting should be reasonable here. * * @since 2.1 (changed in 2.13) */ diff --git a/sdk/clientcore/core/src/main/java/io/clientcore/core/serialization/json/implementation/jackson/core/util/BufferRecyclers.java b/sdk/clientcore/core/src/main/java/io/clientcore/core/serialization/json/implementation/jackson/core/util/BufferRecyclers.java index a2a0781f18938..b27de97aac696 100644 --- a/sdk/clientcore/core/src/main/java/io/clientcore/core/serialization/json/implementation/jackson/core/util/BufferRecyclers.java +++ b/sdk/clientcore/core/src/main/java/io/clientcore/core/serialization/json/implementation/jackson/core/util/BufferRecyclers.java @@ -20,7 +20,7 @@ public class BufferRecyclers { * @since 2.9.6 */ public final static String SYSTEM_PROPERTY_TRACK_REUSABLE_BUFFERS - = "com.azure.json.implementation.jackson.core.util.BufferRecyclers.trackReusableBuffers"; + = "io.clientcore.core.serialization.json.implementation.jackson.core.util.BufferRecyclers.trackReusableBuffers"; /* * /********************************************************** diff --git a/sdk/clientcore/core/src/main/java/io/clientcore/core/serialization/json/package-info.java b/sdk/clientcore/core/src/main/java/io/clientcore/core/serialization/json/package-info.java index 5424eb7582ce8..5d4598413f6e9 100644 --- a/sdk/clientcore/core/src/main/java/io/clientcore/core/serialization/json/package-info.java +++ b/sdk/clientcore/core/src/main/java/io/clientcore/core/serialization/json/package-info.java @@ -2,16 +2,16 @@ // Licensed under the MIT License. /** - *

    The Azure JSON library provides interfaces for stream-style JSON reading and writing. Stream-style reading and - * writing has the type itself define how to read JSON to create an instance of itself and how it writes out to JSON. - * Azure JSON also allows for external implementations for JSON reading and writing by offering a + *

    The Client Core JSON library provides interfaces for stream-style JSON reading and writing. Stream-style reading + * and writing has the type itself define how to read JSON to create an instance of itself and how it writes out to + * JSON. Client Core JSON also allows for external implementations for JSON reading and writing by offering a * service provider interface to load - * implementations from the classpath. However, if one is not found, the Azure JSON library provides a default + * implementations from the classpath. However, if one is not found, the Client Core JSON library provides a default * implementation.

    * *

    Getting Started

    * - *

    {@link io.clientcore.core.serialization.json.JsonSerializable} is the base of Azure JSON: it's the interface that types implement to + *

    {@link io.clientcore.core.serialization.json.JsonSerializable} is the base of Client Core JSON: it's the interface that types implement to * provide stream-style JSON reading and writing functionality. The interface has a single implementable method * {@link io.clientcore.core.serialization.json.JsonSerializable#toJson(io.clientcore.core.serialization.json.JsonWriter) toJson(JsonWriter)} that defines how the * object is written as JSON, to the {@link io.clientcore.core.serialization.json.JsonWriter}, and a static method @@ -394,7 +394,7 @@ * *

    {@link io.clientcore.core.serialization.json.JsonProviders} is a utility class that handles finding {@link io.clientcore.core.serialization.json.JsonProvider} * implementations on the classpath and should be the default way to create instances of - * {@link io.clientcore.core.serialization.json.JsonReader} and {@link io.clientcore.core.serialization.json.JsonWriter}. As mentioned earlier, the Azure JSON + * {@link io.clientcore.core.serialization.json.JsonReader} and {@link io.clientcore.core.serialization.json.JsonWriter}. As mentioned earlier, the Client Core JSON * package provides a default implementation allowing for the library to be used stand-alone. * {@link io.clientcore.core.serialization.json.JsonReader} can be created from {@code byte[]}, {@link java.lang.String}, * {@link java.io.InputStream}, and {@link java.io.Reader} sources, {@link io.clientcore.core.serialization.json.JsonWriter} can be created @@ -437,7 +437,7 @@ * + "\"threads\"16\",\"manufacturer\":\"Processor Corp\",\"clockSpeedInHertz\":4000000000," * + "\"releaseDate\":\"2023-01-01\"},\"Memory\":{\"memoryInBytes\":10000000000," * + "\"clockSpeedInHertz\":4800000000,\"manufacturer\":\"Memory Corp\",\"errorCorrecting\":true}," - * + "\"AcceleratedNetwork\":true,\"CloudProvider\":\"Azure\",\"Available\":true}") + * + "\"AcceleratedNetwork\":true,\"CloudProvider\":\"SomeCloud\",\"Available\":true}") * .getBytes(StandardCharsets.UTF_8)); * * try (JsonReader jsonReader = JsonProviders.createReader(json)) { @@ -454,7 +454,7 @@ * + "\"manufacturer\":\"Processor Corp\",\"clockSpeedInHertz\":4000000000,\"releaseDate\":\"2023-01-01\"}," * + "\"Memory\":{\"memoryInBytes\":10000000000,\"clockSpeedInHertz\":4800000000," * + "\"manufacturer\":\"Memory Corp\",\"errorCorrecting\":true},\"AcceleratedNetwork\":true," - * + "\"CloudProvider\":\"Azure\",\"Available\":true}"); + * + "\"CloudProvider\":\"SomeCloud\",\"Available\":true}"); * * try (JsonReader jsonReader = JsonProviders.createReader(json)) { * return VmStatistics.fromJson(jsonReader); @@ -467,7 +467,7 @@ * *

      * Map<String, Object> additionalVmProperties = new LinkedHashMap<>();
    - * additionalVmProperties.put("CloudProvider", "Azure");
    + * additionalVmProperties.put("CloudProvider", "SomeCloud");
      * additionalVmProperties.put("Available", true);
      *
      * VmStatistics vmStatistics = new VmStatistics("large",
    @@ -489,7 +489,7 @@
      * // {"VMSize":"large","Processor":{"cores":8,"threads":16,"manufacturer":"Processor Corp",
      * //   "clockSpeedInHertz":4000000000.0,"releaseDate":"2023-01-01"},"Memory":{"memoryInBytes":10000000000,
      * //   "clockSpeedInHertz":4800000000.0,"manufacturer":"Memory Corp","errorCorrecting":true},
    - * //   "AcceleratedNetwork":true,"CloudProvider":"Azure","Available":true}
    + * //   "AcceleratedNetwork":true,"CloudProvider":"SomeCloud","Available":true}
      * System.out.println(json);
      * 
    * @@ -499,7 +499,7 @@ * *
      * Map<String, Object> additionalVmProperties = new LinkedHashMap<>();
    - * additionalVmProperties.put("CloudProvider", "Azure");
    + * additionalVmProperties.put("CloudProvider", "SomeCloud");
      * additionalVmProperties.put("Available", true);
      *
      * VmStatistics vmStatistics = new VmStatistics("large",
    @@ -521,7 +521,7 @@
      * // {"VMSize":"large","Processor":{"cores":8,"threads":16,"manufacturer":"Processor Corp",
      * //   "clockSpeedInHertz":4000000000.0,"releaseDate":"2023-01-01"},"Memory":{"memoryInBytes":10000000000,
      * //   "clockSpeedInHertz":4800000000.0,"manufacturer":"Memory Corp","errorCorrecting":true},
    - * //   "AcceleratedNetwork":true,"CloudProvider":"Azure","Available":true}
    + * //   "AcceleratedNetwork":true,"CloudProvider":"SomeCloud","Available":true}
      * System.out.println(json);
      * 
    * diff --git a/sdk/clientcore/core/src/main/java/io/clientcore/core/util/ClientLogger.java b/sdk/clientcore/core/src/main/java/io/clientcore/core/util/ClientLogger.java index 21743e6fe6b93..32d45120433b5 100644 --- a/sdk/clientcore/core/src/main/java/io/clientcore/core/util/ClientLogger.java +++ b/sdk/clientcore/core/src/main/java/io/clientcore/core/util/ClientLogger.java @@ -33,7 +33,7 @@ * logged.

    * *

    A minimum logging level threshold is determined by the - * {@link Configuration#PROPERTY_LOG_LEVEL AZURE_LOG_LEVEL} environment configuration. By default logging is + * {@link Configuration#PROPERTY_LOG_LEVEL LOG_LEVEL} environment configuration. By default logging is * disabled.

    * *

    The logger is capable of producing json-formatted messages enriched with key value pairs. @@ -498,7 +498,7 @@ private void addKeyValueInternal(String key, Object value) { } /** - * Enum which represent logging levels used in Azure SDKs. + * Enum which represent logging levels used. */ public enum LogLevel { /** diff --git a/sdk/clientcore/core/src/main/java/io/clientcore/core/util/SharedExecutorService.java b/sdk/clientcore/core/src/main/java/io/clientcore/core/util/SharedExecutorService.java index 9562066a27817..bffb558bc42b0 100644 --- a/sdk/clientcore/core/src/main/java/io/clientcore/core/util/SharedExecutorService.java +++ b/sdk/clientcore/core/src/main/java/io/clientcore/core/util/SharedExecutorService.java @@ -192,11 +192,11 @@ public ScheduledExecutorService getExecutorService() { */ public void setExecutorService(ScheduledExecutorService executorService) { // We allow for the global executor service to be set from an external source to allow for consumers of the SDK - // to use their own thread management to run Azure SDK tasks. This allows for the SDKs to perform deeper + // to use their own thread management to run Client Core tasks. This allows for the SDKs to perform deeper // integration into an environment, such as the consumer environment knowing details about capacity, allowing // the custom executor service to better manage resources than our more general 10x the number of processors. // Another scenario could be an executor service that creates threads with specific permissions, such as - // allowing Azure Core or Jackson to perform deep reflection on classes that are not normally allowed. + // allowing Client Core or Jackson to perform deep reflection on classes that are not normally allowed. Objects.requireNonNull(executorService, "'executorService' cannot be null."); if (executorService.isShutdown() || executorService.isTerminated()) { throw LOGGER.logThrowableAsError( diff --git a/sdk/clientcore/core/src/main/java/io/clientcore/core/util/binarydata/BinaryData.java b/sdk/clientcore/core/src/main/java/io/clientcore/core/util/binarydata/BinaryData.java index 18834318e5fd4..d8805abe1d319 100644 --- a/sdk/clientcore/core/src/main/java/io/clientcore/core/util/binarydata/BinaryData.java +++ b/sdk/clientcore/core/src/main/java/io/clientcore/core/util/binarydata/BinaryData.java @@ -94,9 +94,7 @@ *

      * final Person data = new Person().setName("John");
      *
    - * // Provide your custom serializer or use Azure provided serializers.
    - * // https://central.sonatype.com/artifact/io.clientcore/azure-core-serializer-json-jackson or
    - * // https://central.sonatype.com/artifact/io.clientcore/azure-core-serializer-json-gson
    + * // Provide your custom serializer or use the provided serializers.
      * BinaryData binaryData = BinaryData.fromObject(data);
      *
      * System.out.println(binaryData);
    @@ -301,9 +299,7 @@ public static BinaryData fromListByteBuffer(List data) {
          * 
          * final Person data = new Person().setName("John");
          *
    -     * // Provide your custom serializer or use Azure provided serializers.
    -     * // https://central.sonatype.com/artifact/io.clientcore/azure-core-serializer-json-jackson or
    -     * // https://central.sonatype.com/artifact/io.clientcore/azure-core-serializer-json-gson
    +     * // Provide your custom serializer or use the provided serializers.
          * BinaryData binaryData = BinaryData.fromObject(data);
          *
          * System.out.println(binaryData);
    @@ -332,9 +328,7 @@ public static BinaryData fromObject(Object data) {
          * 
          * final Person data = new Person().setName("John");
          *
    -     * // Provide your custom serializer or use Azure provided serializers.
    -     * // https://central.sonatype.com/artifact/io.clientcore/azure-core-serializer-json-jackson or
    -     * // https://central.sonatype.com/artifact/io.clientcore/azure-core-serializer-json-gson
    +     * // Provide your custom serializer or use the provided serializers.
          * final ObjectSerializer serializer = new MyJsonSerializer(); // Replace this with your Serializer
          * BinaryData binaryData = BinaryData.fromObject(data, serializer);
          *
    @@ -515,10 +509,7 @@ public static BinaryData fromFile(Path file, Long position, Long length, int chu
          *
          * // Ensure your classpath have the Serializer to serialize the object which implement implement
          * // io.clientcore.core.serializer.util.JsonSerializer interface.
    -     * // Or use Azure provided libraries for this.
    -     * // https://central.sonatype.com/artifact/io.clientcore/azure-core-serializer-json-jackson or
    -     * // https://central.sonatype.com/artifact/io.clientcore/azure-core-serializer-json-gson
    -     *
    +     * // Or use the provided libraries for this.
          * BinaryData binaryData = BinaryData.fromObject(data);
          *
          * Person person = binaryData.toObject(Person.class);
    @@ -539,11 +530,7 @@ public static BinaryData fromFile(Path file, Long position, Long length, int chu
          *
          * // Ensure your classpath have the Serializer to serialize the object which implement implement
          * // io.clientcore.core.serializer.util.JsonSerializer interface.
    -     * // Or use Azure provided libraries for this.
    -     * // https://central.sonatype.com/artifact/io.clientcore/azure-core-serializer-json-jackson or
    -     * // https://central.sonatype.com/artifact/io.clientcore/azure-core-serializer-json-gson
    -     *
    -     *
    +     * // Or use the provided libraries for this.
          * BinaryData binaryData = BinaryData.fromObject(personList);
          *
          * // Creation of the ParameterizedType could be replaced with a utility method that returns a Type based on the
    @@ -597,10 +584,7 @@ public  T toObject(Type type) throws IOException {
          * 
          * final Person data = new Person().setName("John");
          *
    -     * // Provide your custom serializer or use Azure provided serializers.
    -     * // https://central.sonatype.com/artifact/io.clientcore/azure-core-serializer-json-jackson or
    -     * // https://central.sonatype.com/artifact/io.clientcore/azure-core-serializer-json-gson
    -     *
    +     * // Provide your custom serializer or use the provided serializers.
          * final ObjectSerializer serializer = new MyJsonSerializer(); // Replace this with your Serializer
          * BinaryData binaryData = BinaryData.fromObject(data, serializer);
          *
    diff --git a/sdk/clientcore/core/src/main/java/io/clientcore/core/util/configuration/Configuration.java b/sdk/clientcore/core/src/main/java/io/clientcore/core/util/configuration/Configuration.java
    index c6ab0ab8fdb5c..8b2878c73e94b 100644
    --- a/sdk/clientcore/core/src/main/java/io/clientcore/core/util/configuration/Configuration.java
    +++ b/sdk/clientcore/core/src/main/java/io/clientcore/core/util/configuration/Configuration.java
    @@ -23,7 +23,7 @@
      * 
      * 
      * Configuration configuration = new ConfigurationBuilder(new SampleSource(properties))
    - *     .root("azure.sdk")
    + *     .root("my.sdk")
      *     .buildSection("client-name");
      *
      * ConfigurationProperty<String> proxyHostnameProperty = ConfigurationPropertyBuilder.ofString("http.proxy.hostname")
    @@ -287,8 +287,8 @@ public boolean contains(ConfigurationProperty property) {
          *     .systemPropertyName("http.proxyHost")
          *     .build();
          *
    -     * // attempts to get local `azure.sdk.<client-name>.http.proxy.host` property and falls back to
    -     * // shared azure.sdk.http.proxy.port
    +     * // attempts to get local `my.sdk.<client-name>.http.proxy.host` property and falls back to
    +     * // shared my.sdk.http.proxy.port
          * System.out.println(configuration.get(property));
          * 
    * diff --git a/sdk/clientcore/core/src/main/java/io/clientcore/core/util/configuration/ConfigurationBuilder.java b/sdk/clientcore/core/src/main/java/io/clientcore/core/util/configuration/ConfigurationBuilder.java index 5fa84a651e91d..03e34eba45aea 100644 --- a/sdk/clientcore/core/src/main/java/io/clientcore/core/util/configuration/ConfigurationBuilder.java +++ b/sdk/clientcore/core/src/main/java/io/clientcore/core/util/configuration/ConfigurationBuilder.java @@ -32,8 +32,8 @@ public final class ConfigurationBuilder { * *
          * configuration = new ConfigurationBuilder()
    -     *     .putProperty("azure.sdk.client-name.connection-string", "...")
    -     *     .root("azure.sdk")
    +     *     .putProperty("my.sdk.client-name.connection-string", "...")
    +     *     .root("my.sdk")
          *     .buildSection("client-name");
          *
          * ConfigurationProperty<String> connectionStringProperty = ConfigurationPropertyBuilder.ofString("connection-string")
    @@ -54,7 +54,7 @@ public ConfigurationBuilder() {
          * 
          * 
          * Configuration configuration = new ConfigurationBuilder(new SampleSource(properties))
    -     *     .root("azure.sdk")
    +     *     .root("my.sdk")
          *     .buildSection("client-name");
          *
          * ConfigurationProperty<String> proxyHostnameProperty = ConfigurationPropertyBuilder.ofString("http.proxy.hostname")
    @@ -73,14 +73,12 @@ public ConfigurationBuilder(ConfigurationSource source) {
     
         /**
          * Creates {@code ConfigurationBuilder} with configuration sources for explicit configuration, system properties and
    -     * environment configuration sources. Use this constructor to customize known SDK system properties and
    -     * environment variables retrieval.
    +     * environment configuration sources. Use this constructor to customize known system properties and environment
    +     * variables retrieval.
          *
    -     * @param source Custom {@link ConfigurationSource} containing known SDK configuration properties
    -     * @param systemPropertiesConfigurationSource {@link ConfigurationSource} containing known Azure SDK system
    -     * properties.
    -     * @param environmentConfigurationSource {@link ConfigurationSource} containing known Azure SDK environment
    -     * variables.
    +     * @param source Custom {@link ConfigurationSource} containing known configuration properties
    +     * @param systemPropertiesConfigurationSource {@link ConfigurationSource} containing known system properties.
    +     * @param environmentConfigurationSource {@link ConfigurationSource} containing known environment variables.
          */
         public ConfigurationBuilder(ConfigurationSource source, ConfigurationSource systemPropertiesConfigurationSource,
             ConfigurationSource environmentConfigurationSource) {
    @@ -100,8 +98,8 @@ public ConfigurationBuilder(ConfigurationSource source, ConfigurationSource syst
          * 
          * 
          * configuration = new ConfigurationBuilder()
    -     *     .putProperty("azure.sdk.client-name.connection-string", "...")
    -     *     .root("azure.sdk")
    +     *     .putProperty("my.sdk.client-name.connection-string", "...")
    +     *     .root("my.sdk")
          *     .buildSection("client-name");
          *
          * ConfigurationProperty<String> connectionStringProperty = ConfigurationPropertyBuilder.ofString("connection-string")
    @@ -131,7 +129,7 @@ public ConfigurationBuilder putProperty(String name, String value) {
          * 
          * 
          * Configuration configuration = new ConfigurationBuilder(new SampleSource(properties))
    -     *     .root("azure.sdk")
    +     *     .root("my.sdk")
          *     .buildSection("client-name");
          *
          * ConfigurationProperty<String> proxyHostnameProperty = ConfigurationPropertyBuilder.ofString("http.proxy.hostname")
    @@ -159,7 +157,7 @@ public ConfigurationBuilder root(String rootPath) {
          * 
          * // Builds shared Configuration only.
          * Configuration sharedConfiguration = new ConfigurationBuilder(new SampleSource(properties))
    -     *     .root("azure.sdk")
    +     *     .root("my.sdk")
          *     .build();
          * 
    * @@ -183,7 +181,7 @@ public Configuration build() { *
          * // Builds Configuration for <client-name> with fallback to shared properties.
          * configuration = new ConfigurationBuilder(new SampleSource(properties))
    -     *     .root("azure.sdk")
    +     *     .root("my.sdk")
          *     .buildSection("client-name");
          * 
    * diff --git a/sdk/clientcore/core/src/main/java/io/clientcore/core/util/configuration/ConfigurationPropertyBuilder.java b/sdk/clientcore/core/src/main/java/io/clientcore/core/util/configuration/ConfigurationPropertyBuilder.java index 876f3394b723e..0de4e5913dbde 100644 --- a/sdk/clientcore/core/src/main/java/io/clientcore/core/util/configuration/ConfigurationPropertyBuilder.java +++ b/sdk/clientcore/core/src/main/java/io/clientcore/core/util/configuration/ConfigurationPropertyBuilder.java @@ -53,8 +53,8 @@ public final class ConfigurationPropertyBuilder { * .systemPropertyName("http.proxyHost") * .build(); * - * // attempts to get local `azure.sdk.<client-name>.http.proxy.host` property and falls back to - * // shared azure.sdk.http.proxy.port + * // attempts to get local `my.sdk.<client-name>.http.proxy.host` property and falls back to + * // shared my.sdk.http.proxy.port * System.out.println(configuration.get(property)); *
    * diff --git a/sdk/clientcore/core/src/samples/java/io/clientcore/core/http/annotation/AnnotationJavadocCodesnippets.java b/sdk/clientcore/core/src/samples/java/io/clientcore/core/http/annotation/AnnotationJavadocCodesnippets.java index 6f02738276300..8dd561ced8218 100644 --- a/sdk/clientcore/core/src/samples/java/io/clientcore/core/http/annotation/AnnotationJavadocCodesnippets.java +++ b/sdk/clientcore/core/src/samples/java/io/clientcore/core/http/annotation/AnnotationJavadocCodesnippets.java @@ -12,7 +12,7 @@ import java.util.Map; /** - * Javadoc codesnippets for {@link com.azure.core.annotation} classes. + * Javadoc codesnippets for {@link io.clientcore.core.annotation} classes. */ @SuppressWarnings("ALL") public interface AnnotationJavadocCodesnippets { @@ -191,7 +191,7 @@ void getUploadUriForEntityType(@PathParam("resourceGroupName") String resourceGr */ interface HostExamples { // BEGIN: io.clientcore.core.http.annotation.Host.class1 - @ServiceInterface(name = "VirtualMachinesService", host = "https://management.azure.com") + @ServiceInterface(name = "VirtualMachinesService", host = "https://management.somecloud.com") interface VirtualMachinesService { @HttpRequestInformation(method = HttpMethod.GET, path = "/subscriptions/{subscriptionId}/resourceGroups/" + "{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}", @@ -202,11 +202,11 @@ VirtualMachine getByResourceGroup(@PathParam("resourceGroupName") String rgName, // END: io.clientcore.core.http.annotation.Host.class1 // BEGIN: io.clientcore.core.http.annotation.Host.class2 - @ServiceInterface(name = "KeyVaultService", host = "https://{vaultName}.vault.azure.net:443") - interface KeyVaultService { + @ServiceInterface(name = "SecretsService", host = "https://{instance}.somecloud.com:443") + interface SecretsService { @HttpRequestInformation(method = HttpMethod.GET, path = "secrets/{secretName}", returnValueWireType = Secret.class) - Secret get(@HostParam("vaultName") String vaultName, @PathParam("secretName") String secretName); + Secret get(@HostParam("instance") String vaultName, @PathParam("secretName") String secretName); } // END: io.clientcore.core.http.annotation.Host.class2 } @@ -336,7 +336,7 @@ void restart(@PathParam("resourceGroupName") String rgName, @PathParam("vmName") // END: io.clientcore.core.http.annotation.Post.class1 // BEGIN: io.clientcore.core.http.annotation.Post.class2 - @HttpRequestInformation(method = HttpMethod.POST, path = "https://{functionApp}.azurewebsites.net/admin/" + @HttpRequestInformation(method = HttpMethod.POST, path = "https://{functionApp}.somecloud.com/admin/" + "functions/{name}/keys/{keyName}", returnValueWireType = KeyValuePair.class) KeyValuePair generateFunctionKey(@PathParam("functionApp") String functionApp, @PathParam("name") String name, @PathParam("keyName") String keyName); diff --git a/sdk/clientcore/core/src/samples/java/io/clientcore/core/models/BinaryDataJavaDocCodeSnippet.java b/sdk/clientcore/core/src/samples/java/io/clientcore/core/models/BinaryDataJavaDocCodeSnippet.java index d11eb8868155d..7685a365aec21 100644 --- a/sdk/clientcore/core/src/samples/java/io/clientcore/core/models/BinaryDataJavaDocCodeSnippet.java +++ b/sdk/clientcore/core/src/samples/java/io/clientcore/core/models/BinaryDataJavaDocCodeSnippet.java @@ -152,9 +152,7 @@ public void fromObjectDefaultJsonSerializers() { // BEGIN: io.clientcore.core.util.BinaryData.fromObject#Object final Person data = new Person().setName("John"); - // Provide your custom serializer or use Azure provided serializers. - // https://central.sonatype.com/artifact/io.clientcore/azure-core-serializer-json-jackson or - // https://central.sonatype.com/artifact/io.clientcore/azure-core-serializer-json-gson + // Provide your custom serializer or use the provided serializers. BinaryData binaryData = BinaryData.fromObject(data); System.out.println(binaryData); @@ -172,9 +170,7 @@ public void fromObjectObjectSerializer() { // BEGIN: io.clientcore.core.util.BinaryData.fromObject#Object-ObjectSerializer final Person data = new Person().setName("John"); - // Provide your custom serializer or use Azure provided serializers. - // https://central.sonatype.com/artifact/io.clientcore/azure-core-serializer-json-jackson or - // https://central.sonatype.com/artifact/io.clientcore/azure-core-serializer-json-gson + // Provide your custom serializer or use the provided serializers. final ObjectSerializer serializer = new MyJsonSerializer(); // Replace this with your Serializer BinaryData binaryData = BinaryData.fromObject(data, serializer); @@ -191,10 +187,7 @@ public void toObjectTypeDefaultJsonSerializer() throws IOException { // Ensure your classpath have the Serializer to serialize the object which implement implement // io.clientcore.core.serializer.util.JsonSerializer interface. - // Or use Azure provided libraries for this. - // https://central.sonatype.com/artifact/io.clientcore/azure-core-serializer-json-jackson or - // https://central.sonatype.com/artifact/io.clientcore/azure-core-serializer-json-gson - + // Or use the provided libraries for this. BinaryData binaryData = BinaryData.fromObject(data); Person person = binaryData.toObject(Person.class); @@ -216,11 +209,7 @@ public void toObjectTypeDefaultJsonSerializerWithGenerics() throws IOException { // Ensure your classpath have the Serializer to serialize the object which implement implement // io.clientcore.core.serializer.util.JsonSerializer interface. - // Or use Azure provided libraries for this. - // https://central.sonatype.com/artifact/io.clientcore/azure-core-serializer-json-jackson or - // https://central.sonatype.com/artifact/io.clientcore/azure-core-serializer-json-gson - - + // Or use the provided libraries for this. BinaryData binaryData = BinaryData.fromObject(personList); // Creation of the ParameterizedType could be replaced with a utility method that returns a Type based on the @@ -252,10 +241,7 @@ public void toObjectTypeObjectSerializer() throws IOException { // BEGIN: io.clientcore.core.util.BinaryData.toObject#Type-ObjectSerializer final Person data = new Person().setName("John"); - // Provide your custom serializer or use Azure provided serializers. - // https://central.sonatype.com/artifact/io.clientcore/azure-core-serializer-json-jackson or - // https://central.sonatype.com/artifact/io.clientcore/azure-core-serializer-json-gson - + // Provide your custom serializer or use the provided serializers. final ObjectSerializer serializer = new MyJsonSerializer(); // Replace this with your Serializer BinaryData binaryData = BinaryData.fromObject(data, serializer); diff --git a/sdk/clientcore/core/src/samples/java/io/clientcore/core/serialization/json/codesnippets/ReadingJsonExamples.java b/sdk/clientcore/core/src/samples/java/io/clientcore/core/serialization/json/codesnippets/ReadingJsonExamples.java index c7466f53b39f7..58e9139a67dcb 100644 --- a/sdk/clientcore/core/src/samples/java/io/clientcore/core/serialization/json/codesnippets/ReadingJsonExamples.java +++ b/sdk/clientcore/core/src/samples/java/io/clientcore/core/serialization/json/codesnippets/ReadingJsonExamples.java @@ -44,7 +44,7 @@ public VmStatistics readJsonInputStream() throws IOException { + "\"threads\"16\",\"manufacturer\":\"Processor Corp\",\"clockSpeedInHertz\":4000000000," + "\"releaseDate\":\"2023-01-01\"},\"Memory\":{\"memoryInBytes\":10000000000," + "\"clockSpeedInHertz\":4800000000,\"manufacturer\":\"Memory Corp\",\"errorCorrecting\":true}," - + "\"AcceleratedNetwork\":true,\"CloudProvider\":\"Azure\",\"Available\":true}") + + "\"AcceleratedNetwork\":true,\"CloudProvider\":\"SomeCloud\",\"Available\":true}") .getBytes(StandardCharsets.UTF_8)); try (JsonReader jsonReader = JsonProviders.createReader(json)) { @@ -59,7 +59,7 @@ public VmStatistics readJsonReader() throws IOException { + "\"manufacturer\":\"Processor Corp\",\"clockSpeedInHertz\":4000000000,\"releaseDate\":\"2023-01-01\"}," + "\"Memory\":{\"memoryInBytes\":10000000000,\"clockSpeedInHertz\":4800000000," + "\"manufacturer\":\"Memory Corp\",\"errorCorrecting\":true},\"AcceleratedNetwork\":true," - + "\"CloudProvider\":\"Azure\",\"Available\":true}"); + + "\"CloudProvider\":\"SomeCloud\",\"Available\":true}"); try (JsonReader jsonReader = JsonProviders.createReader(json)) { return VmStatistics.fromJson(jsonReader); diff --git a/sdk/clientcore/core/src/samples/java/io/clientcore/core/serialization/json/codesnippets/WritingJsonExamples.java b/sdk/clientcore/core/src/samples/java/io/clientcore/core/serialization/json/codesnippets/WritingJsonExamples.java index 6365941ec26cb..57b449cd9e046 100644 --- a/sdk/clientcore/core/src/samples/java/io/clientcore/core/serialization/json/codesnippets/WritingJsonExamples.java +++ b/sdk/clientcore/core/src/samples/java/io/clientcore/core/serialization/json/codesnippets/WritingJsonExamples.java @@ -18,7 +18,7 @@ public class WritingJsonExamples { public void writeJsonOutputStream() throws IOException { // BEGIN: io.clientcore.core.serialization.json.JsonWriter.writeJsonOutputStream Map additionalVmProperties = new LinkedHashMap<>(); - additionalVmProperties.put("CloudProvider", "Azure"); + additionalVmProperties.put("CloudProvider", "SomeCloud"); additionalVmProperties.put("Available", true); VmStatistics vmStatistics = new VmStatistics("large", @@ -40,7 +40,7 @@ public void writeJsonOutputStream() throws IOException { // {"VMSize":"large","Processor":{"cores":8,"threads":16,"manufacturer":"Processor Corp", // "clockSpeedInHertz":4000000000.0,"releaseDate":"2023-01-01"},"Memory":{"memoryInBytes":10000000000, // "clockSpeedInHertz":4800000000.0,"manufacturer":"Memory Corp","errorCorrecting":true}, - // "AcceleratedNetwork":true,"CloudProvider":"Azure","Available":true} + // "AcceleratedNetwork":true,"CloudProvider":"SomeCloud","Available":true} System.out.println(json); // END: io.clientcore.core.serialization.json.JsonWriter.writeJsonOutputStream } @@ -48,7 +48,7 @@ public void writeJsonOutputStream() throws IOException { public void writeJsonWriter() throws IOException { // BEGIN: io.clientcore.core.serialization.json.JsonWriter.writeJsonWriter Map additionalVmProperties = new LinkedHashMap<>(); - additionalVmProperties.put("CloudProvider", "Azure"); + additionalVmProperties.put("CloudProvider", "SomeCloud"); additionalVmProperties.put("Available", true); VmStatistics vmStatistics = new VmStatistics("large", @@ -70,7 +70,7 @@ public void writeJsonWriter() throws IOException { // {"VMSize":"large","Processor":{"cores":8,"threads":16,"manufacturer":"Processor Corp", // "clockSpeedInHertz":4000000000.0,"releaseDate":"2023-01-01"},"Memory":{"memoryInBytes":10000000000, // "clockSpeedInHertz":4800000000.0,"manufacturer":"Memory Corp","errorCorrecting":true}, - // "AcceleratedNetwork":true,"CloudProvider":"Azure","Available":true} + // "AcceleratedNetwork":true,"CloudProvider":"SomeCloud","Available":true} System.out.println(json); // END: io.clientcore.core.serialization.json.JsonWriter.writeJsonWriter } diff --git a/sdk/clientcore/core/src/samples/java/io/clientcore/core/util/ConfigurationJavaDocCodeSnippet.java b/sdk/clientcore/core/src/samples/java/io/clientcore/core/util/ConfigurationJavaDocCodeSnippet.java index 137fe3aad271d..839b3e61f1a56 100644 --- a/sdk/clientcore/core/src/samples/java/io/clientcore/core/util/ConfigurationJavaDocCodeSnippet.java +++ b/sdk/clientcore/core/src/samples/java/io/clientcore/core/util/ConfigurationJavaDocCodeSnippet.java @@ -45,14 +45,14 @@ public Map getProperties(String path) { */ public void configurationBuilderUsage() { Map properties = new HashMap<>(); - properties.put("azure.sdk.client-name.http.proxy.port", "8080"); - properties.put("azure.sdk.http.proxy.hostname", " proxyHostnameProperty = ConfigurationPropertyBuilder.ofString("http.proxy.hostname") @@ -63,8 +63,8 @@ public void configurationBuilderUsage() { // BEGIN: io.clientcore.core.util.ConfigurationBuilder#putProperty configuration = new ConfigurationBuilder() - .putProperty("azure.sdk.client-name.connection-string", "...") - .root("azure.sdk") + .putProperty("my.sdk.client-name.connection-string", "...") + .root("my.sdk") .buildSection("client-name"); ConfigurationProperty connectionStringProperty = ConfigurationPropertyBuilder.ofString("connection-string") @@ -76,14 +76,14 @@ public void configurationBuilderUsage() { // BEGIN: io.clientcore.core.util.ConfigurationBuilder#buildSection // Builds Configuration for with fallback to shared properties. configuration = new ConfigurationBuilder(new SampleSource(properties)) - .root("azure.sdk") + .root("my.sdk") .buildSection("client-name"); // END: io.clientcore.core.util.ConfigurationBuilder#buildSection // BEGIN: io.clientcore.core.util.ConfigurationBuilder#build // Builds shared Configuration only. Configuration sharedConfiguration = new ConfigurationBuilder(new SampleSource(properties)) - .root("azure.sdk") + .root("my.sdk") .build(); // END: io.clientcore.core.util.ConfigurationBuilder#build } @@ -93,13 +93,13 @@ public void configurationBuilderUsage() { */ public void configurationUsage() { Map properties = new HashMap<>(); - properties.put("azure.sdk..http.proxy.port", "8080"); - properties.put("azure.sdk.http.proxy.hostname", ".http.proxy.port", "8080"); + properties.put("my.sdk.http.proxy.hostname", ""); // BEGIN: io.clientcore.core.util.Configuration.get#ConfigurationProperty @@ -109,8 +109,8 @@ public void configurationUsage() { .systemPropertyName("http.proxyHost") .build(); - // attempts to get local `azure.sdk..http.proxy.host` property and falls back to - // shared azure.sdk.http.proxy.port + // attempts to get local `my.sdk..http.proxy.host` property and falls back to + // shared my.sdk.http.proxy.port System.out.println(configuration.get(property)); // END: io.clientcore.core.util.Configuration.get#ConfigurationProperty } @@ -120,13 +120,13 @@ public void configurationUsage() { */ public void configurationPropertyUsage() { Map properties = new HashMap<>(); - properties.put("azure.sdk.sample.timeout", "1000"); - properties.put("azure.sdk.sample.retry-count", "3"); - properties.put("azure.sdk.sample.is-enabled", "true"); - properties.put("azure.sdk.sample.mode", "mode1"); + properties.put("my.sdk.sample.timeout", "1000"); + properties.put("my.sdk.sample.retry-count", "3"); + properties.put("my.sdk.sample.is-enabled", "true"); + properties.put("my.sdk.sample.mode", "mode1"); Configuration configuration = new ConfigurationBuilder(new SampleSource(properties)) - .root("azure.sdk") + .root("my.sdk") .buildSection("sample"); // BEGIN: io.clientcore.core.util.ConfigurationPropertyBuilder.ofDuration diff --git a/sdk/clientcore/core/src/test/java/io/clientcore/core/http/RestProxyTests.java b/sdk/clientcore/core/src/test/java/io/clientcore/core/http/RestProxyTests.java index 7944835f90a04..814063ec25fca 100644 --- a/sdk/clientcore/core/src/test/java/io/clientcore/core/http/RestProxyTests.java +++ b/sdk/clientcore/core/src/test/java/io/clientcore/core/http/RestProxyTests.java @@ -40,7 +40,7 @@ * Tests {@link RestProxy}. */ public class RestProxyTests { - @ServiceInterface(name = "myService", host = "https://azure.com") + @ServiceInterface(name = "myService", host = "https://somecloud.com") interface TestInterface { @HttpRequestInformation(method = HttpMethod.POST, path = "my/uri/path", expectedStatusCodes = { 200 }) Response testMethod(@BodyParam("application/octet-stream") ByteBuffer request, @@ -86,7 +86,6 @@ public void streamResponseShouldHaveHttpResponseReference() { HttpPipeline pipeline = new HttpPipelineBuilder() .httpClient(client) .build(); - TestInterface testInterface = RestProxy.create(TestInterface.class, pipeline, new JsonSerializer()); StreamResponse streamResponse = testInterface.testDownload(); @@ -205,7 +204,7 @@ public HttpRequest getLastHttpRequest() { @Test public void doesNotChangeEncodedPath() throws IOException { String nextLinkUri - = "https://management.azure.com:443/subscriptions/000/resourceGroups/rg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines?api-version=2021-11-01&$skiptoken=Mzk4YzFjMzMtM2IwMC00OWViLWI2NGYtNjg4ZTRmZGQ1Nzc2IS9TdWJzY3JpcHRpb25zL2VjMGFhNWY3LTllNzgtNDBjOS04NWNkLTUzNWM2MzA1YjM4MC9SZXNvdXJjZUdyb3Vwcy9SRy1XRUlEWFUtVk1TUy9WTVNjYWxlU2V0cy9WTVNTMS9WTXMvNzc="; + = "https://management.somecloud.com:443/subscriptions/000/resourceGroups/rg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines?api-version=2021-11-01&$skiptoken=Mzk4YzFjMzMtM2IwMC00OWViLWI2NGYtNjg4ZTRmZGQ1Nzc2IS9TdWJzY3JpcHRpb25zL2VjMGFhNWY3LTllNzgtNDBjOS04NWNkLTUzNWM2MzA1YjM4MC9SZXNvdXJjZUdyb3Vwcy9SRy1XRUlEWFUtVk1TUy9WTVNjYWxlU2V0cy9WTVNTMS9WTXMvNzc="; HttpPipeline pipeline = new HttpPipelineBuilder().httpClient((request) -> { assertEquals(nextLinkUri, request.getUri().toString()); diff --git a/sdk/clientcore/core/src/test/java/io/clientcore/core/implementation/http/rest/RestProxyImplTests.java b/sdk/clientcore/core/src/test/java/io/clientcore/core/implementation/http/rest/RestProxyImplTests.java index b77ea45afadbe..692d6d36f80ff 100644 --- a/sdk/clientcore/core/src/test/java/io/clientcore/core/implementation/http/rest/RestProxyImplTests.java +++ b/sdk/clientcore/core/src/test/java/io/clientcore/core/implementation/http/rest/RestProxyImplTests.java @@ -47,7 +47,7 @@ public class RestProxyImplTests { private static final String SAMPLE = "sample"; private static final byte[] EXPECTED = SAMPLE.getBytes(StandardCharsets.UTF_8); - @ServiceInterface(name = "myService", host = "https://azure.com") + @ServiceInterface(name = "myService", host = "https://somecloud.com") interface TestInterface { @HttpRequestInformation(method = HttpMethod.POST, path = "my/uri/path", expectedStatusCodes = { 200 }) Response testMethod(@BodyParam("application/octet-stream") BinaryData data, diff --git a/sdk/clientcore/core/src/test/java/io/clientcore/core/implementation/http/rest/SwaggerInterfaceParserTests.java b/sdk/clientcore/core/src/test/java/io/clientcore/core/implementation/http/rest/SwaggerInterfaceParserTests.java index 5227674d814d4..b5247bb8e9c45 100644 --- a/sdk/clientcore/core/src/test/java/io/clientcore/core/implementation/http/rest/SwaggerInterfaceParserTests.java +++ b/sdk/clientcore/core/src/test/java/io/clientcore/core/implementation/http/rest/SwaggerInterfaceParserTests.java @@ -23,7 +23,7 @@ interface TestInterface1 { interface TestInterface2 { } - @ServiceInterface(name = "myService", host = "https://management.azure.com") + @ServiceInterface(name = "myService", host = "https://management.somecloud.com") interface TestInterface3 { } @@ -43,11 +43,11 @@ public void serviceWithNoHostInServiceInterfaceAnnotation() { @Test public void serviceWithServiceInterfaceAnnotation() { final SwaggerInterfaceParser interfaceParser = SwaggerInterfaceParser.getInstance(TestInterface3.class); - assertEquals("https://management.azure.com", interfaceParser.getHost()); + assertEquals("https://management.somecloud.com", interfaceParser.getHost()); assertEquals("myService", interfaceParser.getServiceName()); } - @ServiceInterface(name = "myService", host = "https://azure.com") + @ServiceInterface(name = "myService", host = "https://somecloud.com") interface TestInterface4 { @HttpRequestInformation(method = HttpMethod.GET, path = "my/uri/path", expectedStatusCodes = { 200 }) void testMethod4(); diff --git a/sdk/clientcore/core/src/test/java/io/clientcore/core/implementation/serializer/HttpResponseBodyDecoderTests.java b/sdk/clientcore/core/src/test/java/io/clientcore/core/implementation/serializer/HttpResponseBodyDecoderTests.java index 7a72940183634..0c191616f4bb3 100644 --- a/sdk/clientcore/core/src/test/java/io/clientcore/core/implementation/serializer/HttpResponseBodyDecoderTests.java +++ b/sdk/clientcore/core/src/test/java/io/clientcore/core/implementation/serializer/HttpResponseBodyDecoderTests.java @@ -186,13 +186,13 @@ private static Stream decodableResponseSupplier() { ParameterizedType stringList = mockParameterizedType(List.class, String.class); HttpResponseDecodeData stringListDecodeData = new MockHttpResponseDecodeData(200, stringList, String.class, true); - List list = Arrays.asList("hello", "azure"); + List list = Arrays.asList("hello", "world"); Response stringListResponse = new MockHttpResponse(GET_REQUEST, 200, list); ParameterizedType mapStringString = mockParameterizedType(Map.class, String.class, String.class); HttpResponseDecodeData mapStringStringDecodeData = new MockHttpResponseDecodeData(200, mapStringString, String.class, true); - Map map = Collections.singletonMap("hello", "azure"); + Map map = Collections.singletonMap("hello", "world"); Response mapStringStringResponse = new MockHttpResponse(GET_REQUEST, 200, map); return Stream.of(Arguments.of(stringResponse, stringDecodeData, "hello"), diff --git a/sdk/clientcore/core/src/test/java/io/clientcore/core/shared/HttpClientTests.java b/sdk/clientcore/core/src/test/java/io/clientcore/core/shared/HttpClientTests.java index c39057870b2bd..d1d86484eb1fa 100644 --- a/sdk/clientcore/core/src/test/java/io/clientcore/core/shared/HttpClientTests.java +++ b/sdk/clientcore/core/src/test/java/io/clientcore/core/shared/HttpClientTests.java @@ -1743,7 +1743,7 @@ public void canReceiveServerSentEvents() throws IOException { } /** - * Tests that eagerly converting implementation HTTP headers to azure-core Headers is done. + * Tests that eagerly converting implementation HTTP headers to Client Core Headers is done. */ @Test public void canRecognizeServerSentEvent() throws IOException { diff --git a/sdk/clientcore/http-okhttp3/README.md b/sdk/clientcore/http-okhttp3/README.md index b5c96e3d6898f..a71a747959620 100644 --- a/sdk/clientcore/http-okhttp3/README.md +++ b/sdk/clientcore/http-okhttp3/README.md @@ -1,54 +1,21 @@ -# Azure Core OkHttp HTTP plugin library for Java +# Client Core OkHttp HTTP plugin library for Java -Azure Core OkHttp HTTP client is a plugin for the `azure-core` HTTP client API. +Client Core OkHttp HTTP client is a plugin for the `io.clientcore.core` HTTP client API. ## 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). +- A Java Development Kit (JDK), version 17 or later. ### Include the package -#### Include the BOM file -Please include the azure-sdk-bom to your project to take dependency on the General Availability (GA) version of the library. In the following snippet, replace the {bom_version_to_target} placeholder with the version number. -To learn more about the BOM, see the [AZURE SDK BOM README](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/boms/azure-sdk-bom/README.md). - -```xml - - - - com.azure - azure-sdk-bom - {bom_version_to_target} - pom - import - - - -``` -and then include the direct dependency in the dependencies section without the version tag. - -```xml - - - com.azure - azure-core-http-okhttp - - -``` - -#### Include direct dependency -If you want to take dependency on a particular version of the library that is not present in the BOM, -add the direct dependency to your project as follows. - -[//]: # ({x-version-update-start;com.azure:azure-core-http-okhttp;current}) +[//]: # ({x-version-update-start;io.clientcore:http-okhttp3;current}) ```xml - com.azure - azure-core-http-okhttp - 1.11.14 + io.clientcore + http-okhttp3 + 1.0.0-beta.1 ``` [//]: # ({x-version-update-end}) @@ -64,7 +31,7 @@ The following sections provide several code snippets covering some of the most c ### Create a Simple Client -Create an OkHttp client using a connection timeout of 60 seconds and a read timeout of 120 seconds. +Create an OkHttp client. ```java readme-sample-createBasicClient HttpClient client = new OkHttpHttpClientBuilder().build(); @@ -101,10 +68,6 @@ HttpClient client = new OkHttpHttpClientBuilder( .build(); ``` -## Next steps - -Get started with Azure libraries that are [built using Azure Core](https://azure.github.io/azure-sdk/releases/latest/#java). - ## Troubleshooting If you encounter any bugs, please file issues via [GitHub Issues](https://github.com/Azure/azure-sdk-for-java/issues/new/choose) @@ -112,9 +75,9 @@ or checkout [StackOverflow for Azure Java SDK](https://stackoverflow.com/questio ### Enabling Logging -Azure SDKs for Java provide a consistent logging story to help aid in troubleshooting application errors and expedite -their resolution. The logs produced will capture the flow of an application before reaching the terminal state to help -locate the root issue. View the [logging][logging] wiki for guidance about enabling logging. +Client Core libraries for Java provide a consistent logging story to help aid in troubleshooting application errors and +expedite their resolution. The logs produced will capture the flow of an application before reaching the terminal state +to help locate the root issue. ## Contributing @@ -125,9 +88,3 @@ For details on contributing to this repository, see the [contributing guide](htt 1. Commit your changes (`git commit -am 'Add some feature'`) 1. Push to the branch (`git push origin my-new-feature`) 1. Create new Pull Request - - -[logging]: https://github.com/Azure/azure-sdk-for-java/wiki/Logging-in-Azure-SDK -[jdk_link]: https://docs.microsoft.com/java/azure/jdk/?view=azure-java-stable - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Fcore%2Fazure-core-http-okhttp%2FREADME.png) diff --git a/sdk/clientcore/http-okhttp3/src/main/java/io/clientcore/http/okhttp3/package-info.java b/sdk/clientcore/http-okhttp3/src/main/java/io/clientcore/http/okhttp3/package-info.java index 1e0cf00e1cb4a..72e2676f3a232 100644 --- a/sdk/clientcore/http-okhttp3/src/main/java/io/clientcore/http/okhttp3/package-info.java +++ b/sdk/clientcore/http-okhttp3/src/main/java/io/clientcore/http/okhttp3/package-info.java @@ -2,6 +2,6 @@ // Licensed under the MIT License. /** - * Package containing OkHttp HTTP client plugin for azure-core. + * Package containing OkHttp HTTP client plugin for Client Core. */ package io.clientcore.http.okhttp3; diff --git a/sdk/clientcore/http-okhttp3/src/samples/java/io/clientcore/http/okhttp3/OkHttpHttpClientBuilderJavaDocCodeSnippets.java b/sdk/clientcore/http-okhttp3/src/samples/java/io/clientcore/http/okhttp3/OkHttpHttpClientBuilderJavaDocCodeSnippets.java index e20cb79678c3a..4a6ed3dac050e 100644 --- a/sdk/clientcore/http-okhttp3/src/samples/java/io/clientcore/http/okhttp3/OkHttpHttpClientBuilderJavaDocCodeSnippets.java +++ b/sdk/clientcore/http-okhttp3/src/samples/java/io/clientcore/http/okhttp3/OkHttpHttpClientBuilderJavaDocCodeSnippets.java @@ -74,7 +74,7 @@ public void usingExistingHttpClientSample() { // BEGIN: io.clientcore.http.okhttp3.using-existing-okhttp // Create an OkHttpClient with connection timeout of 250 seconds. OkHttpClient okHttpClient = new OkHttpClient().newBuilder().connectTimeout(Duration.ofSeconds(250)).build(); - // Use "okHttpClient" instance to create an azure-core HttpClient "client". + // Use "okHttpClient" instance to create a Client Core HttpClient "client". // Both "okHttpClient" and "client" share same underlying resources such as // connection pool, thread pool. // "client" inherits connection timeout settings and add proxy. diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallAutomationAsyncClient.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallAutomationAsyncClient.java index 63fce49ff494d..111e66b98f94e 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallAutomationAsyncClient.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallAutomationAsyncClient.java @@ -16,44 +16,42 @@ import com.azure.communication.callautomation.implementation.models.AnswerCallRequestInternal; import com.azure.communication.callautomation.implementation.models.AudioFormatInternal; import com.azure.communication.callautomation.implementation.models.CallIntelligenceOptionsInternal; +import com.azure.communication.callautomation.implementation.models.CallLocatorInternal; +import com.azure.communication.callautomation.implementation.models.CallLocatorKindInternal; import com.azure.communication.callautomation.implementation.models.CallRejectReasonInternal; import com.azure.communication.callautomation.implementation.models.CommunicationIdentifierModel; import com.azure.communication.callautomation.implementation.models.CommunicationUserIdentifierModel; +import com.azure.communication.callautomation.implementation.models.ConnectRequestInternal; import com.azure.communication.callautomation.implementation.models.CreateCallRequestInternal; import com.azure.communication.callautomation.implementation.models.CustomCallingContext; import com.azure.communication.callautomation.implementation.models.MediaStreamingAudioChannelTypeInternal; import com.azure.communication.callautomation.implementation.models.MediaStreamingContentTypeInternal; import com.azure.communication.callautomation.implementation.models.MediaStreamingOptionsInternal; import com.azure.communication.callautomation.implementation.models.MediaStreamingTransportTypeInternal; -import com.azure.communication.callautomation.implementation.models.MicrosoftTeamsAppIdentifierModel; import com.azure.communication.callautomation.implementation.models.RedirectCallRequestInternal; import com.azure.communication.callautomation.implementation.models.RejectCallRequestInternal; -import com.azure.communication.callautomation.implementation.models.ConnectRequestInternal; -import com.azure.communication.callautomation.implementation.models.CallLocatorInternal; -import com.azure.communication.callautomation.implementation.models.CallLocatorKindInternal; import com.azure.communication.callautomation.implementation.models.TranscriptionOptionsInternal; import com.azure.communication.callautomation.implementation.models.TranscriptionTransportTypeInternal; import com.azure.communication.callautomation.models.AnswerCallOptions; import com.azure.communication.callautomation.models.AnswerCallResult; import com.azure.communication.callautomation.models.AudioFormat; import com.azure.communication.callautomation.models.CallInvite; +import com.azure.communication.callautomation.models.CallLocator; +import com.azure.communication.callautomation.models.CallLocatorKind; +import com.azure.communication.callautomation.models.ConnectCallOptions; +import com.azure.communication.callautomation.models.ConnectCallResult; import com.azure.communication.callautomation.models.CreateCallOptions; import com.azure.communication.callautomation.models.CreateCallResult; import com.azure.communication.callautomation.models.CreateGroupCallOptions; +import com.azure.communication.callautomation.models.GroupCallLocator; import com.azure.communication.callautomation.models.MediaStreamingOptions; import com.azure.communication.callautomation.models.RedirectCallOptions; import com.azure.communication.callautomation.models.RejectCallOptions; -import com.azure.communication.callautomation.models.ConnectCallOptions; -import com.azure.communication.callautomation.models.CallLocator; -import com.azure.communication.callautomation.models.CallLocatorKind; -import com.azure.communication.callautomation.models.GroupCallLocator; -import com.azure.communication.callautomation.models.ServerCallLocator; import com.azure.communication.callautomation.models.RoomCallLocator; -import com.azure.communication.callautomation.models.ConnectCallResult; +import com.azure.communication.callautomation.models.ServerCallLocator; import com.azure.communication.callautomation.models.TranscriptionOptions; import com.azure.communication.common.CommunicationIdentifier; import com.azure.communication.common.CommunicationUserIdentifier; -import com.azure.communication.common.MicrosoftTeamsAppIdentifier; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceClient; import com.azure.core.annotation.ServiceMethod; @@ -96,12 +94,10 @@ public final class CallAutomationAsyncClient { private final HttpPipeline httpPipelineInternal; private final String resourceUrl; private final CommunicationUserIdentifierModel sourceIdentity; - private final MicrosoftTeamsAppIdentifierModel opsSourceIdentity; private final CallAutomationEventProcessor eventProcessor; CallAutomationAsyncClient(AzureCommunicationCallAutomationServiceImpl callServiceClient, - CommunicationUserIdentifier sourceIdentity, MicrosoftTeamsAppIdentifier opsSourceIdentity, - CallAutomationEventProcessor eventProcessor) { + CommunicationUserIdentifier sourceIdentity, CallAutomationEventProcessor eventProcessor) { this.callConnectionsInternal = callServiceClient.getCallConnections(); this.azureCommunicationCallAutomationServiceInternal = callServiceClient; this.callRecordingsInternal = callServiceClient.getCallRecordings(); @@ -115,8 +111,6 @@ public final class CallAutomationAsyncClient { this.resourceUrl = callServiceClient.getEndpoint(); this.sourceIdentity = sourceIdentity == null ? null : CommunicationUserIdentifierConverter.convert(sourceIdentity); - this.opsSourceIdentity - = opsSourceIdentity == null ? null : MicrosoftTeamsAppIdentifierConverter.convert(opsSourceIdentity); } /** @@ -135,14 +129,6 @@ public CommunicationUserIdentifier getSourceIdentity() { return sourceIdentity == null ? null : CommunicationUserIdentifierConverter.convert(sourceIdentity); } - /** - * Get OPS Source Identity that is used for create OPS call - * @return {@link CommunicationUserIdentifier} represent source - */ - public MicrosoftTeamsAppIdentifier getOPSSourceIdentity() { - return opsSourceIdentity == null ? null : MicrosoftTeamsAppIdentifierConverter.convert(opsSourceIdentity); - } - //region Pre-call Actions /** * Create a call connection request from a source identity to a target identity. @@ -252,7 +238,7 @@ private CreateCallRequestInternal getCreateCallRequestInternal(CreateCallOptions PhoneNumberIdentifierConverter.convert(createCallOptions.getCallInvite().getSourceCallerIdNumber())) .setSourceDisplayName(createCallOptions.getCallInvite().getSourceDisplayName()) .setSource(sourceIdentity) - .setOpsSource(opsSourceIdentity) + .setTeamsAppSource(MicrosoftTeamsAppIdentifierConverter.convert(createCallOptions.getTeamsAppSource())) .setTargets(targetsModel) .setCallbackUri(createCallOptions.getCallbackUrl()) .setCallIntelligenceOptions(callIntelligenceOptionsInternal) @@ -300,7 +286,7 @@ private CreateCallRequestInternal getCreateCallRequestInternal(CreateGroupCallOp PhoneNumberIdentifierConverter.convert(createCallGroupOptions.getSourceCallIdNumber())) .setSourceDisplayName(createCallGroupOptions.getSourceDisplayName()) .setSource(sourceIdentity) - .setOpsSource(opsSourceIdentity) + .setTeamsAppSource(MicrosoftTeamsAppIdentifierConverter.convert(createCallGroupOptions.getTeamsAppSource())) .setTargets(targetsModel) .setCallbackUri(createCallGroupOptions.getCallbackUrl()) .setCallIntelligenceOptions(callIntelligenceOptionsInternal) diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallAutomationClientBuilder.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallAutomationClientBuilder.java index 4f7dddb1c03c8..7ddc5d0a276eb 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallAutomationClientBuilder.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallAutomationClientBuilder.java @@ -8,7 +8,6 @@ import com.azure.communication.callautomation.implementation.CustomBearerTokenAuthenticationPolicy; import com.azure.communication.callautomation.implementation.CustomHmacAuthenticationPolicy; import com.azure.communication.common.CommunicationUserIdentifier; -import com.azure.communication.common.MicrosoftTeamsAppIdentifier; import com.azure.communication.common.implementation.CommunicationConnectionString; import com.azure.communication.common.implementation.HmacAuthenticationPolicy; import com.azure.core.annotation.ServiceClientBuilder; @@ -45,8 +44,8 @@ import java.net.MalformedURLException; import java.net.URL; import java.util.ArrayList; -import java.util.List; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; @@ -82,7 +81,6 @@ public final class CallAutomationClientBuilder private RetryPolicy retryPolicy; private RetryOptions retryOptions; private CommunicationUserIdentifier sourceIdentity; - private MicrosoftTeamsAppIdentifier opsSourceIdentity; /** * Public default constructor @@ -187,16 +185,6 @@ public CallAutomationClientBuilder sourceIdentity(CommunicationUserIdentifier so return this; } - /** - * Set One Phone System Source Identity used to create call - * @param opsSourceIdentity {@link MicrosoftTeamsAppIdentifier} to used to create call. - * @return {@link CallAutomationClientBuilder} object. - */ - public CallAutomationClientBuilder opsSourceIdentity(MicrosoftTeamsAppIdentifier opsSourceIdentity) { - this.opsSourceIdentity = opsSourceIdentity; - return this; - } - /** * Sets the retry policy to use (using the RetryPolicy type). *

    @@ -331,8 +319,7 @@ public CallAutomationClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { * and {@link #retryPolicy(RetryPolicy)} have been set. */ public CallAutomationAsyncClient buildAsyncClient() { - return new CallAutomationAsyncClient(createServiceImpl(), sourceIdentity, opsSourceIdentity, - new CallAutomationEventProcessor()); + return new CallAutomationAsyncClient(createServiceImpl(), sourceIdentity, new CallAutomationEventProcessor()); } /** diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CreateCallRequestInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CreateCallRequestInternal.java index 3ce0f9593793d..4a37801ffcfd6 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CreateCallRequestInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CreateCallRequestInternal.java @@ -54,9 +54,9 @@ public final class CreateCallRequestInternal implements JsonSerializable { + /* + * The communication identifier of the target user. + */ + private CommunicationIdentifierModel to; + + /* + * The communication identifier of the user who initiated the call. + */ + private CommunicationIdentifierModel from; + + /* + * Display name of caller. + */ + private String callerDisplayName; + + /* + * The server call id. + */ + private String serverCallId; + + /* + * Custom Context of Incoming Call + */ + private CustomCallingContext customContext; + + /* + * Incoming call context. + */ + private String incomingCallContext; + + /* + * The communication identifier of the user on behalf of whom the call is made. + */ + private CommunicationIdentifierModel onBehalfOfCallee; + + /* + * Correlation ID for event to call correlation. Also called ChainId for skype chain ID. + */ + private String correlationId; + + /** + * Creates an instance of IncomingCall class. + */ + public IncomingCall() { + } + + /** + * Get the to property: The communication identifier of the target user. + * + * @return the to value. + */ + public CommunicationIdentifierModel getTo() { + return this.to; + } + + /** + * Get the from property: The communication identifier of the user who initiated the call. + * + * @return the from value. + */ + public CommunicationIdentifierModel getFrom() { + return this.from; + } + + /** + * Get the callerDisplayName property: Display name of caller. + * + * @return the callerDisplayName value. + */ + public String getCallerDisplayName() { + return this.callerDisplayName; + } + + /** + * Get the serverCallId property: The server call id. + * + * @return the serverCallId value. + */ + public String getServerCallId() { + return this.serverCallId; + } + + /** + * Get the customContext property: Custom Context of Incoming Call. + * + * @return the customContext value. + */ + public CustomCallingContext getCustomContext() { + return this.customContext; + } + + /** + * Get the incomingCallContext property: Incoming call context. + * + * @return the incomingCallContext value. + */ + public String getIncomingCallContext() { + return this.incomingCallContext; + } + + /** + * Get the onBehalfOfCallee property: The communication identifier of the user on behalf of whom the call is made. + * + * @return the onBehalfOfCallee value. + */ + public CommunicationIdentifierModel getOnBehalfOfCallee() { + return this.onBehalfOfCallee; + } + + /** + * Get the correlationId property: Correlation ID for event to call correlation. Also called ChainId for skype chain + * ID. + * + * @return the correlationId value. + */ + public String getCorrelationId() { + return this.correlationId; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IncomingCall from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IncomingCall if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the IncomingCall. + */ + public static IncomingCall fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IncomingCall deserializedIncomingCall = new IncomingCall(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("to".equals(fieldName)) { + deserializedIncomingCall.to = CommunicationIdentifierModel.fromJson(reader); + } else if ("from".equals(fieldName)) { + deserializedIncomingCall.from = CommunicationIdentifierModel.fromJson(reader); + } else if ("callerDisplayName".equals(fieldName)) { + deserializedIncomingCall.callerDisplayName = reader.getString(); + } else if ("serverCallId".equals(fieldName)) { + deserializedIncomingCall.serverCallId = reader.getString(); + } else if ("customContext".equals(fieldName)) { + deserializedIncomingCall.customContext = CustomCallingContext.fromJson(reader); + } else if ("incomingCallContext".equals(fieldName)) { + deserializedIncomingCall.incomingCallContext = reader.getString(); + } else if ("onBehalfOfCallee".equals(fieldName)) { + deserializedIncomingCall.onBehalfOfCallee = CommunicationIdentifierModel.fromJson(reader); + } else if ("correlationId".equals(fieldName)) { + deserializedIncomingCall.correlationId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedIncomingCall; + }); + } +} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CallInvite.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CallInvite.java index f7e52ff490f8a..023368b4be2e8 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CallInvite.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CallInvite.java @@ -24,7 +24,8 @@ public final class CallInvite { private final CustomCallingContext customCallingContext; /** - * Create a CallInvite object with PhoneNumberIdentifierr + * Create a CallInvite object with PhoneNumberIdentifier + * When the source of the call is a Teams App source, callerIdNumber is not supported and should be null. * @param targetIdentity Target's PhoneNumberIdentifier * @param callerIdNumber Caller's phone number identifier */ diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CreateCallOptions.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CreateCallOptions.java index fe0f9e8ea87de..fecc04be6d474 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CreateCallOptions.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CreateCallOptions.java @@ -3,6 +3,7 @@ package com.azure.communication.callautomation.models; +import com.azure.communication.common.MicrosoftTeamsAppIdentifier; import com.azure.core.annotation.Fluent; /** @@ -40,6 +41,13 @@ public final class CreateCallOptions { */ private TranscriptionOptions transcriptionOptions; + /** + * Overrides default client source by a MicrosoftTeamsAppIdentifier type source. + * Required for creating call with Teams resource account ID. + * This is per-operation setting and does not change the client's default source. + */ + private MicrosoftTeamsAppIdentifier teamsAppSource; + /** * Constructor * @param callInvite Call invitee information. @@ -146,4 +154,26 @@ public CreateCallOptions setMediaStreamingOptions(MediaStreamingOptions mediaStr this.mediaStreamingOptions = mediaStreamingOptions; return this; } + + /** + * Get the TeamsAppSource property: it overrides default client source by a MicrosoftTeamsAppIdentifier type source. + * + * @return the teamsAppSource. + */ + public MicrosoftTeamsAppIdentifier getTeamsAppSource() { + return teamsAppSource; + } + + /** + * Overrides default client source by a MicrosoftTeamsAppIdentifier type source. + * Required for creating call with Teams resource account ID. + * This is per-operation setting and does not change the client's default source. + * + * @param teamsAppSource The MicrosoftTeamsAppIdentifier type source for overriding default client source. + * @return the CreateCallOptions object itself. + */ + public CreateCallOptions setTeamsAppSource(MicrosoftTeamsAppIdentifier teamsAppSource) { + this.teamsAppSource = teamsAppSource; + return this; + } } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CreateGroupCallOptions.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CreateGroupCallOptions.java index f2eebe577bfab..3c1142ac45a88 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CreateGroupCallOptions.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CreateGroupCallOptions.java @@ -4,6 +4,7 @@ package com.azure.communication.callautomation.models; import com.azure.communication.common.CommunicationIdentifier; +import com.azure.communication.common.MicrosoftTeamsAppIdentifier; import com.azure.communication.common.PhoneNumberIdentifier; import com.azure.core.annotation.Fluent; @@ -60,6 +61,13 @@ public final class CreateGroupCallOptions { */ private final CustomCallingContext customContext; + /** + * Overrides default client source by a MicrosoftTeamsAppIdentifier type source. + * Required for creating call with Teams resource account ID. + * This is per-operation setting and does not change the client's default source. + */ + private MicrosoftTeamsAppIdentifier teamsAppSource; + /** * Constructor * @@ -215,4 +223,26 @@ public TranscriptionOptions getTranscriptionOptions() { public CustomCallingContext getCustomContext() { return customContext; } + + /** + * Get the TeamsAppSource property: it overrides default client source by a MicrosoftTeamsAppIdentifier type source. + * + * @return the teamsAppSource. + */ + public MicrosoftTeamsAppIdentifier getTeamsAppSource() { + return teamsAppSource; + } + + /** + * Overrides default client source by a MicrosoftTeamsAppIdentifier type source. + * Required for creating call with Teams resource account ID. + * This is per-operation setting and does not change the client's default source. + * + * @param teamsAppSource The MicrosoftTeamsAppIdentifier type source for overriding default client source. + * @return the CreateCallOptions object itself. + */ + public CreateGroupCallOptions setTeamsAppSource(MicrosoftTeamsAppIdentifier teamsAppSource) { + this.teamsAppSource = teamsAppSource; + return this; + } } diff --git a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationClientUnitTests.java b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationClientUnitTests.java index 138902f8c85b0..48f02f12d437b 100644 --- a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationClientUnitTests.java +++ b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationClientUnitTests.java @@ -7,12 +7,15 @@ import com.azure.communication.callautomation.models.AnswerCallResult; import com.azure.communication.callautomation.models.CallInvite; import com.azure.communication.callautomation.models.CallRejectReason; +import com.azure.communication.callautomation.models.CreateCallOptions; import com.azure.communication.callautomation.models.CreateGroupCallOptions; import com.azure.communication.callautomation.models.CreateCallResult; import com.azure.communication.callautomation.models.RedirectCallOptions; import com.azure.communication.callautomation.models.RejectCallOptions; import com.azure.communication.common.CommunicationIdentifier; import com.azure.communication.common.CommunicationUserIdentifier; +import com.azure.communication.common.MicrosoftTeamsAppIdentifier; +import com.azure.communication.common.PhoneNumberIdentifier; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; import org.junit.jupiter.api.Test; @@ -63,6 +66,26 @@ public void createCallWithResponse() { assertNotNull(createCallResult.getValue()); } + @Test + public void createTeamsAppCallWithResponse() { + MicrosoftTeamsAppIdentifier caller = new MicrosoftTeamsAppIdentifier(TEAMS_APP_CALL_CALLER_ID); + + CallAutomationClient callAutomationClient = getCallAutomationClient(new ArrayList<>(Collections + .singletonList(new SimpleEntry<>(generateTeamsAppCallProperties(CALL_CONNECTION_ID, CALL_SERVER_CALL_ID, + CALL_TARGET_ID, CALL_CONNECTION_STATE, CALL_CALLBACK_URL, TEAMS_APP_CALL_CALLER_ID), 201)))); + PhoneNumberIdentifier target = new PhoneNumberIdentifier(CALL_TARGET_ID); + + Response createCallResult = callAutomationClient.createCallWithResponse( + new CreateCallOptions(new CallInvite(target, null), CALL_CALLBACK_URL).setTeamsAppSource(caller), + Context.NONE); + + assertNotNull(createCallResult); + assertEquals(201, createCallResult.getStatusCode()); + assertEquals(TEAMS_APP_CALL_CALLER_ID, + ((MicrosoftTeamsAppIdentifier) (createCallResult.getValue().getCallConnectionProperties().getSource())) + .getAppId()); + } + @Test public void answerCall() { CallAutomationClient callAutomationClient = getCallAutomationClient( diff --git a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationUnitTestBase.java b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationUnitTestBase.java index 147a93d52a2f0..0734c4a0b73ec 100644 --- a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationUnitTestBase.java +++ b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationUnitTestBase.java @@ -47,7 +47,8 @@ public class CallAutomationUnitTestBase { static final String CALL_CONNECTION_ID = "callConnectionId"; static final String CALL_SERVER_CALL_ID = "serverCallId"; static final String ROOM_ID = "roomId"; - static final String CALL_CALLER_ID = "callerId"; + static final String CALL_CALLER_ID = "acs_callerId"; + static final String TEAMS_APP_CALL_CALLER_ID = "teams_app_callerId"; static final CommunicationUserIdentifier USER_1 = new CommunicationUserIdentifier("userId1"); static final String CALL_CALLER_DISPLAY_NAME = "callerDisplayName"; static final String CALL_TARGET_ID = "targetId"; @@ -88,16 +89,16 @@ public static String generateCallProperties(String callConnectionId, String serv return serializeObject(result); } - public static String generateOPSCallProperties(String callConnectionId, String serverCallId, String targetId, - String connectionState, String callbackUri, String opsSourceId) { + public static String generateTeamsAppCallProperties(String callConnectionId, String serverCallId, String targetId, + String connectionState, String callbackUri, String teamsAppSourceId) { CallConnectionPropertiesInternal result = new CallConnectionPropertiesInternal() .setCallConnectionId(callConnectionId) .setServerCallId(serverCallId) .setCallbackUri(callbackUri) .setCallConnectionState(CallConnectionStateModelInternal.fromString(connectionState)) - .setSource(new CommunicationIdentifierModel().setRawId(opsSourceId) + .setSource(new CommunicationIdentifierModel().setRawId("28:orgid:" + teamsAppSourceId) .setKind(CommunicationIdentifierModelKind.MICROSOFT_TEAMS_APP) - .setMicrosoftTeamsApp(new MicrosoftTeamsAppIdentifierModel().setAppId(opsSourceId) + .setMicrosoftTeamsApp(new MicrosoftTeamsAppIdentifierModel().setAppId(teamsAppSourceId) .setCloud(CommunicationCloudEnvironmentModel.PUBLIC))) .setTargets( new ArrayList<>(Collections.singletonList(new CommunicationIdentifierModel().setRawId("+4:" + targetId) diff --git a/sdk/communication/azure-communication-callautomation/swagger/README.md b/sdk/communication/azure-communication-callautomation/swagger/README.md index 315b16c0365f5..29fd46e35cd78 100644 --- a/sdk/communication/azure-communication-callautomation/swagger/README.md +++ b/sdk/communication/azure-communication-callautomation/swagger/README.md @@ -32,7 +32,7 @@ autorest README.md --java --v4 tag: package-2024-09-01-preview use: '@autorest/java@4.1.29' require: - - https://github.com/Azure/azure-rest-api-specs/blob/7347874bc2794b2770c3e7618bd1a5ccab53cb54/specification/communication/data-plane/CallAutomation/readme.md + - https://github.com/Azure/azure-rest-api-specs/blob/691fea3efb9ff22b20904e92d5116223f452a3b1/specification/communication/data-plane/CallAutomation/readme.md java: true output-folder: ../ license-header: MICROSOFT_MIT_SMALL diff --git a/sdk/core/azure-core-http-vertx/pom.xml b/sdk/core/azure-core-http-vertx/pom.xml index e7e184d7399e2..f79ffbf3e98ed 100644 --- a/sdk/core/azure-core-http-vertx/pom.xml +++ b/sdk/core/azure-core-http-vertx/pom.xml @@ -177,7 +177,6 @@ io.vertx:vertx-codegen:[4.5.10] io.vertx:vertx-core:[4.5.10] - io.vertx:vertx-reactive-streams:[4.5.10] diff --git a/sdk/cosmos/azure-cosmos-kafka-connect/pom.xml b/sdk/cosmos/azure-cosmos-kafka-connect/pom.xml index fb02bdf00391e..19361bde405d1 100644 --- a/sdk/cosmos/azure-cosmos-kafka-connect/pom.xml +++ b/sdk/cosmos/azure-cosmos-kafka-connect/pom.xml @@ -292,7 +292,6 @@ Licensed under the MIT License. com.azure:* org.apache.kafka:connect-api:[3.6.0] - io.confluent:kafka-connect-maven-plugin:[0.12.0] com.jayway.jsonpath:json-path:[2.9.0] org.sourcelab:kafka-connect-client:[4.0.4] org.apache.maven.plugins:maven-antrun-plugin:[3.1.0] diff --git a/sdk/cosmos/azure-cosmos-spark-account-data-resolver-sample/pom.xml b/sdk/cosmos/azure-cosmos-spark-account-data-resolver-sample/pom.xml index 9112641f567bf..7461fc3c53f4e 100644 --- a/sdk/cosmos/azure-cosmos-spark-account-data-resolver-sample/pom.xml +++ b/sdk/cosmos/azure-cosmos-spark-account-data-resolver-sample/pom.xml @@ -289,7 +289,6 @@ com.fasterxml.jackson.datatype:jackson-datatype-jsr310:[2.17.2] com.fasterxml.jackson.core:jackson-databind:[2.17.2] com.fasterxml.jackson.module:jackson-module-scala_2.12:[2.17.2] - com.fasterxml.jackson.datatype:jackson-datatype-jsr310:[2.15.2] com.fasterxml.jackson.core:jackson-databind:[2.15.2] com.fasterxml.jackson.module:jackson-module-scala_2.12:[2.15.2] com.globalmentor:hadoop-bare-naked-local-fs:[0.1.0] diff --git a/sdk/cosmos/azure-cosmos-spark_3_2-12/pom.xml b/sdk/cosmos/azure-cosmos-spark_3_2-12/pom.xml index ea331d6c10387..563345e64e7d1 100644 --- a/sdk/cosmos/azure-cosmos-spark_3_2-12/pom.xml +++ b/sdk/cosmos/azure-cosmos-spark_3_2-12/pom.xml @@ -229,7 +229,6 @@ - javax.annotation:javax.annotation-api:[1.3.2] org.apache.commons:commons-lang3:[3.12.0] org.slf4j:slf4j-api:[1.7.36] org.apache.spark:spark-sql_2.12:[3.1.1] diff --git a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/checkstyle-suppressions.xml b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/checkstyle-suppressions.xml index 7f518b4971c1f..b7a08594f7efa 100644 --- a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/checkstyle-suppressions.xml +++ b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/checkstyle-suppressions.xml @@ -248,6 +248,8 @@ + + @@ -363,6 +365,7 @@ + diff --git a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/quickpulse/QuickPulseDataCollector.java b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/quickpulse/QuickPulseDataCollector.java index 3acc50ed6614a..18a5d052368f2 100644 --- a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/quickpulse/QuickPulseDataCollector.java +++ b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/quickpulse/QuickPulseDataCollector.java @@ -3,7 +3,6 @@ package com.azure.monitor.opentelemetry.autoconfigure.implementation.quickpulse; -import com.azure.core.util.logging.ClientLogger; import com.azure.monitor.opentelemetry.autoconfigure.implementation.models.MonitorDomain; import com.azure.monitor.opentelemetry.autoconfigure.implementation.models.RemoteDependencyData; import com.azure.monitor.opentelemetry.autoconfigure.implementation.models.RequestData; @@ -19,6 +18,7 @@ import com.azure.monitor.opentelemetry.autoconfigure.implementation.quickpulse.filtering.RequestDataColumns; import com.azure.monitor.opentelemetry.autoconfigure.implementation.quickpulse.filtering.Filter; import com.azure.monitor.opentelemetry.autoconfigure.implementation.quickpulse.filtering.TraceDataColumns; +import com.azure.monitor.opentelemetry.autoconfigure.implementation.quickpulse.filtering.DerivedMetricProjections; import com.azure.monitor.opentelemetry.autoconfigure.implementation.quickpulse.swagger.models.RemoteDependency; import com.azure.monitor.opentelemetry.autoconfigure.implementation.quickpulse.swagger.models.Request; import com.azure.monitor.opentelemetry.autoconfigure.implementation.quickpulse.swagger.models.KeyValuePairString; @@ -28,10 +28,10 @@ import com.azure.monitor.opentelemetry.autoconfigure.implementation.quickpulse.swagger.models.DerivedMetricInfo; import com.azure.monitor.opentelemetry.autoconfigure.implementation.quickpulse.swagger.models.Trace; import com.azure.monitor.opentelemetry.autoconfigure.implementation.quickpulse.swagger.models.TelemetryType; +import com.azure.monitor.opentelemetry.autoconfigure.implementation.quickpulse.swagger.models.AggregationType; import com.azure.monitor.opentelemetry.autoconfigure.implementation.utils.CpuPerformanceCounterCalculator; import reactor.util.annotation.Nullable; -import java.io.IOException; import java.lang.management.ManagementFactory; import java.lang.management.MemoryMXBean; import java.lang.management.MemoryUsage; @@ -59,8 +59,6 @@ final class QuickPulseDataCollector { private volatile Supplier instrumentationKeySupplier; - private static final ClientLogger logger = new ClientLogger(QuickPulseDataCollector.class); - // TODO (harskaur): Track projection (runtime) related errors in future PR private final AtomicReference configuration; @@ -79,7 +77,7 @@ synchronized void disable() { synchronized void enable(Supplier instrumentationKeySupplier) { this.instrumentationKeySupplier = instrumentationKeySupplier; - counters.set(new Counters()); + counters.set(new Counters(configuration.get().getValidProjectionInitInfo())); } synchronized void setQuickPulseStatus(QuickPulseStatus quickPulseStatus) { @@ -93,7 +91,7 @@ synchronized QuickPulseStatus getQuickPulseStatus() { @Nullable synchronized FinalCounters getAndRestart() { - Counters currentCounters = counters.getAndSet(new Counters()); + Counters currentCounters = counters.getAndSet(new Counters(configuration.get().getValidProjectionInitInfo())); if (currentCounters != null) { return new FinalCounters(currentCounters); } @@ -178,17 +176,13 @@ private boolean matchesDocumentFilters(TelemetryColumns columns, TelemetryType t } private void applyMetricFilters(TelemetryColumns columns, TelemetryType telemetryType, - FilteringConfiguration currentConfig) { - // TODO (harskaur): In a future PR, use Filter class to check if columns match any filter - // TODO (harskaur): If columns matches a filter, then create/increment a derived metric - // TODO (harskaur): when this PR is merged, remove logging (it is for manual testing & making sure the build does not complain about useless methods) + FilteringConfiguration currentConfig, Counters currentCounters) { List metricsConfig = currentConfig.fetchMetricConfigForTelemetryType(telemetryType); - try { - for (DerivedMetricInfo dmi : metricsConfig) { - logger.verbose(dmi.toJsonString()); + for (DerivedMetricInfo derivedMetricInfo : metricsConfig) { + if (Filter.checkMetricFilters(derivedMetricInfo, columns)) { + // TODO (harskaur): In future PR, track any error that comes from calculateProjection + currentCounters.derivedMetrics.calculateProjection(derivedMetricInfo, columns); } - } catch (IOException e) { - logger.error(e.getMessage()); } } @@ -205,7 +199,7 @@ private void addDependency(RemoteDependencyData telemetry, int itemCount, Filter } DependencyDataColumns columns = new DependencyDataColumns(telemetry); - applyMetricFilters(columns, TelemetryType.DEPENDENCY, currentConfig); + applyMetricFilters(columns, TelemetryType.DEPENDENCY, currentConfig, counters); List documentStreamIds = new ArrayList<>(); if (matchesDocumentFilters(columns, TelemetryType.DEPENDENCY, currentConfig, documentStreamIds)) { @@ -235,7 +229,8 @@ private void addException(TelemetryExceptionData exceptionData, int itemCount, counters.exceptions.addAndGet(itemCount); ExceptionDataColumns columns = new ExceptionDataColumns(exceptionData); - applyMetricFilters(columns, TelemetryType.EXCEPTION, currentConfig); + + applyMetricFilters(columns, TelemetryType.EXCEPTION, currentConfig, counters); List documentStreamIds = new ArrayList<>(); if (matchesDocumentFilters(columns, TelemetryType.EXCEPTION, currentConfig, documentStreamIds)) { @@ -271,7 +266,8 @@ private void addRequest(RequestData requestTelemetry, int itemCount, String oper } RequestDataColumns columns = new RequestDataColumns(requestTelemetry); - applyMetricFilters(columns, TelemetryType.REQUEST, currentConfig); + + applyMetricFilters(columns, TelemetryType.REQUEST, currentConfig, counters); List documentStreamIds = new ArrayList<>(); if (matchesDocumentFilters(columns, TelemetryType.REQUEST, currentConfig, documentStreamIds)) { @@ -294,7 +290,7 @@ private void addRequest(RequestData requestTelemetry, int itemCount, String oper private void addTrace(MessageData traceTelemetry, FilteringConfiguration currentConfig) { Counters counters = this.counters.get(); TraceDataColumns columns = new TraceDataColumns(traceTelemetry); - applyMetricFilters(columns, TelemetryType.TRACE, currentConfig); + applyMetricFilters(columns, TelemetryType.TRACE, currentConfig, counters); List documentStreamIds = new ArrayList<>(); if (matchesDocumentFilters(columns, TelemetryType.TRACE, currentConfig, documentStreamIds)) { Trace traceDoc = new Trace(); @@ -413,6 +409,8 @@ class FinalCounters { final double processNormalizedCpuUsage; final List documentList = new ArrayList<>(); + final Map projections; + private FinalCounters(Counters currentCounters) { processPhysicalMemory = getPhysicalMemory(memory); @@ -432,6 +430,8 @@ private FinalCounters(Counters currentCounters) { synchronized (currentCounters.documentList) { this.documentList.addAll(currentCounters.documentList); } + this.projections = currentCounters.derivedMetrics.fetchFinalDerivedMetricValues(); + } private long getPhysicalMemory(@Nullable MemoryMXBean memory) { @@ -484,6 +484,12 @@ static class Counters { final AtomicInteger unsuccessfulRdds = new AtomicInteger(0); final List documentList = new ArrayList<>(); + final DerivedMetricProjections derivedMetrics; + + Counters(Map projectionInfo) { + derivedMetrics = new DerivedMetricProjections(projectionInfo); + } + static long encodeCountAndDuration(long count, long duration) { if (count > MAX_COUNT || duration > MAX_DURATION) { return 0; diff --git a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/quickpulse/QuickPulseDataFetcher.java b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/quickpulse/QuickPulseDataFetcher.java index 5c4effebe9809..cbda612dab17e 100644 --- a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/quickpulse/QuickPulseDataFetcher.java +++ b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/quickpulse/QuickPulseDataFetcher.java @@ -120,6 +120,8 @@ private static List addMetricsToMonitoringDataPoint(QuickPulseDataC metrics.put("\\Processor(_Total)\\% Processor Time", counters.processNormalizedCpuUsage); // TODO: remove old cpu counter name when service side makes the UI change metrics.put("\\% Process\\Processor Time Normalized", counters.processNormalizedCpuUsage); + metrics.putAll(counters.projections); + for (Map.Entry entry : metrics.entrySet()) { MetricPoint point = new MetricPoint(); point.setName(entry.getKey()); diff --git a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/quickpulse/filtering/CustomDimensions.java b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/quickpulse/filtering/CustomDimensions.java index 2ec82d89e36b5..6d90d17f1baaa 100644 --- a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/quickpulse/filtering/CustomDimensions.java +++ b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/quickpulse/filtering/CustomDimensions.java @@ -41,4 +41,16 @@ public boolean matchesCustomDimFilter(FilterInfo filter, String trimmedFieldName } } + public double getCustomDimValueForProjection(String key) { + if (customDimensions.containsKey(key)) { + String value = customDimensions.get(key); + try { + return Double.parseDouble(value); + } catch (NumberFormatException e) { + + } + } + return Double.NaN; + } + } diff --git a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/quickpulse/filtering/DependencyDataColumns.java b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/quickpulse/filtering/DependencyDataColumns.java index 2f489c497f68e..896a84f63a23d 100644 --- a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/quickpulse/filtering/DependencyDataColumns.java +++ b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/quickpulse/filtering/DependencyDataColumns.java @@ -73,4 +73,8 @@ public boolean checkAllCustomDims(FilterInfo filter, TelemetryColumns data) { public boolean checkCustomDimFilter(FilterInfo filter, TelemetryColumns data, String trimmedFieldName) { return customDims.matchesCustomDimFilter(filter, trimmedFieldName); } + + public double getCustomDimValueForProjection(String key) { + return customDims.getCustomDimValueForProjection(key); + } } diff --git a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/quickpulse/filtering/DerivedMetricAggregation.java b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/quickpulse/filtering/DerivedMetricAggregation.java new file mode 100644 index 0000000000000..f2a66631d0684 --- /dev/null +++ b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/quickpulse/filtering/DerivedMetricAggregation.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.monitor.opentelemetry.autoconfigure.implementation.quickpulse.filtering; + +import com.azure.monitor.opentelemetry.autoconfigure.implementation.quickpulse.swagger.models.AggregationType; + +public class DerivedMetricAggregation { + // This class represents the intermediate state of a derived metric value. + // It keeps track of the count and the aggregated value so that these two + // fields can be used to determine the final value of a derived metric + // when the data fetcher asks for it. + + // Depending on the aggregationType, aggregation holds different values. + // For min, it is the current minimum value + // For max, it is the current max value + // For sum & avg, this represents the current sum. + // When metric values are retrieved by the data fetcher, the final value will + // be determined based on the count and the aggregation. + + private double aggregation; + private long count = 0; + final AggregationType aggregationType; + private final Object lock = new Object(); + + DerivedMetricAggregation(double initValue, AggregationType type) { + aggregation = initValue; + aggregationType = type; + } + + void update(double incrementBy) { + synchronized (lock) { + count++; + if (aggregationType.equals(AggregationType.SUM) || aggregationType.equals(AggregationType.AVG)) { + aggregation += incrementBy; + } else if (aggregationType.equals(AggregationType.MIN)) { + aggregation = Math.min(aggregation, incrementBy); + } else if (aggregationType.equals(AggregationType.MAX)) { + aggregation = Math.max(aggregation, incrementBy); + } + } + } + + double getFinalValue() { + synchronized (lock) { + if (count == 0) { + return 0.0; + } + if (aggregationType.equals(AggregationType.AVG)) { + return aggregation / count; + } + return aggregation; + + } + } +} diff --git a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/quickpulse/filtering/DerivedMetricProjections.java b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/quickpulse/filtering/DerivedMetricProjections.java new file mode 100644 index 0000000000000..fb9efa6253b92 --- /dev/null +++ b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/quickpulse/filtering/DerivedMetricProjections.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.monitor.opentelemetry.autoconfigure.implementation.quickpulse.filtering; + +import com.azure.monitor.opentelemetry.autoconfigure.implementation.quickpulse.swagger.models.AggregationType; +import com.azure.monitor.opentelemetry.autoconfigure.implementation.quickpulse.swagger.models.DerivedMetricInfo; + +import java.util.HashMap; +import java.util.Map; + +public class DerivedMetricProjections { + + public static final String COUNT = "Count()"; + private final Map derivedMetricValues = new HashMap<>(); + + public DerivedMetricProjections(Map projectionInfo) { + for (Map.Entry entry : projectionInfo.entrySet()) { + AggregationType aggregationType = entry.getValue(); + DerivedMetricAggregation value; + if (aggregationType.equals(AggregationType.MIN)) { + value = new DerivedMetricAggregation(Double.MAX_VALUE, aggregationType); + } else if (aggregationType.equals(AggregationType.MAX)) { + value = new DerivedMetricAggregation(Double.MIN_VALUE, aggregationType); + } else if (aggregationType.equals(AggregationType.SUM) || aggregationType.equals(AggregationType.AVG)) { + value = new DerivedMetricAggregation(0, aggregationType); + } else { + value = null; // we should never hit this case - that means the UI gave us an invalid aggregation type + } + derivedMetricValues.put(entry.getKey(), value); + } + } + + // This is intended to be called once for every post request + public Map fetchFinalDerivedMetricValues() { + Map result = new HashMap<>(); + for (Map.Entry entry : derivedMetricValues.entrySet()) { + String id = entry.getKey(); + DerivedMetricAggregation dma = entry.getValue(); + result.put(id, dma.getFinalValue()); + } + return result; + } + + // Once a telemetry item passes a metric chart filter, we use that telemetry item to increment + // a derived metric + public void calculateProjection(DerivedMetricInfo derivedMetricInfo, TelemetryColumns columns) { + double incrementBy = Double.NaN; + if (COUNT.equals(derivedMetricInfo.getProjection())) { + incrementBy = 1.0; + } else if (KnownRequestColumns.DURATION.equals(derivedMetricInfo.getProjection())) { + long duration = columns.getFieldValue(KnownRequestColumns.DURATION, Long.class); + // in case duration from telemetrycolumns doesn't parse correctly. + // also quickpulse expects duration derived metrics to be reported in millis. + incrementBy = duration == -1 ? Double.NaN : (double) duration / 1000.0; + } else if (derivedMetricInfo.getProjection().startsWith(Filter.CUSTOM_DIM_FIELDNAME_PREFIX)) { + String customDimKey + = derivedMetricInfo.getProjection().substring(Filter.CUSTOM_DIM_FIELDNAME_PREFIX.length()); + incrementBy = columns.getCustomDimValueForProjection(customDimKey); + // It is possible for the custom dim value to not parse to a double, or for the custom dim key to not be present. + // For now, such cases produce Double.Nan and get skipped when calculating projection. + } + + if (!Double.isNaN(incrementBy)) { + calculateAggregation(derivedMetricInfo.getId(), incrementBy); + } + } + + private void calculateAggregation(String id, double incrementBy) { + DerivedMetricAggregation dma = derivedMetricValues.get(id); + dma.update(incrementBy); + } + +} diff --git a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/quickpulse/filtering/ExceptionDataColumns.java b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/quickpulse/filtering/ExceptionDataColumns.java index ae35920528b3a..938524d29d2b4 100644 --- a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/quickpulse/filtering/ExceptionDataColumns.java +++ b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/quickpulse/filtering/ExceptionDataColumns.java @@ -54,4 +54,8 @@ public List getAllFieldValuesAsString() { } return result; } + + public double getCustomDimValueForProjection(String key) { + return customDims.getCustomDimValueForProjection(key); + } } diff --git a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/quickpulse/filtering/FilteringConfiguration.java b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/quickpulse/filtering/FilteringConfiguration.java index 24fc3c1ddee55..cde93b9b4978e 100644 --- a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/quickpulse/filtering/FilteringConfiguration.java +++ b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/quickpulse/filtering/FilteringConfiguration.java @@ -7,6 +7,7 @@ import com.azure.monitor.opentelemetry.autoconfigure.implementation.quickpulse.swagger.models.CollectionConfigurationInfo; import com.azure.monitor.opentelemetry.autoconfigure.implementation.quickpulse.swagger.models.DocumentStreamInfo; import com.azure.monitor.opentelemetry.autoconfigure.implementation.quickpulse.swagger.models.DocumentFilterConjunctionGroupInfo; +import com.azure.monitor.opentelemetry.autoconfigure.implementation.quickpulse.swagger.models.AggregationType; import com.azure.monitor.opentelemetry.autoconfigure.implementation.quickpulse.swagger.models.TelemetryType; import java.util.Set; @@ -27,16 +28,21 @@ public class FilteringConfiguration { private final String etag; + // key is the derived metric id + private final Map validProjectionInfo; + public FilteringConfiguration() { validDerivedMetricInfos = new HashMap<>(); validDocumentFilterConjunctionGroupInfos = new HashMap<>(); etag = ""; + validProjectionInfo = new HashMap<>(); } public FilteringConfiguration(CollectionConfigurationInfo configuration) { validDerivedMetricInfos = parseMetricFilterConfiguration(configuration); validDocumentFilterConjunctionGroupInfos = parseDocumentFilterConfiguration(configuration); etag = configuration.getETag(); + validProjectionInfo = initValidProjectionInfo(); } public List fetchMetricConfigForTelemetryType(TelemetryType telemetryType) { @@ -61,6 +67,10 @@ public String getETag() { return etag; } + public Map getValidProjectionInitInfo() { + return new HashMap<>(validProjectionInfo); + } + private Map>> parseDocumentFilterConfiguration(CollectionConfigurationInfo configuration) { Map>> result = new HashMap<>(); @@ -114,4 +124,14 @@ public String getETag() { return result; } + private Map initValidProjectionInfo() { + Map result = new HashMap<>(); + for (List derivedMetricInfoList : validDerivedMetricInfos.values()) { + for (DerivedMetricInfo derivedMetricInfo : derivedMetricInfoList) { + result.put(derivedMetricInfo.getId(), derivedMetricInfo.getAggregation()); + } + } + return result; + } + } diff --git a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/quickpulse/filtering/RequestDataColumns.java b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/quickpulse/filtering/RequestDataColumns.java index 4cc310c9de999..d575d945c1ac1 100644 --- a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/quickpulse/filtering/RequestDataColumns.java +++ b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/quickpulse/filtering/RequestDataColumns.java @@ -71,4 +71,8 @@ public boolean checkCustomDimFilter(FilterInfo filter, TelemetryColumns data, St return customDims.matchesCustomDimFilter(filter, trimmedFieldName); } + public double getCustomDimValueForProjection(String key) { + return customDims.getCustomDimValueForProjection(key); + } + } diff --git a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/quickpulse/filtering/TelemetryColumns.java b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/quickpulse/filtering/TelemetryColumns.java index 54155fc8fb306..80fc2127d69f6 100644 --- a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/quickpulse/filtering/TelemetryColumns.java +++ b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/quickpulse/filtering/TelemetryColumns.java @@ -16,4 +16,6 @@ public interface TelemetryColumns { boolean checkCustomDimFilter(FilterInfo filter, TelemetryColumns data, String trimmedFieldName); + double getCustomDimValueForProjection(String key); + } diff --git a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/quickpulse/filtering/TraceDataColumns.java b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/quickpulse/filtering/TraceDataColumns.java index 7a3fcdb86c2a7..2e434336cb582 100644 --- a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/quickpulse/filtering/TraceDataColumns.java +++ b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/quickpulse/filtering/TraceDataColumns.java @@ -44,4 +44,8 @@ public List getAllFieldValuesAsString() { result.add((String) mapping.get(KnownTraceColumns.MESSAGE)); return result; } + + public double getCustomDimValueForProjection(String key) { + return customDims.getCustomDimValueForProjection(key); + } } diff --git a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/statsbeat/ResourceProvider.java b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/statsbeat/ResourceProvider.java index d887561626600..283388ee9aa32 100644 --- a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/statsbeat/ResourceProvider.java +++ b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/statsbeat/ResourceProvider.java @@ -28,10 +28,11 @@ static ResourceProvider initResourceProvider() { return ResourceProvider.RP_FUNCTIONS; } else if (!Strings.isNullOrEmpty(System.getenv("WEBSITE_SITE_NAME"))) { return ResourceProvider.RP_APPSVC; - } else if (!Strings.isNullOrEmpty(System.getenv("KUBERNETES_SERVICE_HOST"))) { - return ResourceProvider.RP_AKS; } else if (!Strings.isNullOrEmpty(System.getenv("APPLICATIONINSIGHTS_SPRINGCLOUD_SERVICE_ID"))) { + // Spring Cloud needs to be checked before AKS since it runs on AKS return ResourceProvider.RP_SPRING_CLOUD; + } else if (!Strings.isNullOrEmpty(System.getenv("KUBERNETES_SERVICE_HOST"))) { + return ResourceProvider.RP_AKS; } else { return ResourceProvider.UNKNOWN; } diff --git a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/test/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/quickpulse/QuickPulseDataCollectorTests.java b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/test/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/quickpulse/QuickPulseDataCollectorTests.java index 46d1b5ad0bd94..e97835cfc13b9 100644 --- a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/test/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/quickpulse/QuickPulseDataCollectorTests.java +++ b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/test/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/quickpulse/QuickPulseDataCollectorTests.java @@ -7,26 +7,16 @@ import com.azure.monitor.opentelemetry.autoconfigure.implementation.builders.MessageTelemetryBuilder; import com.azure.monitor.opentelemetry.autoconfigure.implementation.configuration.ConnectionString; import com.azure.monitor.opentelemetry.autoconfigure.implementation.models.TelemetryItem; +import com.azure.monitor.opentelemetry.autoconfigure.implementation.quickpulse.filtering.DerivedMetricProjections; import com.azure.monitor.opentelemetry.autoconfigure.implementation.quickpulse.filtering.FilteringConfiguration; +import com.azure.monitor.opentelemetry.autoconfigure.implementation.quickpulse.filtering.KnownExceptionColumns; import com.azure.monitor.opentelemetry.autoconfigure.implementation.quickpulse.filtering.KnownRequestColumns; -import com.azure.monitor.opentelemetry.autoconfigure.implementation.quickpulse.swagger.models.TelemetryType; -import com.azure.monitor.opentelemetry.autoconfigure.implementation.quickpulse.swagger.models.DocumentIngress; -import com.azure.monitor.opentelemetry.autoconfigure.implementation.quickpulse.swagger.models.CollectionConfigurationInfo; -import com.azure.monitor.opentelemetry.autoconfigure.implementation.quickpulse.swagger.models.DocumentFilterConjunctionGroupInfo; -import com.azure.monitor.opentelemetry.autoconfigure.implementation.quickpulse.swagger.models.DocumentStreamInfo; -import com.azure.monitor.opentelemetry.autoconfigure.implementation.quickpulse.swagger.models.FilterInfo; -import com.azure.monitor.opentelemetry.autoconfigure.implementation.quickpulse.swagger.models.FilterConjunctionGroupInfo; -import com.azure.monitor.opentelemetry.autoconfigure.implementation.quickpulse.swagger.models.DocumentType; -import com.azure.monitor.opentelemetry.autoconfigure.implementation.quickpulse.swagger.models.RemoteDependency; -import com.azure.monitor.opentelemetry.autoconfigure.implementation.quickpulse.swagger.models.PredicateType; -import com.azure.monitor.opentelemetry.autoconfigure.implementation.quickpulse.swagger.models.Request; +import com.azure.monitor.opentelemetry.autoconfigure.implementation.quickpulse.swagger.models.*; import org.junit.jupiter.api.Test; import java.time.Duration; -import java.util.Date; +import java.util.*; import java.util.concurrent.atomic.AtomicReference; -import java.util.List; -import java.util.ArrayList; import static com.azure.monitor.opentelemetry.autoconfigure.implementation.quickpulse.QuickPulseTestBase.createRemoteDependencyTelemetry; import static com.azure.monitor.opentelemetry.autoconfigure.implementation.quickpulse.QuickPulseTestBase.createRequestTelemetry; @@ -260,7 +250,7 @@ void honorDefaultConfig() { collector.setQuickPulseStatus(QuickPulseStatus.QP_IS_ON); collector.enable(FAKE_CONNECTION_STRING::getInstrumentationKey); - createTelemetryItemsForDocsFiltering(collector); + createTelemetryItemsForFiltering(collector); QuickPulseDataCollector.FinalCounters counters = collector.peek(); List documents = counters.documentList; @@ -277,17 +267,7 @@ void honorDefaultConfig() { DocumentIngress traceDoc = counters.documentList.get(3); assertThat(traceDoc.getDocumentType()).isEqualTo(DocumentType.TRACE); - assertThat(counters.rdds).isEqualTo(2); - assertThat(counters.unsuccessfulRdds).isEqualTo(1); - // The below line represents the "\\ApplicationInsights\\Dependency Call Duration" counter, which is meant to be an average in the 1s interval. (500 + 300) / 2 = 400. - // See this same logic used in the QuickPulseDataFetcher when building the monitoring point. - assertThat(counters.rddsDuration / counters.rdds).isEqualTo(400); - assertThat(counters.requests).isEqualTo(2); - assertThat(counters.unsuccessfulRequests).isEqualTo(1); - // The below line represents the "\\ApplicationInsights\\Request Duration" counter, which is meant to be an average in the 1s interval. (500 + 300) / 2 = 400. - // See this same logic used in the QuickPulseDataFetcher when building the monitoring point. - assertThat(counters.requestsDuration / counters.requests).isEqualTo(400); - assertThat(counters.exceptions).isEqualTo(1); + assertDefaultMetrics(counters); counters = collector.getAndRestart(); assertCountersReset(collector.peek()); @@ -303,7 +283,7 @@ void honorDifferentMultipleSessionDocConfig() { collector.setQuickPulseStatus(QuickPulseStatus.QP_IS_ON); collector.enable(FAKE_CONNECTION_STRING::getInstrumentationKey); - createTelemetryItemsForDocsFiltering(collector); + createTelemetryItemsForFiltering(collector); QuickPulseDataCollector.FinalCounters counters = collector.peek(); List documents = counters.documentList; @@ -346,7 +326,7 @@ void honorDuplicateMultipleSessionDocConfig() { QuickPulseDataCollector collector = new QuickPulseDataCollector(configuration); collector.setQuickPulseStatus(QuickPulseStatus.QP_IS_ON); collector.enable(FAKE_CONNECTION_STRING::getInstrumentationKey); - createTelemetryItemsForDocsFiltering(collector); + createTelemetryItemsForFiltering(collector); QuickPulseDataCollector.FinalCounters counters = collector.peek(); List documents = counters.documentList; @@ -375,7 +355,56 @@ void honorDuplicateMultipleSessionDocConfig() { assertCountersReset(collector.peek()); } - private void createTelemetryItemsForDocsFiltering(QuickPulseDataCollector collector) { + @Test + void testMetricChartFiltering() { + CollectionConfigurationInfo derivedMetricsConfig = createDerivedMetricConfig(); + AtomicReference configuration + = new AtomicReference<>(new FilteringConfiguration(derivedMetricsConfig)); + + QuickPulseDataCollector collector = new QuickPulseDataCollector(configuration); + collector.setQuickPulseStatus(QuickPulseStatus.QP_IS_ON); + collector.enable(FAKE_CONNECTION_STRING::getInstrumentationKey); + createTelemetryItemsForFiltering(collector); + + QuickPulseDataCollector.FinalCounters counters = collector.peek(); + // The default metrics should not be impacted by derived metric filters + assertDefaultMetrics(counters); + Map finalDerivedMetricValues = counters.projections; + + // The config asks to take the avg duration of requests that have response code 200. + // Only one such request came through and that request has a duration of 300. + assertThat(finalDerivedMetricValues.get("request-duration")).isEqualTo(300.0); + + // The config asks to count the # of exceptions that contain the message "hi". No + // exceptions contain that message. + assertThat(finalDerivedMetricValues.get("exception-count")).isEqualTo(0.0); + + counters = collector.getAndRestart(); + QuickPulseDataCollector.FinalCounters resetCounters = collector.peek(); + assertCountersReset(resetCounters); + + Map resetProjections = new HashMap<>(); + resetProjections.put("request-duration", 0.0); + resetProjections.put("exception-count", 0.0); + + assertThat(resetCounters.projections).isEqualTo(resetProjections); + } + + private void assertDefaultMetrics(QuickPulseDataCollector.FinalCounters counters) { + assertThat(counters.rdds).isEqualTo(2); + assertThat(counters.unsuccessfulRdds).isEqualTo(1); + // The below line represents the "\\ApplicationInsights\\Dependency Call Duration" counter, which is meant to be an average in the 1s interval. (500 + 300) / 2 = 400. + // See this same logic used in the QuickPulseDataFetcher when building the monitoring point. + assertThat(counters.rddsDuration / counters.rdds).isEqualTo(400); + assertThat(counters.requests).isEqualTo(2); + assertThat(counters.unsuccessfulRequests).isEqualTo(1); + // The below line represents the "\\ApplicationInsights\\Request Duration" counter, which is meant to be an average in the 1s interval. (500 + 300) / 2 = 400. + // See this same logic used in the QuickPulseDataFetcher when building the monitoring point. + assertThat(counters.requestsDuration / counters.requests).isEqualTo(400); + assertThat(counters.exceptions).isEqualTo(1); + } + + private void createTelemetryItemsForFiltering(QuickPulseDataCollector collector) { collector.setQuickPulseStatus(QuickPulseStatus.QP_IS_ON); collector.enable(FAKE_CONNECTION_STRING::getInstrumentationKey); @@ -493,4 +522,74 @@ private DocumentStreamInfo createDocumentStream(boolean isDefault) { return documentStreamInfo; } + + private CollectionConfigurationInfo createDerivedMetricConfig() { + CollectionConfigurationInfo config = new CollectionConfigurationInfo(); + List documentStreams = new ArrayList<>(); + DocumentStreamInfo defaultStream = createDocumentStream(true); + documentStreams.add(defaultStream); + + config.setDocumentStreams(documentStreams); + config.setETag("random-etag"); + + List metrics = new ArrayList<>(); + DerivedMetricInfo requestDuration = createRequestDurationDerivedMetricInfo(); + DerivedMetricInfo exceptionCount = createExceptionCountDerivedMetricInfo(); + metrics.add(requestDuration); + metrics.add(exceptionCount); + + config.setMetrics(metrics); + + return config; + } + + private DerivedMetricInfo createRequestDurationDerivedMetricInfo() { + DerivedMetricInfo dmi = new DerivedMetricInfo(); + dmi.setId("request-duration"); + dmi.setTelemetryType("Request"); + dmi.setAggregation(AggregationType.AVG); + dmi.setBackEndAggregation(AggregationType.AVG); + dmi.setProjection(KnownRequestColumns.DURATION); + + FilterInfo filter = new FilterInfo(); + filter.setFieldName(KnownRequestColumns.RESPONSE_CODE); + filter.setPredicate(PredicateType.EQUAL); + filter.setComparand("200"); + List filters = new ArrayList<>(); + filters.add(filter); + + FilterConjunctionGroupInfo filterGroup = new FilterConjunctionGroupInfo(); + filterGroup.setFilters(filters); + + List filterGroups = new ArrayList<>(); + filterGroups.add(filterGroup); + dmi.setFilterGroups(filterGroups); + + return dmi; + } + + private DerivedMetricInfo createExceptionCountDerivedMetricInfo() { + DerivedMetricInfo dmi = new DerivedMetricInfo(); + dmi.setId("exception-count"); + dmi.setTelemetryType("Exception"); + dmi.setAggregation(AggregationType.SUM); + dmi.setBackEndAggregation(AggregationType.SUM); + dmi.setProjection(DerivedMetricProjections.COUNT); + + FilterInfo filter = new FilterInfo(); + filter.setFieldName(KnownExceptionColumns.MESSAGE); + filter.setPredicate(PredicateType.CONTAINS); + filter.setComparand("hi"); + List filters = new ArrayList<>(); + filters.add(filter); + + FilterConjunctionGroupInfo filterGroup = new FilterConjunctionGroupInfo(); + filterGroup.setFilters(filters); + + List filterGroups = new ArrayList<>(); + filterGroups.add(filterGroup); + dmi.setFilterGroups(filterGroups); + + return dmi; + } } diff --git a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/test/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/quickpulse/filteringTest/DerivedMetricProjectionsTest.java b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/test/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/quickpulse/filteringTest/DerivedMetricProjectionsTest.java new file mode 100644 index 0000000000000..7b3c164380cb1 --- /dev/null +++ b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/test/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/quickpulse/filteringTest/DerivedMetricProjectionsTest.java @@ -0,0 +1,240 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.monitor.opentelemetry.autoconfigure.implementation.quickpulse.filteringTest; + +import com.azure.monitor.opentelemetry.autoconfigure.implementation.quickpulse.filtering.*; +import com.azure.monitor.opentelemetry.autoconfigure.implementation.quickpulse.swagger.models.*; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static java.util.Arrays.asList; +import static org.junit.jupiter.api.Assertions.assertEquals; + +class DerivedMetricProjectionsTest { + + public static final String REQUEST_AVG = "request-avg"; + public static final String REQUEST = "Request"; + public static final String DEPENDENCY = "Dependency"; + public static final String EXCEPTION = "Exception"; + public static final String TRACE = "Trace"; + + private DerivedMetricInfo createDerivedMetricInfoWithEmptyFilters(String id, String telemetryType, + AggregationType agg, AggregationType backendAgg, String projection) { + DerivedMetricInfo result = new DerivedMetricInfo(); + result.setId(id); + result.setTelemetryType(telemetryType); + result.setAggregation(agg); + result.setBackEndAggregation(backendAgg); + result.setProjection(projection); + + FilterConjunctionGroupInfo filterGroup = new FilterConjunctionGroupInfo(); + filterGroup.setFilters(new ArrayList()); + List filterGroups = asList(filterGroup); + + result.setFilterGroups(filterGroups); + return result; + } + + @Test + void testCountProjection() { + String requestId = "id-for-request"; + String dependencyId = "id-for-dependency"; + String exceptionId = "id-for-exception"; + String traceId = "id-for-trace"; + + DerivedMetricInfo dmiRequest = createDerivedMetricInfoWithEmptyFilters(requestId, REQUEST, AggregationType.SUM, + AggregationType.SUM, DerivedMetricProjections.COUNT); + + DerivedMetricInfo dmiDep = createDerivedMetricInfoWithEmptyFilters(dependencyId, DEPENDENCY, + AggregationType.SUM, AggregationType.SUM, DerivedMetricProjections.COUNT); + + DerivedMetricInfo dmiException = createDerivedMetricInfoWithEmptyFilters(exceptionId, EXCEPTION, + AggregationType.SUM, AggregationType.SUM, DerivedMetricProjections.COUNT); + + DerivedMetricInfo dmiTrace = createDerivedMetricInfoWithEmptyFilters(traceId, TRACE, AggregationType.SUM, + AggregationType.SUM, DerivedMetricProjections.COUNT); + + RequestDataColumns request = new RequestDataColumns("https://test.com/hiThere", 200000L, 200, true, + "GET /hiThere", new HashMap<>(), new HashMap<>()); + DependencyDataColumns dependency = new DependencyDataColumns("test.com", 200000L, true, "GET /hiThere", 200, + "HTTP", "https://test.com/hiThere?x=y", new HashMap<>(), new HashMap<>()); + ExceptionDataColumns exception + = new ExceptionDataColumns("Exception Message", "Stack Trace", new HashMap<>(), new HashMap<>()); + TraceDataColumns trace = new TraceDataColumns("Message", new HashMap<>(), new HashMap<>()); + + Map projectionInfo = new HashMap<>(); + projectionInfo.put(requestId, AggregationType.SUM); + projectionInfo.put(dependencyId, AggregationType.SUM); + projectionInfo.put(exceptionId, AggregationType.SUM); + projectionInfo.put(traceId, AggregationType.SUM); + DerivedMetricProjections projections = new DerivedMetricProjections(projectionInfo); + + for (int i = 0; i < 2; i++) { + projections.calculateProjection(dmiRequest, request); + } + + for (int i = 0; i < 3; i++) { + projections.calculateProjection(dmiDep, dependency); + } + + for (int i = 0; i < 4; i++) { + projections.calculateProjection(dmiTrace, trace); + } + + projections.calculateProjection(dmiException, exception); + + Map finalValues = projections.fetchFinalDerivedMetricValues(); + assertEquals(finalValues.get(requestId), 2.0); + assertEquals(finalValues.get(dependencyId), 3.0); + assertEquals(finalValues.get(exceptionId), 1.0); + assertEquals(finalValues.get(traceId), 4.0); + } + + @Test + void testDurationAvgProjection() { + testDurationProjectionWith(REQUEST_AVG, "dependency-avg", AggregationType.AVG, 400.0); + } + + @Test + void testDurationMinProjection() { + testDurationProjectionWith("request-min", "dependency-min", AggregationType.MIN, 200.0); + } + + @Test + void testDurationMaxProjection() { + testDurationProjectionWith("request-max", "dependency-max", AggregationType.MAX, 600.0); + } + + @Test + void testCustomDimensionAvgProjection() { + testCustomDimProjectionWith(REQUEST_AVG, AggregationType.AVG, 8.0); + } + + @Test + void testCustomDimensionMinProjection() { + testCustomDimProjectionWith("request-min", AggregationType.MIN, 4.0); + } + + @Test + void testCustomDimensionMaxProjection() { + testCustomDimProjectionWith("request-max", AggregationType.MAX, 15.0); + } + + @Test + void testCustomDimensionSumProjection() { + testCustomDimProjectionWith("request-sum", AggregationType.SUM, 24.0); + } + + @Test + void testInvalidCustomDimensionProjection() { + DerivedMetricInfo dmiRequest = createDerivedMetricInfoWithEmptyFilters(REQUEST_AVG, REQUEST, + AggregationType.AVG, AggregationType.AVG, "CustomDimensions.property"); + + Map projectionInfo = new HashMap<>(); + projectionInfo.put(REQUEST_AVG, AggregationType.AVG); + DerivedMetricProjections projections = new DerivedMetricProjections(projectionInfo); + + // The case where the desired custom dimension property is not in the request + RequestDataColumns notContained = new RequestDataColumns("https://test.com/hiThere", 200000L, 200, true, + "GET /hiThere", new HashMap<>(), new HashMap<>()); + projections.calculateProjection(dmiRequest, notContained); + + // The case where the value of the desired custom dim property can't be parsed to a double + Map customDims = new HashMap<>(); + customDims.put("property", "hi"); + RequestDataColumns notDouble = new RequestDataColumns("https://test.com/hiThere", 200000L, 200, true, + "GET /hiThere", customDims, new HashMap<>()); + projections.calculateProjection(dmiRequest, notDouble); + + // invalid values should not be counted. + Map finalValues = projections.fetchFinalDerivedMetricValues(); + assertEquals(finalValues.get(REQUEST_AVG), 0.0); + } + + private List createRequestsOfDurations(List durations) { + List result = new ArrayList<>(); + for (int i = 0; i < durations.size(); i++) { + result.add(new RequestDataColumns("https://test.com/hiThere", durations.get(i), 200, true, "GET /hiThere", + new HashMap<>(), new HashMap<>())); + } + return result; + } + + private List createDepsOfDurations(List durations) { + List result = new ArrayList<>(); + for (int i = 0; i < durations.size(); i++) { + result.add(new DependencyDataColumns("test.com", durations.get(i), true, "GET /hiThere", 200, "HTTP", + "https://test.com/hiThere?x=y", new HashMap<>(), new HashMap<>())); + } + return result; + } + + private void testDurationProjectionWith(String requestId, String dependencyId, AggregationType aggregationType, + double expectedValue) { + DerivedMetricInfo dmiRequest = createDerivedMetricInfoWithEmptyFilters(requestId, REQUEST, aggregationType, + aggregationType, KnownRequestColumns.DURATION); + + DerivedMetricInfo dmiDep = createDerivedMetricInfoWithEmptyFilters(dependencyId, DEPENDENCY, aggregationType, + aggregationType, KnownRequestColumns.DURATION); + + List durations = asList(200000L, 400000L, 600000L); + List requests = createRequestsOfDurations(durations); + List depedencies = createDepsOfDurations(durations); + + Map projectionInfo = new HashMap<>(); + projectionInfo.put(requestId, aggregationType); + projectionInfo.put(dependencyId, aggregationType); + + DerivedMetricProjections projections = new DerivedMetricProjections(projectionInfo); + + // request duration + for (RequestDataColumns request : requests) { + projections.calculateProjection(dmiRequest, request); + } + + // dep duration + for (DependencyDataColumns dep : depedencies) { + projections.calculateProjection(dmiDep, dep); + } + + Map finalValues = projections.fetchFinalDerivedMetricValues(); + assertEquals(finalValues.get(requestId), expectedValue); + assertEquals(finalValues.get(dependencyId), expectedValue); + } + + private void testCustomDimProjectionWith(String requestId, AggregationType aggregationType, double expectedValue) { + DerivedMetricInfo dmiRequest = createDerivedMetricInfoWithEmptyFilters(requestId, REQUEST, aggregationType, + aggregationType, "CustomDimensions.property"); + + Map projectionInfo = new HashMap<>(); + projectionInfo.put(requestId, aggregationType); + DerivedMetricProjections projections = new DerivedMetricProjections(projectionInfo); + + List customDimValues = asList("5.0", "15.0", "4.0"); + List requests = createRequestsWithCustomDimValues(customDimValues); + + for (RequestDataColumns request : requests) { + projections.calculateProjection(dmiRequest, request); + } + + Map finalValues = projections.fetchFinalDerivedMetricValues(); + assertEquals(finalValues.get(requestId), expectedValue); + } + + private List createRequestsWithCustomDimValues(List customDimValues) { + List result = new ArrayList<>(); + for (String value : customDimValues) { + Map customDims = new HashMap<>(); + customDims.put("property", value); + result.add(new RequestDataColumns("https://test.com/hiThere", 200000L, 200, true, "GET /hiThere", + customDims, new HashMap<>())); + } + return result; + } + +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/CHANGELOG.md b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/CHANGELOG.md index c6ee3987396b2..6f93fb1ba75c8 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/CHANGELOG.md +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 1.0.0-beta.7 (Unreleased) +## 1.1.0-beta.1 (Unreleased) ### Features Added @@ -10,6 +10,14 @@ ### Other Changes +## 1.0.0 (2024-12-20) + +- Azure Resource Manager MySql client library for Java. This package contains Microsoft Azure SDK for MySql Management SDK. The Microsoft Azure management API provides create, read, update, and delete functionality for Azure MySQL resources including servers, databases, firewall rules, VNET rules, log files and configurations with new business model. Package tag package-flexibleserver-2021-05-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +### Other Changes + +Release for the azure-resourcemanager-mysqlflexibleserver Java SDK. + ## 1.0.0-beta.6 (2024-12-04) - Azure Resource Manager MySql client library for Java. This package contains Microsoft Azure SDK for MySql Management SDK. The Microsoft Azure management API provides create, read, update, and delete functionality for Azure MySQL resources including servers, databases, firewall rules, VNET rules, log files and configurations with new business model. Package tag package-flexibleserver-2023-12-30. 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/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/README.md b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/README.md index cca9d4a3ab85c..f1443068026f2 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/README.md +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/README.md @@ -2,7 +2,7 @@ Azure Resource Manager MySql client library for Java. -This package contains Microsoft Azure SDK for MySql Management SDK. The Microsoft Azure management API provides create, read, update, and delete functionality for Azure MySQL resources including servers, databases, firewall rules, VNET rules, log files and configurations with new business model. Package tag package-flexibleserver-2023-12-30. 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 MySql Management SDK. The Microsoft Azure management API provides create, read, update, and delete functionality for Azure MySQL resources including servers, databases, firewall rules, VNET rules, log files and configurations with new business model. Package tag package-flexibleserver-2021-05-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-mysqlflexibleserver - 1.0.0-beta.6 + 1.0.0 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/SAMPLE.md b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/SAMPLE.md index 7396434a28c0e..560c855ac0718 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/SAMPLE.md +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/SAMPLE.md @@ -1,30 +1,10 @@ # Code snippets and samples -## AdvancedThreatProtectionSettings - -- [Get](#advancedthreatprotectionsettings_get) -- [List](#advancedthreatprotectionsettings_list) -- [Update](#advancedthreatprotectionsettings_update) -- [UpdatePut](#advancedthreatprotectionsettings_updateput) - -## AzureADAdministrators - -- [CreateOrUpdate](#azureadadministrators_createorupdate) -- [Delete](#azureadadministrators_delete) -- [Get](#azureadadministrators_get) -- [ListByServer](#azureadadministrators_listbyserver) - -## BackupAndExport - -- [Create](#backupandexport_create) -- [ValidateBackup](#backupandexport_validatebackup) - ## Backups - [Get](#backups_get) - [ListByServer](#backups_listbyserver) -- [Put](#backups_put) ## CheckNameAvailability @@ -41,7 +21,6 @@ ## Configurations - [BatchUpdate](#configurations_batchupdate) -- [CreateOrUpdate](#configurations_createorupdate) - [Get](#configurations_get) - [ListByServer](#configurations_listbyserver) - [Update](#configurations_update) @@ -68,38 +47,6 @@ - [List](#locationbasedcapabilities_list) -## LocationBasedCapabilitySet - -- [Get](#locationbasedcapabilityset_get) -- [List](#locationbasedcapabilityset_list) - -## LogFiles - -- [ListByServer](#logfiles_listbyserver) - -## LongRunningBackup - -- [Create](#longrunningbackup_create) - -## LongRunningBackupsOperation - -- [Get](#longrunningbackupsoperation_get) -- [List](#longrunningbackupsoperation_list) - -## Maintenances - -- [List](#maintenances_list) -- [Read](#maintenances_read) -- [Update](#maintenances_update) - -## OperationProgress - -- [Get](#operationprogress_get) - -## OperationResults - -- [Get](#operationresults_get) - ## Operations - [List](#operations_list) @@ -116,337 +63,10 @@ - [GetByResourceGroup](#servers_getbyresourcegroup) - [List](#servers_list) - [ListByResourceGroup](#servers_listbyresourcegroup) -- [ResetGtid](#servers_resetgtid) - [Restart](#servers_restart) - [Start](#servers_start) - [Stop](#servers_stop) - [Update](#servers_update) -- [ValidateEstimateHighAvailability](#servers_validateestimatehighavailability) - -## ServersMigration - -- [CutoverMigration](#serversmigration_cutovermigration) -### AdvancedThreatProtectionSettings_Get - -```java -import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionName; - -/** - * Samples for AdvancedThreatProtectionSettings Get. - */ -public final class AdvancedThreatProtectionSettingsGetSamples { - /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ - * AdvancedThreatProtectionSettingsGet.json - */ - /** - * Sample code: Get a server's Advanced Threat Protection settings. - * - * @param manager Entry point to MySqlManager. - */ - public static void getAServerSAdvancedThreatProtectionSettings( - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.advancedThreatProtectionSettings() - .getWithResponse("threatprotection-6852", "threatprotection-2080", AdvancedThreatProtectionName.DEFAULT, - com.azure.core.util.Context.NONE); - } -} -``` - -### AdvancedThreatProtectionSettings_List - -```java -/** - * Samples for AdvancedThreatProtectionSettings List. - */ -public final class AdvancedThreatProtectionSettingsListSamples { - /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ - * AdvancedThreatProtectionSettingsList.json - */ - /** - * Sample code: Get list of server's Advanced Threat Protection settings. - * - * @param manager Entry point to MySqlManager. - */ - public static void getListOfServerSAdvancedThreatProtectionSettings( - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.advancedThreatProtectionSettings() - .list("threatprotection-6852", "threatprotection-2080", com.azure.core.util.Context.NONE); - } -} -``` - -### AdvancedThreatProtectionSettings_Update - -```java -import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionForUpdate; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionName; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionState; - -/** - * Samples for AdvancedThreatProtectionSettings Update. - */ -public final class AdvancedThreatProtectionSettingsUpdateSamples { - /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ - * AdvancedThreatProtectionSettingsPatchDisabled.json - */ - /** - * Sample code: Disable a server's Advanced Threat Protection settings with all parameters. - * - * @param manager Entry point to MySqlManager. - */ - public static void disableAServerSAdvancedThreatProtectionSettingsWithAllParameters( - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.advancedThreatProtectionSettings() - .update("threatprotection-4799", "threatprotection-6440", AdvancedThreatProtectionName.DEFAULT, - new AdvancedThreatProtectionForUpdate().withState(AdvancedThreatProtectionState.DISABLED), - com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ - * AdvancedThreatProtectionSettingsPatchEnabled.json - */ - /** - * Sample code: Enable a server's Advanced Threat Protection settings. - * - * @param manager Entry point to MySqlManager. - */ - public static void enableAServerSAdvancedThreatProtectionSettings( - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.advancedThreatProtectionSettings() - .update("threatprotection-4799", "threatprotection-6440", AdvancedThreatProtectionName.DEFAULT, - new AdvancedThreatProtectionForUpdate().withState(AdvancedThreatProtectionState.ENABLED), - com.azure.core.util.Context.NONE); - } -} -``` - -### AdvancedThreatProtectionSettings_UpdatePut - -```java -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AdvancedThreatProtectionInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionName; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionState; - -/** - * Samples for AdvancedThreatProtectionSettings UpdatePut. - */ -public final class AdvancedThreatProtectionSettingsUpdatePutSamples { - /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ - * AdvancedThreatProtectionSettingsPutDisabled.json - */ - /** - * Sample code: Disable a server's Advanced Threat Protection settings with all parameters using PUT. - * - * @param manager Entry point to MySqlManager. - */ - public static void disableAServerSAdvancedThreatProtectionSettingsWithAllParametersUsingPUT( - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.advancedThreatProtectionSettings() - .updatePut("threatprotection-4799", "threatprotection-6440", AdvancedThreatProtectionName.DEFAULT, - new AdvancedThreatProtectionInner().withState(AdvancedThreatProtectionState.DISABLED), - com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ - * AdvancedThreatProtectionSettingsPutEnabled.json - */ - /** - * Sample code: Enable a server's Advanced Threat Protection settings using PUT. - * - * @param manager Entry point to MySqlManager. - */ - public static void enableAServerSAdvancedThreatProtectionSettingsUsingPUT( - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.advancedThreatProtectionSettings() - .updatePut("threatprotection-4799", "threatprotection-6440", AdvancedThreatProtectionName.DEFAULT, - new AdvancedThreatProtectionInner().withState(AdvancedThreatProtectionState.ENABLED), - com.azure.core.util.Context.NONE); - } -} -``` - -### AzureADAdministrators_CreateOrUpdate - -```java -import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorName; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorType; - -/** - * Samples for AzureADAdministrators CreateOrUpdate. - */ -public final class AzureADAdministratorsCreateOrUpdateSamples { - /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/AAD/preview/2023-06-01-preview/examples/ - * AzureADAdministratorCreate.json - */ - /** - * Sample code: Create an azure ad administrator. - * - * @param manager Entry point to MySqlManager. - */ - public static void - createAnAzureAdAdministrator(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.azureADAdministrators() - .define(AdministratorName.ACTIVE_DIRECTORY) - .withExistingFlexibleServer("testrg", "mysqltestsvc4") - .withAdministratorType(AdministratorType.ACTIVE_DIRECTORY) - .withLogin("bob@contoso.com") - .withSid("c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c") - .withTenantId("c12b7025-bfe2-46c1-b463-993b5e4cd467") - .withIdentityResourceId( - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/test-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-umi") - .create(); - } -} -``` - -### AzureADAdministrators_Delete - -```java -import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorName; - -/** - * Samples for AzureADAdministrators Delete. - */ -public final class AzureADAdministratorsDeleteSamples { - /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/AAD/preview/2023-06-01-preview/examples/ - * AzureADAdministratorDelete.json - */ - /** - * Sample code: Delete an azure ad administrator. - * - * @param manager Entry point to MySqlManager. - */ - public static void - deleteAnAzureAdAdministrator(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.azureADAdministrators() - .delete("testrg", "mysqltestsvc4", AdministratorName.ACTIVE_DIRECTORY, com.azure.core.util.Context.NONE); - } -} -``` - -### AzureADAdministrators_Get - -```java -import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorName; - -/** - * Samples for AzureADAdministrators Get. - */ -public final class AzureADAdministratorsGetSamples { - /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/AAD/preview/2023-06-01-preview/examples/ - * AzureADAdministratorGet.json - */ - /** - * Sample code: Get an azure ad administrator. - * - * @param manager Entry point to MySqlManager. - */ - public static void getAnAzureAdAdministrator(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.azureADAdministrators() - .getWithResponse("testrg", "mysqltestsvc4", AdministratorName.ACTIVE_DIRECTORY, - com.azure.core.util.Context.NONE); - } -} -``` - -### AzureADAdministrators_ListByServer - -```java -/** - * Samples for AzureADAdministrators ListByServer. - */ -public final class AzureADAdministratorsListByServerSamples { - /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/AAD/preview/2023-06-01-preview/examples/ - * AzureADAdministratorsListByServer.json - */ - /** - * Sample code: List Azure AD administrators in a server. - * - * @param manager Entry point to MySqlManager. - */ - public static void - listAzureADAdministratorsInAServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.azureADAdministrators().listByServer("testrg", "mysqltestsvc4", com.azure.core.util.Context.NONE); - } -} -``` - -### BackupAndExport_Create - -```java -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupAndExportRequest; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupSettings; -import com.azure.resourcemanager.mysqlflexibleserver.models.FullBackupStoreDetails; -import java.util.Arrays; - -/** - * Samples for BackupAndExport Create. - */ -public final class BackupAndExportCreateSamples { - /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/preview/2023-10-01-preview/examples/ - * BackupAndExport.json - */ - /** - * Sample code: Create and Export Backup. - * - * @param manager Entry point to MySqlManager. - */ - public static void createAndExportBackup(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.backupAndExports() - .create("TestGroup", "mysqltestserver", new BackupAndExportRequest() - .withBackupSettings(new BackupSettings().withBackupName("customer-backup-name")) - .withTargetDetails(new FullBackupStoreDetails().withSasUriList(Arrays.asList("sasuri1", "sasuri2"))), - com.azure.core.util.Context.NONE); - } -} -``` - -### BackupAndExport_ValidateBackup - -```java -/** - * Samples for BackupAndExport ValidateBackup. - */ -public final class BackupAndExportValidateBackupSamples { - /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/preview/2023-10-01-preview/examples/ - * ValidateBackup.json - */ - /** - * Sample code: Validate Backup. - * - * @param manager Entry point to MySqlManager. - */ - public static void validateBackup(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.backupAndExports() - .validateBackupWithResponse("TestGroup", "mysqltestserver", com.azure.core.util.Context.NONE); - } -} -``` - ### Backups_Get ```java @@ -456,8 +76,7 @@ public final class BackupAndExportValidateBackupSamples { public final class BackupsGetSamples { /* * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/preview/2023-10-01-preview/examples/BackupGet. - * json + * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/BackupGet.json */ /** * Sample code: Get a backup for a server. @@ -480,8 +99,8 @@ public final class BackupsGetSamples { public final class BackupsListByServerSamples { /* * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/preview/2023-10-01-preview/examples/ - * BackupsListByServer.json + * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/BackupsListByServer. + * json */ /** * Sample code: List backups for a server. @@ -494,29 +113,6 @@ public final class BackupsListByServerSamples { } ``` -### Backups_Put - -```java -/** - * Samples for Backups Put. - */ -public final class BackupsPutSamples { - /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/preview/2023-10-01-preview/examples/BackupPut. - * json - */ - /** - * Sample code: Create backup for a server. - * - * @param manager Entry point to MySqlManager. - */ - public static void createBackupForAServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.backups().putWithResponse("TestGroup", "mysqltestserver", "mybackup", com.azure.core.util.Context.NONE); - } -} -``` - ### CheckNameAvailability_Execute ```java @@ -528,8 +124,8 @@ import com.azure.resourcemanager.mysqlflexibleserver.models.NameAvailabilityRequ public final class CheckNameAvailabilityExecuteSamples { /* * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/stable/2023-12-30/examples/ - * CheckNameAvailability.json + * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/CheckNameAvailability + * .json */ /** * Sample code: Check name availability. @@ -538,731 +134,405 @@ public final class CheckNameAvailabilityExecuteSamples { */ public static void checkNameAvailability(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { manager.checkNameAvailabilities() - .executeWithResponse("SouthEastAsia", - new NameAvailabilityRequest().withName("name1").withType("Microsoft.DBforMySQL/flexibleServers"), - com.azure.core.util.Context.NONE); - } -} -``` - -### CheckNameAvailabilityWithoutLocation_Execute - -```java -import com.azure.resourcemanager.mysqlflexibleserver.models.NameAvailabilityRequest; - -/** - * Samples for CheckNameAvailabilityWithoutLocation Execute. - */ -public final class CheckNameAvailabilityWithoutLocationExecuteSamples { - /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/stable/2023-12-30/examples/ - * CheckNameAvailability.json - */ - /** - * Sample code: Check name availability. - * - * @param manager Entry point to MySqlManager. - */ - public static void checkNameAvailability(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.checkNameAvailabilityWithoutLocations() - .executeWithResponse( - new NameAvailabilityRequest().withName("name1").withType("Microsoft.DBforMySQL/flexibleServers"), - com.azure.core.util.Context.NONE); - } -} -``` - -### CheckVirtualNetworkSubnetUsage_Execute - -```java -import com.azure.resourcemanager.mysqlflexibleserver.models.VirtualNetworkSubnetUsageParameter; - -/** - * Samples for CheckVirtualNetworkSubnetUsage Execute. - */ -public final class CheckVirtualNetworkSubnetUsageExecuteSamples { - /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/stable/2023-12-30/examples/ - * CheckVirtualNetworkSubnetUsage.json - */ - /** - * Sample code: CheckVirtualNetworkSubnetUsage. - * - * @param manager Entry point to MySqlManager. - */ - public static void - checkVirtualNetworkSubnetUsage(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.checkVirtualNetworkSubnetUsages() - .executeWithResponse("WestUS", new VirtualNetworkSubnetUsageParameter().withVirtualNetworkResourceId( - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/testvnet"), - com.azure.core.util.Context.NONE); - } -} -``` - -### Configurations_BatchUpdate - -```java -import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationForBatchUpdate; -import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationListForBatchUpdate; -import com.azure.resourcemanager.mysqlflexibleserver.models.ResetAllToDefault; -import java.util.Arrays; - -/** - * Samples for Configurations BatchUpdate. - */ -public final class ConfigurationsBatchUpdateSamples { - /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/Configurations/preview/2023-06-01-preview/examples/ - * ConfigurationsBatchUpdate.json - */ - /** - * Sample code: ConfigurationList. - * - * @param manager Entry point to MySqlManager. - */ - public static void configurationList(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.configurations() - .batchUpdate("testrg", "mysqltestserver", new ConfigurationListForBatchUpdate() - .withValue(Arrays.asList(new ConfigurationForBatchUpdate().withName("event_scheduler").withValue("OFF"), - new ConfigurationForBatchUpdate().withName("div_precision_increment").withValue("8"))) - .withResetAllToDefault(ResetAllToDefault.FALSE), com.azure.core.util.Context.NONE); - } -} -``` - -### Configurations_CreateOrUpdate - -```java -import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationSource; - -/** - * Samples for Configurations CreateOrUpdate. - */ -public final class ConfigurationsCreateOrUpdateSamples { - /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/Configurations/preview/2023-06-01-preview/examples/ - * ConfigurationCreateOrUpdate.json - */ - /** - * Sample code: ConfigurationCreateOrUpdate. - * - * @param manager Entry point to MySqlManager. - */ - public static void configurationCreateOrUpdate(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.configurations() - .define("event_scheduler") - .withExistingFlexibleServer("TestGroup", "testserver") - .withValue("off") - .withSource(ConfigurationSource.USER_OVERRIDE) - .create(); - } -} -``` - -### Configurations_Get - -```java -/** - * Samples for Configurations Get. - */ -public final class ConfigurationsGetSamples { - /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/Configurations/preview/2023-06-01-preview/examples/ - * ConfigurationGet.json - */ - /** - * Sample code: Get a configuration. - * - * @param manager Entry point to MySqlManager. - */ - public static void getAConfiguration(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.configurations() - .getWithResponse("TestGroup", "testserver", "event_scheduler", com.azure.core.util.Context.NONE); - } -} -``` - -### Configurations_ListByServer - -```java -/** - * Samples for Configurations ListByServer. - */ -public final class ConfigurationsListByServerSamples { - /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/Configurations/preview/2023-06-01-preview/examples/ - * ConfigurationsListByServer.json - */ - /** - * Sample code: List all configurations for a server. - * - * @param manager Entry point to MySqlManager. - */ - public static void - listAllConfigurationsForAServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.configurations() - .listByServer("testrg", "mysqltestserver", null, null, 1, 8, com.azure.core.util.Context.NONE); - } -} -``` - -### Configurations_Update - -```java -import com.azure.resourcemanager.mysqlflexibleserver.models.Configuration; -import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationSource; - -/** - * Samples for Configurations Update. - */ -public final class ConfigurationsUpdateSamples { - /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/Configurations/preview/2023-06-01-preview/examples/ - * ConfigurationUpdate.json - */ - /** - * Sample code: Update a user configuration. - * - * @param manager Entry point to MySqlManager. - */ - public static void updateAUserConfiguration(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - Configuration resource = manager.configurations() - .getWithResponse("testrg", "testserver", "event_scheduler", com.azure.core.util.Context.NONE) - .getValue(); - resource.update().withValue("on").withSource(ConfigurationSource.USER_OVERRIDE).apply(); - } -} -``` - -### Databases_CreateOrUpdate - -```java -/** - * Samples for Databases CreateOrUpdate. - */ -public final class DatabasesCreateOrUpdateSamples { - /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/Databases/preview/2023-06-01-preview/examples/ - * DatabaseCreate.json - */ - /** - * Sample code: Create a database. - * - * @param manager Entry point to MySqlManager. - */ - public static void createADatabase(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.databases() - .define("db1") - .withExistingFlexibleServer("TestGroup", "testserver") - .withCharset("utf8") - .withCollation("utf8_general_ci") - .create(); - } -} -``` - -### Databases_Delete - -```java -/** - * Samples for Databases Delete. - */ -public final class DatabasesDeleteSamples { - /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/Databases/preview/2023-06-01-preview/examples/ - * DatabaseDelete.json - */ - /** - * Sample code: Delete a database. - * - * @param manager Entry point to MySqlManager. - */ - public static void deleteADatabase(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.databases().delete("TestGroup", "testserver", "db1", com.azure.core.util.Context.NONE); - } -} -``` - -### Databases_Get - -```java -/** - * Samples for Databases Get. - */ -public final class DatabasesGetSamples { - /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/Databases/preview/2023-06-01-preview/examples/ - * DatabaseGet.json - */ - /** - * Sample code: Get a database. - * - * @param manager Entry point to MySqlManager. - */ - public static void getADatabase(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.databases().getWithResponse("TestGroup", "testserver", "db1", com.azure.core.util.Context.NONE); - } -} -``` - -### Databases_ListByServer - -```java -/** - * Samples for Databases ListByServer. - */ -public final class DatabasesListByServerSamples { - /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/Databases/preview/2023-06-01-preview/examples/ - * DatabasesListByServer.json - */ - /** - * Sample code: List databases in a server. - * - * @param manager Entry point to MySqlManager. - */ - public static void listDatabasesInAServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.databases().listByServer("TestGroup", "testserver", com.azure.core.util.Context.NONE); - } -} -``` - -### FirewallRules_CreateOrUpdate - -```java -/** - * Samples for FirewallRules CreateOrUpdate. - */ -public final class FirewallRulesCreateOrUpdateSamples { - /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/Firewall/preview/2023-06-01-preview/examples/ - * FirewallRuleCreate.json - */ - /** - * Sample code: Create a firewall rule. - * - * @param manager Entry point to MySqlManager. - */ - public static void createAFirewallRule(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.firewallRules() - .define("rule1") - .withExistingFlexibleServer("TestGroup", "testserver") - .withStartIpAddress("0.0.0.0") - .withEndIpAddress("255.255.255.255") - .create(); - } -} -``` - -### FirewallRules_Delete - -```java -/** - * Samples for FirewallRules Delete. - */ -public final class FirewallRulesDeleteSamples { - /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/Firewall/preview/2023-06-01-preview/examples/ - * FirewallRuleDelete.json - */ - /** - * Sample code: Delete a firewall rule. - * - * @param manager Entry point to MySqlManager. - */ - public static void deleteAFirewallRule(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.firewallRules().delete("TestGroup", "testserver", "rule1", com.azure.core.util.Context.NONE); + .executeWithResponse("SouthEastAsia", + new NameAvailabilityRequest().withName("name1").withType("Microsoft.DBforMySQL/flexibleServers"), + com.azure.core.util.Context.NONE); } } ``` -### FirewallRules_Get +### CheckNameAvailabilityWithoutLocation_Execute ```java +import com.azure.resourcemanager.mysqlflexibleserver.models.NameAvailabilityRequest; + /** - * Samples for FirewallRules Get. + * Samples for CheckNameAvailabilityWithoutLocation Execute. */ -public final class FirewallRulesGetSamples { +public final class CheckNameAvailabilityWithoutLocationExecuteSamples { /* * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/Firewall/preview/2023-06-01-preview/examples/ - * FirewallRuleGet.json + * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/CheckNameAvailability + * .json */ /** - * Sample code: Get a firewall rule. + * Sample code: Check name availability. * * @param manager Entry point to MySqlManager. */ - public static void getAFirewallRule(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.firewallRules().getWithResponse("TestGroup", "testserver", "rule1", com.azure.core.util.Context.NONE); + public static void checkNameAvailability(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.checkNameAvailabilityWithoutLocations() + .executeWithResponse( + new NameAvailabilityRequest().withName("name1").withType("Microsoft.DBforMySQL/flexibleServers"), + com.azure.core.util.Context.NONE); } } ``` -### FirewallRules_ListByServer +### CheckVirtualNetworkSubnetUsage_Execute ```java +import com.azure.resourcemanager.mysqlflexibleserver.models.VirtualNetworkSubnetUsageParameter; + /** - * Samples for FirewallRules ListByServer. + * Samples for CheckVirtualNetworkSubnetUsage Execute. */ -public final class FirewallRulesListByServerSamples { +public final class CheckVirtualNetworkSubnetUsageExecuteSamples { /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/Firewall/preview/2023-06-01-preview/examples/ - * FirewallRulesListByServer.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ + * CheckVirtualNetworkSubnetUsage.json */ /** - * Sample code: List all firewall rules in a server. + * Sample code: CheckVirtualNetworkSubnetUsage. * * @param manager Entry point to MySqlManager. */ public static void - listAllFirewallRulesInAServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.firewallRules().listByServer("TestGroup", "testserver", com.azure.core.util.Context.NONE); + checkVirtualNetworkSubnetUsage(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.checkVirtualNetworkSubnetUsages() + .executeWithResponse("WestUS", new VirtualNetworkSubnetUsageParameter().withVirtualNetworkResourceId( + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/testvnet"), + com.azure.core.util.Context.NONE); } } ``` -### GetPrivateDnsZoneSuffix_Execute +### Configurations_BatchUpdate ```java +import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationForBatchUpdate; +import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationListForBatchUpdate; +import java.util.Arrays; + /** - * Samples for GetPrivateDnsZoneSuffix Execute. + * Samples for Configurations BatchUpdate. */ -public final class GetPrivateDnsZoneSuffixExecuteSamples { +public final class ConfigurationsBatchUpdateSamples { /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/stable/2023-12-30/examples/ - * GetPrivateDnsZoneSuffix.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ + * ConfigurationsBatchUpdate.json */ /** - * Sample code: GetPrivateDnsZoneSuffix. + * Sample code: ConfigurationList. * * @param manager Entry point to MySqlManager. */ - public static void getPrivateDnsZoneSuffix(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.getPrivateDnsZoneSuffixes().executeWithResponse(com.azure.core.util.Context.NONE); + public static void configurationList(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.configurations() + .batchUpdate("testrg", "mysqltestserver", + new ConfigurationListForBatchUpdate().withValue( + Arrays.asList(new ConfigurationForBatchUpdate().withName("event_scheduler").withValue("OFF"), + new ConfigurationForBatchUpdate().withName("div_precision_increment").withValue("8"))), + com.azure.core.util.Context.NONE); } } ``` -### LocationBasedCapabilities_List +### Configurations_Get ```java /** - * Samples for LocationBasedCapabilities List. + * Samples for Configurations Get. */ -public final class LocationBasedCapabilitiesListSamples { +public final class ConfigurationsGetSamples { /* * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/stable/2023-12-30/examples/ - * CapabilitiesByLocationList.json + * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ConfigurationGet.json */ /** - * Sample code: CapabilitiesList. + * Sample code: Get a configuration. * * @param manager Entry point to MySqlManager. */ - public static void capabilitiesList(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.locationBasedCapabilities().list("WestUS", com.azure.core.util.Context.NONE); + public static void getAConfiguration(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.configurations() + .getWithResponse("TestGroup", "testserver", "event_scheduler", com.azure.core.util.Context.NONE); } } ``` -### LocationBasedCapabilitySet_Get +### Configurations_ListByServer ```java /** - * Samples for LocationBasedCapabilitySet Get. + * Samples for Configurations ListByServer. */ -public final class LocationBasedCapabilitySetGetSamples { +public final class ConfigurationsListByServerSamples { /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/stable/2023-12-30/examples/ - * CapabilitySetByLocation.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ + * ConfigurationsListByServer.json */ /** - * Sample code: CapabilityResult. + * Sample code: List all configurations for a server. * * @param manager Entry point to MySqlManager. */ - public static void capabilityResult(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.locationBasedCapabilitySets().getWithResponse("WestUS", "default", com.azure.core.util.Context.NONE); + public static void + listAllConfigurationsForAServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.configurations().listByServer("testrg", "mysqltestserver", com.azure.core.util.Context.NONE); } } ``` -### LocationBasedCapabilitySet_List +### Configurations_Update ```java +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ConfigurationInner; +import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationSource; + /** - * Samples for LocationBasedCapabilitySet List. + * Samples for Configurations Update. */ -public final class LocationBasedCapabilitySetListSamples { +public final class ConfigurationsUpdateSamples { /* * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/stable/2023-12-30/examples/ - * CapabilitySetListByLocation.json + * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ConfigurationUpdate. + * json */ /** - * Sample code: CapabilitySetsResult. + * Sample code: Update a user configuration. * * @param manager Entry point to MySqlManager. */ - public static void capabilitySetsResult(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.locationBasedCapabilitySets().list("WestUS", com.azure.core.util.Context.NONE); + public static void updateAUserConfiguration(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.configurations() + .update("testrg", "testserver", "event_scheduler", + new ConfigurationInner().withValue("on").withSource(ConfigurationSource.USER_OVERRIDE), + com.azure.core.util.Context.NONE); } } ``` -### LogFiles_ListByServer +### Databases_CreateOrUpdate ```java /** - * Samples for LogFiles ListByServer. + * Samples for Databases CreateOrUpdate. */ -public final class LogFilesListByServerSamples { +public final class DatabasesCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/LogFiles/preview/2023-06-01-preview/examples/ - * LogFilesListByServer.json + * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/DatabaseCreate.json */ /** - * Sample code: List all server log files for a server. + * Sample code: Create a database. * * @param manager Entry point to MySqlManager. */ - public static void - listAllServerLogFilesForAServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.logFiles().listByServer("testrg", "mysqltestsvc1", com.azure.core.util.Context.NONE); + public static void createADatabase(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.databases() + .define("db1") + .withExistingFlexibleServer("TestGroup", "testserver") + .withCharset("utf8") + .withCollation("utf8_general_ci") + .create(); } } ``` -### LongRunningBackup_Create +### Databases_Delete ```java /** - * Samples for LongRunningBackup Create. + * Samples for Databases Delete. */ -public final class LongRunningBackupCreateSamples { +public final class DatabasesDeleteSamples { /* * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/preview/2023-10-01-preview/examples/ - * LongRunningBackup.json + * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/DatabaseDelete.json */ /** - * Sample code: Create backup for a server. + * Sample code: Delete a database. * * @param manager Entry point to MySqlManager. */ - public static void createBackupForAServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.longRunningBackups() - .define("testback") - .withExistingFlexibleServer("TestGroup", "mysqltestserver") - .create(); + public static void deleteADatabase(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.databases().delete("TestGroup", "testserver", "db1", com.azure.core.util.Context.NONE); } } ``` -### LongRunningBackupsOperation_Get +### Databases_Get ```java /** - * Samples for LongRunningBackupsOperation Get. + * Samples for Databases Get. */ -public final class LongRunningBackupsOperationGetSamples { +public final class DatabasesGetSamples { /* * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/preview/2023-10-01-preview/examples/ - * LongRunningBackupGet.json + * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/DatabaseGet.json */ /** - * Sample code: Get a backup for a server. + * Sample code: Get a database. * * @param manager Entry point to MySqlManager. */ - public static void getABackupForAServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.longRunningBackupsOperations() - .getWithResponse("TestGroup", "mysqltestserver", "daily_20210615T160516", com.azure.core.util.Context.NONE); + public static void getADatabase(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.databases().getWithResponse("TestGroup", "testserver", "db1", com.azure.core.util.Context.NONE); } } ``` -### LongRunningBackupsOperation_List +### Databases_ListByServer ```java /** - * Samples for LongRunningBackupsOperation List. + * Samples for Databases ListByServer. */ -public final class LongRunningBackupsOperationListSamples { +public final class DatabasesListByServerSamples { /* * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/preview/2023-10-01-preview/examples/ - * LongRunningBackupsListByServer.json + * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/DatabasesListByServer + * .json */ /** - * Sample code: List backups for a server. + * Sample code: List databases in a server. * * @param manager Entry point to MySqlManager. */ - public static void listBackupsForAServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.longRunningBackupsOperations().list("TestGroup", "mysqltestserver", com.azure.core.util.Context.NONE); + public static void listDatabasesInAServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.databases().listByServer("TestGroup", "testserver", com.azure.core.util.Context.NONE); } } ``` -### Maintenances_List +### FirewallRules_CreateOrUpdate ```java /** - * Samples for Maintenances List. + * Samples for FirewallRules CreateOrUpdate. */ -public final class MaintenancesListSamples { +public final class FirewallRulesCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/Maintenance/preview/2023-10-01-preview/examples/ - * MaintenancesListByServer.json + * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/FirewallRuleCreate. + * json */ /** - * Sample code: List maintenances on a server. + * Sample code: Create a firewall rule. * * @param manager Entry point to MySqlManager. */ - public static void listMaintenancesOnAServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.maintenances().list("TestGroup", "testserver", com.azure.core.util.Context.NONE); + public static void createAFirewallRule(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.firewallRules() + .define("rule1") + .withExistingFlexibleServer("TestGroup", "testserver") + .withStartIpAddress("0.0.0.0") + .withEndIpAddress("255.255.255.255") + .create(); } } ``` -### Maintenances_Read +### FirewallRules_Delete ```java /** - * Samples for Maintenances Read. + * Samples for FirewallRules Delete. */ -public final class MaintenancesReadSamples { +public final class FirewallRulesDeleteSamples { /* * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/Maintenance/preview/2023-10-01-preview/examples/ - * MaintenanceRead.json + * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/FirewallRuleDelete. + * json */ /** - * Sample code: Read a maintenance. + * Sample code: Delete a firewall rule. * * @param manager Entry point to MySqlManager. */ - public static void readAMaintenance(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.maintenances() - .readWithResponse("TestGroup", "testserver", "_T9Q-TS8", com.azure.core.util.Context.NONE); + public static void deleteAFirewallRule(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.firewallRules().delete("TestGroup", "testserver", "rule1", com.azure.core.util.Context.NONE); } } ``` -### Maintenances_Update +### FirewallRules_Get ```java -import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceUpdate; -import java.time.OffsetDateTime; - /** - * Samples for Maintenances Update. + * Samples for FirewallRules Get. */ -public final class MaintenancesUpdateSamples { +public final class FirewallRulesGetSamples { /* * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/Maintenance/preview/2023-10-01-preview/examples/ - * MaintenanceUpdate.json + * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/FirewallRuleGet.json */ /** - * Sample code: Update maintenance on a server. + * Sample code: Get a firewall rule. * * @param manager Entry point to MySqlManager. */ - public static void updateMaintenanceOnAServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.maintenances() - .update("TestGroup", "testserver", "_T9Q-TS8", - new MaintenanceUpdate().withMaintenanceStartTime(OffsetDateTime.parse("2024-01-20T00:00:00")), - com.azure.core.util.Context.NONE); + public static void getAFirewallRule(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.firewallRules().getWithResponse("TestGroup", "testserver", "rule1", com.azure.core.util.Context.NONE); } } ``` -### OperationProgress_Get +### FirewallRules_ListByServer ```java /** - * Samples for OperationProgress Get. + * Samples for FirewallRules ListByServer. */ -public final class OperationProgressGetSamples { +public final class FirewallRulesListByServerSamples { /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/stable/2023-12-30/examples/ - * OperationProgress_Get_BackupAndExport.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ + * FirewallRulesListByServer.json */ /** - * Sample code: OperationProgress_Get BackupAndExport. + * Sample code: List all firewall rules in a server. * * @param manager Entry point to MySqlManager. */ public static void - operationProgressGetBackupAndExport(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.operationProgress() - .getWithResponse("westus", "00000000-0000-0000-0000-000000000000", com.azure.core.util.Context.NONE); + listAllFirewallRulesInAServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.firewallRules().listByServer("TestGroup", "testserver", com.azure.core.util.Context.NONE); } +} +``` +### GetPrivateDnsZoneSuffix_Execute + +```java +/** + * Samples for GetPrivateDnsZoneSuffix Execute. + */ +public final class GetPrivateDnsZoneSuffixExecuteSamples { /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/stable/2023-12-30/examples/ - * OperationProgress_Get_ImportFromStorage.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ + * GetPrivateDnsZoneSuffix.json */ /** - * Sample code: OperationProgress_Get ImportFromStorage. + * Sample code: GetPrivateDnsZoneSuffix. * * @param manager Entry point to MySqlManager. */ - public static void - operationProgressGetImportFromStorage(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.operationProgress() - .getWithResponse("westus", "00000000-0000-0000-0000-000000000000", com.azure.core.util.Context.NONE); + public static void getPrivateDnsZoneSuffix(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.getPrivateDnsZoneSuffixes().executeWithResponse(com.azure.core.util.Context.NONE); } } ``` -### OperationResults_Get +### LocationBasedCapabilities_List ```java /** - * Samples for OperationResults Get. + * Samples for LocationBasedCapabilities List. */ -public final class OperationResultsGetSamples { +public final class LocationBasedCapabilitiesListSamples { /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/stable/2023-12-30/examples/ - * OperationResults_Get.json + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ + * CapabilitiesByLocationList.json */ /** - * Sample code: OperationResults_Get. + * Sample code: CapabilitiesList. * * @param manager Entry point to MySqlManager. */ - public static void operationResultsGet(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.operationResults() - .getWithResponse("westus", "00000000-0000-0000-0000-000000000000", com.azure.core.util.Context.NONE); + public static void capabilitiesList(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { + manager.locationBasedCapabilities().list("WestUS", com.azure.core.util.Context.NONE); } } ``` @@ -1276,8 +546,7 @@ public final class OperationResultsGetSamples { public final class OperationsListSamples { /* * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/stable/2023-12-30/examples/ - * OperationsList.json + * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/OperationsList.json */ /** * Sample code: OperationList. @@ -1299,8 +568,8 @@ public final class OperationsListSamples { public final class ReplicasListByServerSamples { /* * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ - * ReplicasListByServer.json + * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ReplicasListByServer. + * json */ /** * Sample code: List replicas for a server. @@ -1325,11 +594,11 @@ import com.azure.resourcemanager.mysqlflexibleserver.models.DataEncryptionType; import com.azure.resourcemanager.mysqlflexibleserver.models.EnableStatusEnum; import com.azure.resourcemanager.mysqlflexibleserver.models.HighAvailability; import com.azure.resourcemanager.mysqlflexibleserver.models.HighAvailabilityMode; +import com.azure.resourcemanager.mysqlflexibleserver.models.Identity; import com.azure.resourcemanager.mysqlflexibleserver.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.mysqlflexibleserver.models.MySqlServerIdentity; -import com.azure.resourcemanager.mysqlflexibleserver.models.MySqlServerSku; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerSkuTier; import com.azure.resourcemanager.mysqlflexibleserver.models.ServerVersion; +import com.azure.resourcemanager.mysqlflexibleserver.models.Sku; +import com.azure.resourcemanager.mysqlflexibleserver.models.SkuTier; import com.azure.resourcemanager.mysqlflexibleserver.models.Storage; import java.io.IOException; import java.time.OffsetDateTime; @@ -1342,8 +611,8 @@ import java.util.Map; public final class ServersCreateSamples { /* * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ - * ServerCreateReplica.json + * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ServerCreateReplica. + * json */ /** * Sample code: Create a replica server. @@ -1363,8 +632,7 @@ public final class ServersCreateSamples { /* * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ServerCreate - * .json + * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ServerCreate.json */ /** * Sample code: Create a new server. @@ -1377,16 +645,14 @@ public final class ServersCreateSamples { .withRegion("southeastasia") .withExistingResourceGroup("testrg") .withTags(mapOf("num", "1")) - .withSku(new MySqlServerSku().withName("Standard_D2ds_v4").withTier(ServerSkuTier.GENERAL_PURPOSE)) + .withSku(new Sku().withName("Standard_D2ds_v4").withTier(SkuTier.GENERAL_PURPOSE)) .withAdministratorLogin("cloudsa") .withAdministratorLoginPassword("your_password") .withVersion(ServerVersion.FIVE_SEVEN) .withAvailabilityZone("1") .withCreateMode(CreateMode.DEFAULT) .withStorage(new Storage().withStorageSizeGB(100).withIops(600).withAutoGrow(EnableStatusEnum.DISABLED)) - .withBackup(new Backup().withBackupRetentionDays(7) - .withBackupIntervalHours(24) - .withGeoRedundantBackup(EnableStatusEnum.DISABLED)) + .withBackup(new Backup().withBackupRetentionDays(7).withGeoRedundantBackup(EnableStatusEnum.DISABLED)) .withHighAvailability( new HighAvailability().withMode(HighAvailabilityMode.ZONE_REDUNDANT).withStandbyAvailabilityZone("3")) .create(); @@ -1394,8 +660,8 @@ public final class ServersCreateSamples { /* * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ - * ServerCreateWithBYOK.json + * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ServerCreateWithBYOK. + * json */ /** * Sample code: Create a server with byok. @@ -1409,12 +675,12 @@ public final class ServersCreateSamples { .withRegion("southeastasia") .withExistingResourceGroup("testrg") .withTags(mapOf("num", "1")) - .withIdentity(new MySqlServerIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withIdentity(new Identity().withType(ManagedServiceIdentityType.USER_ASSIGNED) .withUserAssignedIdentities(mapOf( "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-identity", SerializerFactory.createDefaultManagementSerializerAdapter() .deserialize("{}", Object.class, SerializerEncoding.JSON)))) - .withSku(new MySqlServerSku().withName("Standard_D2ds_v4").withTier(ServerSkuTier.GENERAL_PURPOSE)) + .withSku(new Sku().withName("Standard_D2ds_v4").withTier(SkuTier.GENERAL_PURPOSE)) .withAdministratorLogin("cloudsa") .withAdministratorLoginPassword("your_password") .withVersion(ServerVersion.FIVE_SEVEN) @@ -1428,17 +694,14 @@ public final class ServersCreateSamples { .withGeoBackupKeyUri("fakeTokenPlaceholder") .withType(DataEncryptionType.AZURE_KEY_VAULT)) .withStorage(new Storage().withStorageSizeGB(100).withIops(600).withAutoGrow(EnableStatusEnum.DISABLED)) - .withBackup(new Backup().withBackupRetentionDays(7) - .withBackupIntervalHours(24) - .withGeoRedundantBackup(EnableStatusEnum.DISABLED)) + .withBackup(new Backup().withBackupRetentionDays(7).withGeoRedundantBackup(EnableStatusEnum.DISABLED)) .withHighAvailability( new HighAvailability().withMode(HighAvailabilityMode.ZONE_REDUNDANT).withStandbyAvailabilityZone("3")) .create(); } /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ * ServerCreateWithPointInTimeRestore.json */ /** @@ -1453,7 +716,7 @@ public final class ServersCreateSamples { .withRegion("SoutheastAsia") .withExistingResourceGroup("TargetResourceGroup") .withTags(mapOf("num", "1")) - .withSku(new MySqlServerSku().withName("Standard_D14_v2").withTier(ServerSkuTier.GENERAL_PURPOSE)) + .withSku(new Sku().withName("Standard_D14_v2").withTier(SkuTier.GENERAL_PURPOSE)) .withCreateMode(CreateMode.POINT_IN_TIME_RESTORE) .withSourceServerResourceId( "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/SourceResourceGroup/providers/Microsoft.DBforMySQL/flexibleServers/sourceserver") @@ -1484,8 +747,7 @@ public final class ServersCreateSamples { public final class ServersDeleteSamples { /* * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ServerDelete - * .json + * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ServerDelete.json */ /** * Sample code: Delete a server. @@ -1507,8 +769,7 @@ public final class ServersDeleteSamples { public final class ServersFailoverSamples { /* * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ - * ServerFailover.json + * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ServerFailover.json */ /** * Sample code: Restart a server. @@ -1530,8 +791,8 @@ public final class ServersFailoverSamples { public final class ServersGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ - * ServerGetWithVnet.json + * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ServerGetWithVnet. + * json */ /** * Sample code: Get a server with vnet. @@ -1544,8 +805,7 @@ public final class ServersGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ServerGet. - * json + * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ServerGet.json */ /** * Sample code: Get a server. @@ -1567,8 +827,7 @@ public final class ServersGetByResourceGroupSamples { public final class ServersListSamples { /* * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ServersList. - * json + * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ServersList.json */ /** * Sample code: List servers in a subscription. @@ -1589,8 +848,7 @@ public final class ServersListSamples { */ public final class ServersListByResourceGroupSamples { /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ * ServersListByResourceGroup.json */ /** @@ -1604,34 +862,6 @@ public final class ServersListByResourceGroupSamples { } ``` -### Servers_ResetGtid - -```java -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerGtidSetParameter; - -/** - * Samples for Servers ResetGtid. - */ -public final class ServersResetGtidSamples { - /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ - * ServerResetGtid.json - */ - /** - * Sample code: Reset GTID on a server. - * - * @param manager Entry point to MySqlManager. - */ - public static void resetGTIDOnAServer(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.servers() - .resetGtid("TestGroup", "testserver", - new ServerGtidSetParameter().withGtidSet("4aff5b51-97ba-11ed-a955-002248036acc:1-16"), - com.azure.core.util.Context.NONE); - } -} -``` - ### Servers_Restart ```java @@ -1644,8 +874,7 @@ import com.azure.resourcemanager.mysqlflexibleserver.models.ServerRestartParamet public final class ServersRestartSamples { /* * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ - * ServerRestart.json + * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ServerRestart.json */ /** * Sample code: Restart a server. @@ -1671,8 +900,7 @@ public final class ServersRestartSamples { public final class ServersStartSamples { /* * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ServerStart. - * json + * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ServerStart.json */ /** * Sample code: Start a server. @@ -1694,8 +922,7 @@ public final class ServersStartSamples { public final class ServersStopSamples { /* * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ServerStop. - * json + * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ServerStop.json */ /** * Sample code: Stop a server. @@ -1716,10 +943,9 @@ import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.mysqlflexibleserver.models.DataEncryption; import com.azure.resourcemanager.mysqlflexibleserver.models.DataEncryptionType; import com.azure.resourcemanager.mysqlflexibleserver.models.EnableStatusEnum; +import com.azure.resourcemanager.mysqlflexibleserver.models.Identity; import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceWindow; import com.azure.resourcemanager.mysqlflexibleserver.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.mysqlflexibleserver.models.MySqlServerIdentity; -import com.azure.resourcemanager.mysqlflexibleserver.models.Network; import com.azure.resourcemanager.mysqlflexibleserver.models.Server; import com.azure.resourcemanager.mysqlflexibleserver.models.Storage; import java.io.IOException; @@ -1731,8 +957,7 @@ import java.util.Map; */ public final class ServersUpdateSamples { /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ + * x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ * ServerUpdateWithCustomerMaintenanceWindow.json */ /** @@ -1755,8 +980,8 @@ public final class ServersUpdateSamples { /* * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ - * ServerUpdateWithBYOK.json + * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ServerUpdateWithBYOK. + * json */ /** * Sample code: Update server with byok. @@ -1769,7 +994,7 @@ public final class ServersUpdateSamples { .getByResourceGroupWithResponse("testrg", "mysqltestserver", com.azure.core.util.Context.NONE) .getValue(); resource.update() - .withIdentity(new MySqlServerIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withIdentity(new Identity().withType(ManagedServiceIdentityType.USER_ASSIGNED) .withUserAssignedIdentities(mapOf( "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-identity", SerializerFactory.createDefaultManagementSerializerAdapter() @@ -1786,8 +1011,7 @@ public final class ServersUpdateSamples { /* * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ServerUpdate - * .json + * specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2021-05-01/examples/ServerUpdate.json */ /** * Sample code: Update a server. @@ -1799,11 +1023,7 @@ public final class ServersUpdateSamples { .getByResourceGroupWithResponse("testrg", "mysqltestserver", com.azure.core.util.Context.NONE) .getValue(); resource.update() - .withStorage(new Storage().withStorageSizeGB(30) - .withIops(200) - .withAutoGrow(EnableStatusEnum.DISABLED) - .withAutoIoScaling(EnableStatusEnum.DISABLED)) - .withNetwork(new Network().withPublicNetworkAccess(EnableStatusEnum.DISABLED)) + .withStorage(new Storage().withStorageSizeGB(30).withIops(200).withAutoGrow(EnableStatusEnum.DISABLED)) .apply(); } @@ -1821,56 +1041,3 @@ public final class ServersUpdateSamples { } ``` -### Servers_ValidateEstimateHighAvailability - -```java -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.HighAvailabilityValidationEstimationInner; - -/** - * Samples for Servers ValidateEstimateHighAvailability. - */ -public final class ServersValidateEstimateHighAvailabilitySamples { - /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ - * ServerValidateEstimateHighAvailability.json - */ - /** - * Sample code: Validate a validation and estimation of high availability. - * - * @param manager Entry point to MySqlManager. - */ - public static void validateAValidationAndEstimationOfHighAvailability( - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.servers() - .validateEstimateHighAvailabilityWithResponse("TestGroup", "testserver", - new HighAvailabilityValidationEstimationInner().withExpectedStandbyAvailabilityZone("1"), - com.azure.core.util.Context.NONE); - } -} -``` - -### ServersMigration_CutoverMigration - -```java -/** - * Samples for ServersMigration CutoverMigration. - */ -public final class ServersMigrationCutoverMigrationSamples { - /* - * x-ms-original-file: - * specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-12-30/examples/ - * CutoverMigration.json - */ - /** - * Sample code: Cutover migration for MySQL import. - * - * @param manager Entry point to MySqlManager. - */ - public static void - cutoverMigrationForMySQLImport(com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager) { - manager.serversMigrations().cutoverMigration("testrg", "mysqltestserver", com.azure.core.util.Context.NONE); - } -} -``` - diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/pom.xml b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/pom.xml index bfcf35116b459..0ec5075e637af 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/pom.xml +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/pom.xml @@ -14,11 +14,11 @@ com.azure.resourcemanager azure-resourcemanager-mysqlflexibleserver - 1.0.0-beta.7 + 1.1.0-beta.1 jar Microsoft Azure SDK for MySql Management - This package contains Microsoft Azure SDK for MySql Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The Microsoft Azure management API provides create, read, update, and delete functionality for Azure MySQL resources including servers, databases, firewall rules, VNET rules, log files and configurations with new business model. Package tag package-flexibleserver-2023-12-30. + This package contains Microsoft Azure SDK for MySql Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The Microsoft Azure management API provides create, read, update, and delete functionality for Azure MySQL resources including servers, databases, firewall rules, VNET rules, log files and configurations with new business model. Package tag package-flexibleserver-2021-05-01. https://github.com/Azure/azure-sdk-for-java @@ -45,7 +45,6 @@ UTF-8 0 0 - true false diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/MySqlManager.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/MySqlManager.java index 2c2ac44f7381e..40b537b0aa42e 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/MySqlManager.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/MySqlManager.java @@ -24,9 +24,6 @@ import com.azure.core.util.Configuration; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.mysqlflexibleserver.fluent.MySqlManagementClient; -import com.azure.resourcemanager.mysqlflexibleserver.implementation.AdvancedThreatProtectionSettingsImpl; -import com.azure.resourcemanager.mysqlflexibleserver.implementation.AzureADAdministratorsImpl; -import com.azure.resourcemanager.mysqlflexibleserver.implementation.BackupAndExportsImpl; import com.azure.resourcemanager.mysqlflexibleserver.implementation.BackupsImpl; import com.azure.resourcemanager.mysqlflexibleserver.implementation.CheckNameAvailabilitiesImpl; import com.azure.resourcemanager.mysqlflexibleserver.implementation.CheckNameAvailabilityWithoutLocationsImpl; @@ -36,21 +33,10 @@ import com.azure.resourcemanager.mysqlflexibleserver.implementation.FirewallRulesImpl; import com.azure.resourcemanager.mysqlflexibleserver.implementation.GetPrivateDnsZoneSuffixesImpl; import com.azure.resourcemanager.mysqlflexibleserver.implementation.LocationBasedCapabilitiesImpl; -import com.azure.resourcemanager.mysqlflexibleserver.implementation.LocationBasedCapabilitySetsImpl; -import com.azure.resourcemanager.mysqlflexibleserver.implementation.LogFilesImpl; -import com.azure.resourcemanager.mysqlflexibleserver.implementation.LongRunningBackupsImpl; -import com.azure.resourcemanager.mysqlflexibleserver.implementation.LongRunningBackupsOperationsImpl; -import com.azure.resourcemanager.mysqlflexibleserver.implementation.MaintenancesImpl; import com.azure.resourcemanager.mysqlflexibleserver.implementation.MySqlManagementClientBuilder; -import com.azure.resourcemanager.mysqlflexibleserver.implementation.OperationProgressImpl; -import com.azure.resourcemanager.mysqlflexibleserver.implementation.OperationResultsImpl; import com.azure.resourcemanager.mysqlflexibleserver.implementation.OperationsImpl; import com.azure.resourcemanager.mysqlflexibleserver.implementation.ReplicasImpl; import com.azure.resourcemanager.mysqlflexibleserver.implementation.ServersImpl; -import com.azure.resourcemanager.mysqlflexibleserver.implementation.ServersMigrationsImpl; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionSettings; -import com.azure.resourcemanager.mysqlflexibleserver.models.AzureADAdministrators; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupAndExports; import com.azure.resourcemanager.mysqlflexibleserver.models.Backups; import com.azure.resourcemanager.mysqlflexibleserver.models.CheckNameAvailabilities; import com.azure.resourcemanager.mysqlflexibleserver.models.CheckNameAvailabilityWithoutLocations; @@ -60,17 +46,9 @@ import com.azure.resourcemanager.mysqlflexibleserver.models.FirewallRules; import com.azure.resourcemanager.mysqlflexibleserver.models.GetPrivateDnsZoneSuffixes; import com.azure.resourcemanager.mysqlflexibleserver.models.LocationBasedCapabilities; -import com.azure.resourcemanager.mysqlflexibleserver.models.LocationBasedCapabilitySets; -import com.azure.resourcemanager.mysqlflexibleserver.models.LogFiles; -import com.azure.resourcemanager.mysqlflexibleserver.models.LongRunningBackups; -import com.azure.resourcemanager.mysqlflexibleserver.models.LongRunningBackupsOperations; -import com.azure.resourcemanager.mysqlflexibleserver.models.Maintenances; -import com.azure.resourcemanager.mysqlflexibleserver.models.OperationProgress; -import com.azure.resourcemanager.mysqlflexibleserver.models.OperationResults; import com.azure.resourcemanager.mysqlflexibleserver.models.Operations; import com.azure.resourcemanager.mysqlflexibleserver.models.Replicas; import com.azure.resourcemanager.mysqlflexibleserver.models.Servers; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServersMigrations; import java.time.Duration; import java.time.temporal.ChronoUnit; import java.util.ArrayList; @@ -84,35 +62,19 @@ * including servers, databases, firewall rules, VNET rules, log files and configurations with new business model. */ public final class MySqlManager { - private AzureADAdministrators azureADAdministrators; - - private Backups backups; - - private BackupAndExports backupAndExports; - - private LongRunningBackups longRunningBackups; - - private LongRunningBackupsOperations longRunningBackupsOperations; - - private Configurations configurations; - - private Databases databases; - - private FirewallRules firewallRules; - private Servers servers; private Replicas replicas; - private ServersMigrations serversMigrations; + private Backups backups; - private AdvancedThreatProtectionSettings advancedThreatProtectionSettings; + private FirewallRules firewallRules; - private LogFiles logFiles; + private Databases databases; - private LocationBasedCapabilities locationBasedCapabilities; + private Configurations configurations; - private LocationBasedCapabilitySets locationBasedCapabilitySets; + private LocationBasedCapabilities locationBasedCapabilities; private CheckVirtualNetworkSubnetUsages checkVirtualNetworkSubnetUsages; @@ -120,16 +82,10 @@ public final class MySqlManager { private CheckNameAvailabilityWithoutLocations checkNameAvailabilityWithoutLocations; - private OperationResults operationResults; - - private OperationProgress operationProgress; - private GetPrivateDnsZoneSuffixes getPrivateDnsZoneSuffixes; private Operations operations; - private Maintenances maintenances; - private final MySqlManagementClient clientObject; private MySqlManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { @@ -294,7 +250,7 @@ public MySqlManager authenticate(TokenCredential credential, AzureProfile profil .append("-") .append("com.azure.resourcemanager.mysqlflexibleserver") .append("/") - .append("1.0.0-beta.6"); + .append("1.0.0"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder.append(" (") .append(Configuration.getGlobalConfiguration().get("java.version")) @@ -340,103 +296,6 @@ public MySqlManager authenticate(TokenCredential credential, AzureProfile profil } } - /** - * Gets the resource collection API of AzureADAdministrators. It manages AzureADAdministrator. - * - * @return Resource collection API of AzureADAdministrators. - */ - public AzureADAdministrators azureADAdministrators() { - if (this.azureADAdministrators == null) { - this.azureADAdministrators = new AzureADAdministratorsImpl(clientObject.getAzureADAdministrators(), this); - } - return azureADAdministrators; - } - - /** - * Gets the resource collection API of Backups. - * - * @return Resource collection API of Backups. - */ - public Backups backups() { - if (this.backups == null) { - this.backups = new BackupsImpl(clientObject.getBackups(), this); - } - return backups; - } - - /** - * Gets the resource collection API of BackupAndExports. - * - * @return Resource collection API of BackupAndExports. - */ - public BackupAndExports backupAndExports() { - if (this.backupAndExports == null) { - this.backupAndExports = new BackupAndExportsImpl(clientObject.getBackupAndExports(), this); - } - return backupAndExports; - } - - /** - * Gets the resource collection API of LongRunningBackups. It manages ServerBackupV2. - * - * @return Resource collection API of LongRunningBackups. - */ - public LongRunningBackups longRunningBackups() { - if (this.longRunningBackups == null) { - this.longRunningBackups = new LongRunningBackupsImpl(clientObject.getLongRunningBackups(), this); - } - return longRunningBackups; - } - - /** - * Gets the resource collection API of LongRunningBackupsOperations. - * - * @return Resource collection API of LongRunningBackupsOperations. - */ - public LongRunningBackupsOperations longRunningBackupsOperations() { - if (this.longRunningBackupsOperations == null) { - this.longRunningBackupsOperations - = new LongRunningBackupsOperationsImpl(clientObject.getLongRunningBackupsOperations(), this); - } - return longRunningBackupsOperations; - } - - /** - * Gets the resource collection API of Configurations. It manages Configuration. - * - * @return Resource collection API of Configurations. - */ - public Configurations configurations() { - if (this.configurations == null) { - this.configurations = new ConfigurationsImpl(clientObject.getConfigurations(), this); - } - return configurations; - } - - /** - * Gets the resource collection API of Databases. It manages Database. - * - * @return Resource collection API of Databases. - */ - public Databases databases() { - if (this.databases == null) { - this.databases = new DatabasesImpl(clientObject.getDatabases(), this); - } - return databases; - } - - /** - * Gets the resource collection API of FirewallRules. It manages FirewallRule. - * - * @return Resource collection API of FirewallRules. - */ - public FirewallRules firewallRules() { - if (this.firewallRules == null) { - this.firewallRules = new FirewallRulesImpl(clientObject.getFirewallRules(), this); - } - return firewallRules; - } - /** * Gets the resource collection API of Servers. It manages Server. * @@ -462,40 +321,51 @@ public Replicas replicas() { } /** - * Gets the resource collection API of ServersMigrations. + * Gets the resource collection API of Backups. + * + * @return Resource collection API of Backups. + */ + public Backups backups() { + if (this.backups == null) { + this.backups = new BackupsImpl(clientObject.getBackups(), this); + } + return backups; + } + + /** + * Gets the resource collection API of FirewallRules. It manages FirewallRule. * - * @return Resource collection API of ServersMigrations. + * @return Resource collection API of FirewallRules. */ - public ServersMigrations serversMigrations() { - if (this.serversMigrations == null) { - this.serversMigrations = new ServersMigrationsImpl(clientObject.getServersMigrations(), this); + public FirewallRules firewallRules() { + if (this.firewallRules == null) { + this.firewallRules = new FirewallRulesImpl(clientObject.getFirewallRules(), this); } - return serversMigrations; + return firewallRules; } /** - * Gets the resource collection API of AdvancedThreatProtectionSettings. + * Gets the resource collection API of Databases. It manages Database. * - * @return Resource collection API of AdvancedThreatProtectionSettings. + * @return Resource collection API of Databases. */ - public AdvancedThreatProtectionSettings advancedThreatProtectionSettings() { - if (this.advancedThreatProtectionSettings == null) { - this.advancedThreatProtectionSettings - = new AdvancedThreatProtectionSettingsImpl(clientObject.getAdvancedThreatProtectionSettings(), this); + public Databases databases() { + if (this.databases == null) { + this.databases = new DatabasesImpl(clientObject.getDatabases(), this); } - return advancedThreatProtectionSettings; + return databases; } /** - * Gets the resource collection API of LogFiles. + * Gets the resource collection API of Configurations. * - * @return Resource collection API of LogFiles. + * @return Resource collection API of Configurations. */ - public LogFiles logFiles() { - if (this.logFiles == null) { - this.logFiles = new LogFilesImpl(clientObject.getLogFiles(), this); + public Configurations configurations() { + if (this.configurations == null) { + this.configurations = new ConfigurationsImpl(clientObject.getConfigurations(), this); } - return logFiles; + return configurations; } /** @@ -511,19 +381,6 @@ public LocationBasedCapabilities locationBasedCapabilities() { return locationBasedCapabilities; } - /** - * Gets the resource collection API of LocationBasedCapabilitySets. - * - * @return Resource collection API of LocationBasedCapabilitySets. - */ - public LocationBasedCapabilitySets locationBasedCapabilitySets() { - if (this.locationBasedCapabilitySets == null) { - this.locationBasedCapabilitySets - = new LocationBasedCapabilitySetsImpl(clientObject.getLocationBasedCapabilitySets(), this); - } - return locationBasedCapabilitySets; - } - /** * Gets the resource collection API of CheckVirtualNetworkSubnetUsages. * @@ -563,30 +420,6 @@ public CheckNameAvailabilityWithoutLocations checkNameAvailabilityWithoutLocatio return checkNameAvailabilityWithoutLocations; } - /** - * Gets the resource collection API of OperationResults. - * - * @return Resource collection API of OperationResults. - */ - public OperationResults operationResults() { - if (this.operationResults == null) { - this.operationResults = new OperationResultsImpl(clientObject.getOperationResults(), this); - } - return operationResults; - } - - /** - * Gets the resource collection API of OperationProgress. - * - * @return Resource collection API of OperationProgress. - */ - public OperationProgress operationProgress() { - if (this.operationProgress == null) { - this.operationProgress = new OperationProgressImpl(clientObject.getOperationProgress(), this); - } - return operationProgress; - } - /** * Gets the resource collection API of GetPrivateDnsZoneSuffixes. * @@ -612,18 +445,6 @@ public Operations operations() { return operations; } - /** - * Gets the resource collection API of Maintenances. - * - * @return Resource collection API of Maintenances. - */ - public Maintenances maintenances() { - if (this.maintenances == null) { - this.maintenances = new MaintenancesImpl(clientObject.getMaintenances(), this); - } - return maintenances; - } - /** * Gets wrapped service client MySqlManagementClient providing direct access to the underlying auto-generated API * implementation, based on Azure REST API. diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/AdvancedThreatProtectionSettingsClient.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/AdvancedThreatProtectionSettingsClient.java deleted file mode 100644 index 0dbca6c9e9d32..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/AdvancedThreatProtectionSettingsClient.java +++ /dev/null @@ -1,217 +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.mysqlflexibleserver.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.mysqlflexibleserver.fluent.models.AdvancedThreatProtectionInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionForUpdate; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionName; - -/** - * An instance of this class provides access to all the operations defined in AdvancedThreatProtectionSettingsClient. - */ -public interface AdvancedThreatProtectionSettingsClient { - /** - * Get a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a server's Advanced Threat Protection state along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String serverName, - AdvancedThreatProtectionName advancedThreatProtectionName, Context context); - - /** - * Get a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a server's Advanced Threat Protection state. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AdvancedThreatProtectionInner get(String resourceGroupName, String serverName, - AdvancedThreatProtectionName advancedThreatProtectionName); - - /** - * Updates a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param parameters The server's Advanced Threat Protection body to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of a server's Advanced Threat Protection. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, AdvancedThreatProtectionInner> beginUpdate( - String resourceGroupName, String serverName, AdvancedThreatProtectionName advancedThreatProtectionName, - AdvancedThreatProtectionForUpdate parameters); - - /** - * Updates a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param parameters The server's Advanced Threat Protection body to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of a server's Advanced Threat Protection. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, AdvancedThreatProtectionInner> beginUpdate( - String resourceGroupName, String serverName, AdvancedThreatProtectionName advancedThreatProtectionName, - AdvancedThreatProtectionForUpdate parameters, Context context); - - /** - * Updates a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param parameters The server's Advanced Threat Protection body to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a server's Advanced Threat Protection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AdvancedThreatProtectionInner update(String resourceGroupName, String serverName, - AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionForUpdate parameters); - - /** - * Updates a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param parameters The server's Advanced Threat Protection body to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a server's Advanced Threat Protection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AdvancedThreatProtectionInner update(String resourceGroupName, String serverName, - AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionForUpdate parameters, - Context context); - - /** - * Updates a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param parameters The server's Advanced Threat Protection body to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of a server's Advanced Threat Protection. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, AdvancedThreatProtectionInner> beginUpdatePut( - String resourceGroupName, String serverName, AdvancedThreatProtectionName advancedThreatProtectionName, - AdvancedThreatProtectionInner parameters); - - /** - * Updates a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param parameters The server's Advanced Threat Protection body to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of a server's Advanced Threat Protection. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, AdvancedThreatProtectionInner> beginUpdatePut( - String resourceGroupName, String serverName, AdvancedThreatProtectionName advancedThreatProtectionName, - AdvancedThreatProtectionInner parameters, Context context); - - /** - * Updates a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param parameters The server's Advanced Threat Protection body to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a server's Advanced Threat Protection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AdvancedThreatProtectionInner updatePut(String resourceGroupName, String serverName, - AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionInner parameters); - - /** - * Updates a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param parameters The server's Advanced Threat Protection body to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a server's Advanced Threat Protection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AdvancedThreatProtectionInner updatePut(String resourceGroupName, String serverName, - AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionInner parameters, - Context context); - - /** - * Gets a list of server's Advanced Threat Protection states. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 server's Advanced Threat Protection states as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String serverName); - - /** - * Gets a list of server's Advanced Threat Protection states. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 server's Advanced Threat Protection states as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String serverName, Context context); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/AzureADAdministratorsClient.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/AzureADAdministratorsClient.java deleted file mode 100644 index bd7e462531892..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/AzureADAdministratorsClient.java +++ /dev/null @@ -1,203 +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.mysqlflexibleserver.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.mysqlflexibleserver.fluent.models.AzureADAdministratorInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorName; - -/** - * An instance of this class provides access to all the operations defined in AzureADAdministratorsClient. - */ -public interface AzureADAdministratorsClient { - /** - * Creates or updates an existing Azure Active Directory administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @param parameters The required parameters for creating or updating an aad administrator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of represents a Administrator. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, AzureADAdministratorInner> beginCreateOrUpdate( - String resourceGroupName, String serverName, AdministratorName administratorName, - AzureADAdministratorInner parameters); - - /** - * Creates or updates an existing Azure Active Directory administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @param parameters The required parameters for creating or updating an aad administrator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of represents a Administrator. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, AzureADAdministratorInner> beginCreateOrUpdate( - String resourceGroupName, String serverName, AdministratorName administratorName, - AzureADAdministratorInner parameters, Context context); - - /** - * Creates or updates an existing Azure Active Directory administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @param parameters The required parameters for creating or updating an aad administrator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a Administrator. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AzureADAdministratorInner createOrUpdate(String resourceGroupName, String serverName, - AdministratorName administratorName, AzureADAdministratorInner parameters); - - /** - * Creates or updates an existing Azure Active Directory administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @param parameters The required parameters for creating or updating an aad administrator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a Administrator. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AzureADAdministratorInner createOrUpdate(String resourceGroupName, String serverName, - AdministratorName administratorName, AzureADAdministratorInner parameters, Context context); - - /** - * Deletes an Azure AD Administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked 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 serverName, - AdministratorName administratorName); - - /** - * Deletes an Azure AD Administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked 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 serverName, - AdministratorName administratorName, Context context); - - /** - * Deletes an Azure AD Administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 serverName, AdministratorName administratorName); - - /** - * Deletes an Azure AD Administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 serverName, AdministratorName administratorName, Context context); - - /** - * Gets information about an azure ad administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about an azure ad administrator along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String serverName, - AdministratorName administratorName, Context context); - - /** - * Gets information about an azure ad administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about an azure ad administrator. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AzureADAdministratorInner get(String resourceGroupName, String serverName, AdministratorName administratorName); - - /** - * List all the AAD administrators in a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 azure ad administrators as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByServer(String resourceGroupName, String serverName); - - /** - * List all the AAD administrators in a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 azure ad administrators as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByServer(String resourceGroupName, String serverName, Context context); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/BackupAndExportsClient.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/BackupAndExportsClient.java deleted file mode 100644 index 8c76ad0a8b9df..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/BackupAndExportsClient.java +++ /dev/null @@ -1,109 +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.mysqlflexibleserver.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.mysqlflexibleserver.fluent.models.BackupAndExportResponseInner; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ValidateBackupResponseInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupAndExportRequest; - -/** - * An instance of this class provides access to all the operations defined in BackupAndExportsClient. - */ -public interface BackupAndExportsClient { - /** - * Exports the backup of the given server by creating a backup if not existing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for creating and exporting backup of the given server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of represents BackupAndExport API Response. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, BackupAndExportResponseInner> - beginCreate(String resourceGroupName, String serverName, BackupAndExportRequest parameters); - - /** - * Exports the backup of the given server by creating a backup if not existing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for creating and exporting backup of the given server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of represents BackupAndExport API Response. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, BackupAndExportResponseInner> - beginCreate(String resourceGroupName, String serverName, BackupAndExportRequest parameters, Context context); - - /** - * Exports the backup of the given server by creating a backup if not existing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for creating and exporting backup of the given server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents BackupAndExport API Response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BackupAndExportResponseInner create(String resourceGroupName, String serverName, BackupAndExportRequest parameters); - - /** - * Exports the backup of the given server by creating a backup if not existing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for creating and exporting backup of the given server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents BackupAndExport API Response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BackupAndExportResponseInner create(String resourceGroupName, String serverName, BackupAndExportRequest parameters, - Context context); - - /** - * Validates if backup can be performed for given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents ValidateBackup API Response along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response validateBackupWithResponse(String resourceGroupName, String serverName, - Context context); - - /** - * Validates if backup can be performed for given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents ValidateBackup API Response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ValidateBackupResponseInner validateBackup(String resourceGroupName, String serverName); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/BackupsClient.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/BackupsClient.java index 8c3c6ff1a943b..e6a21fde6914b 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/BackupsClient.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/BackupsClient.java @@ -15,36 +15,6 @@ * An instance of this class provides access to all the operations defined in BackupsClient. */ public interface BackupsClient { - /** - * Create backup for a given server with specified backup name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param backupName The name of the backup. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return server backup properties along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response putWithResponse(String resourceGroupName, String serverName, String backupName, - Context context); - - /** - * Create backup for a given server with specified backup name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param backupName The name of the backup. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return server backup properties. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ServerBackupInner put(String resourceGroupName, String serverName, String backupName); - /** * List all the backups for a given server. * diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/ConfigurationsClient.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/ConfigurationsClient.java index 75dd91fda6c51..63b2c4ec50485 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/ConfigurationsClient.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/ConfigurationsClient.java @@ -19,72 +19,6 @@ * An instance of this class provides access to all the operations defined in ConfigurationsClient. */ public interface ConfigurationsClient { - /** - * Updates a configuration of a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param configurationName The name of the server configuration. - * @param parameters The required parameters for updating a server configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of represents a Configuration. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ConfigurationInner> beginCreateOrUpdate(String resourceGroupName, - String serverName, String configurationName, ConfigurationInner parameters); - - /** - * Updates a configuration of a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param configurationName The name of the server configuration. - * @param parameters The required parameters for updating a server configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of represents a Configuration. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ConfigurationInner> beginCreateOrUpdate(String resourceGroupName, - String serverName, String configurationName, ConfigurationInner parameters, Context context); - - /** - * Updates a configuration of a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param configurationName The name of the server configuration. - * @param parameters The required parameters for updating a server configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a Configuration. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ConfigurationInner createOrUpdate(String resourceGroupName, String serverName, String configurationName, - ConfigurationInner parameters); - - /** - * Updates a configuration of a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param configurationName The name of the server configuration. - * @param parameters The required parameters for updating a server configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a Configuration. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ConfigurationInner createOrUpdate(String resourceGroupName, String serverName, String configurationName, - ConfigurationInner parameters, Context context); - /** * Updates a configuration of a server. * @@ -261,10 +195,6 @@ ConfigurationListResultInner batchUpdate(String resourceGroupName, String server * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. - * @param tags The tags of the server configuration. - * @param keyword The keyword of the server configuration. - * @param page The page of the server configuration. - * @param pageSize The pageSize of the server configuration. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -272,6 +202,5 @@ ConfigurationListResultInner batchUpdate(String resourceGroupName, String server * @return a list of server configurations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByServer(String resourceGroupName, String serverName, String tags, - String keyword, Integer page, Integer pageSize, Context context); + PagedIterable listByServer(String resourceGroupName, String serverName, Context context); } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/LocationBasedCapabilitySetsClient.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/LocationBasedCapabilitySetsClient.java deleted file mode 100644 index 9e246e65de56a..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/LocationBasedCapabilitySetsClient.java +++ /dev/null @@ -1,71 +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.mysqlflexibleserver.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.mysqlflexibleserver.fluent.models.CapabilityInner; - -/** - * An instance of this class provides access to all the operations defined in LocationBasedCapabilitySetsClient. - */ -public interface LocationBasedCapabilitySetsClient { - /** - * Get capabilities at specified location in a given subscription. - * - * @param locationName The name of the location. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return capabilities at specified location in a given subscription as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String locationName); - - /** - * Get capabilities at specified location in a given subscription. - * - * @param locationName The name of the location. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return capabilities at specified location in a given subscription as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String locationName, Context context); - - /** - * Get capabilities at specified location in a given subscription. - * - * @param locationName The name of the location. - * @param capabilitySetName Name of capability set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return capabilities at specified location in a given subscription along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String locationName, String capabilitySetName, Context context); - - /** - * Get capabilities at specified location in a given subscription. - * - * @param locationName The name of the location. - * @param capabilitySetName Name of capability set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return capabilities at specified location in a given subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CapabilityInner get(String locationName, String capabilitySetName); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/LogFilesClient.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/LogFilesClient.java deleted file mode 100644 index b80c24e9385c5..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/LogFilesClient.java +++ /dev/null @@ -1,43 +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.mysqlflexibleserver.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.mysqlflexibleserver.fluent.models.LogFileInner; - -/** - * An instance of this class provides access to all the operations defined in LogFilesClient. - */ -public interface LogFilesClient { - /** - * List all the server log files in a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 logFiles as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByServer(String resourceGroupName, String serverName); - - /** - * List all the server log files in a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 logFiles as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByServer(String resourceGroupName, String serverName, Context context); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/LongRunningBackupsClient.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/LongRunningBackupsClient.java deleted file mode 100644 index 2a765bd13d1b8..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/LongRunningBackupsClient.java +++ /dev/null @@ -1,80 +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.mysqlflexibleserver.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerBackupV2Inner; - -/** - * An instance of this class provides access to all the operations defined in LongRunningBackupsClient. - */ -public interface LongRunningBackupsClient { - /** - * Create backup for a given server with specified backup name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param backupName The name of the backup. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of server backup properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ServerBackupV2Inner> beginCreate(String resourceGroupName, - String serverName, String backupName); - - /** - * Create backup for a given server with specified backup name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param backupName The name of the backup. - * @param parameters The required parameters for creating and exporting backup of the given server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of server backup properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ServerBackupV2Inner> beginCreate(String resourceGroupName, - String serverName, String backupName, ServerBackupV2Inner parameters, Context context); - - /** - * Create backup for a given server with specified backup name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param backupName The name of the backup. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return server backup properties. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ServerBackupV2Inner create(String resourceGroupName, String serverName, String backupName); - - /** - * Create backup for a given server with specified backup name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param backupName The name of the backup. - * @param parameters The required parameters for creating and exporting backup of the given server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return server backup properties. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ServerBackupV2Inner create(String resourceGroupName, String serverName, String backupName, - ServerBackupV2Inner parameters, Context context); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/LongRunningBackupsOperationsClient.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/LongRunningBackupsOperationsClient.java deleted file mode 100644 index 7fa0a1d41d109..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/LongRunningBackupsOperationsClient.java +++ /dev/null @@ -1,74 +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.mysqlflexibleserver.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.mysqlflexibleserver.fluent.models.ServerBackupV2Inner; - -/** - * An instance of this class provides access to all the operations defined in LongRunningBackupsOperationsClient. - */ -public interface LongRunningBackupsOperationsClient { - /** - * Get backup for a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param backupName The name of the backup. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup for a given server along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String serverName, String backupName, - Context context); - - /** - * Get backup for a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param backupName The name of the backup. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup for a given server. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ServerBackupV2Inner get(String resourceGroupName, String serverName, String backupName); - - /** - * List all the backups for a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 server backups as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String serverName); - - /** - * List all the backups for a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 server backups as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String serverName, Context context); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/MaintenancesClient.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/MaintenancesClient.java deleted file mode 100644 index 5dd065380a19e..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/MaintenancesClient.java +++ /dev/null @@ -1,140 +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.mysqlflexibleserver.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.mysqlflexibleserver.fluent.models.MaintenanceInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceUpdate; - -/** - * An instance of this class provides access to all the operations defined in MaintenancesClient. - */ -public interface MaintenancesClient { - /** - * Read maintenance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param maintenanceName The name of the maintenance. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a maintenance along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response readWithResponse(String resourceGroupName, String serverName, String maintenanceName, - Context context); - - /** - * Read maintenance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param maintenanceName The name of the maintenance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a maintenance. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - MaintenanceInner read(String resourceGroupName, String serverName, String maintenanceName); - - /** - * Update maintenances. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param maintenanceName The name of the maintenance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of represents a maintenance. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, MaintenanceInner> beginUpdate(String resourceGroupName, String serverName, - String maintenanceName); - - /** - * Update maintenances. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param maintenanceName The name of the maintenance. - * @param parameters The required parameters for update maintenance on a server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of represents a maintenance. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, MaintenanceInner> beginUpdate(String resourceGroupName, String serverName, - String maintenanceName, MaintenanceUpdate parameters, Context context); - - /** - * Update maintenances. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param maintenanceName The name of the maintenance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a maintenance. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - MaintenanceInner update(String resourceGroupName, String serverName, String maintenanceName); - - /** - * Update maintenances. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param maintenanceName The name of the maintenance. - * @param parameters The required parameters for update maintenance on a server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a maintenance. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - MaintenanceInner update(String resourceGroupName, String serverName, String maintenanceName, - MaintenanceUpdate parameters, Context context); - - /** - * List maintenances. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 maintenances as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String serverName); - - /** - * List maintenances. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 maintenances as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String serverName, Context context); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/MySqlManagementClient.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/MySqlManagementClient.java index 3de900b9fa497..727614c731261 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/MySqlManagementClient.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/MySqlManagementClient.java @@ -12,7 +12,7 @@ */ public interface MySqlManagementClient { /** - * Gets The ID of the target subscription. The value must be an UUID. + * Gets The ID of the target subscription. * * @return the subscriptionId value. */ @@ -25,6 +25,13 @@ public interface MySqlManagementClient { */ String getEndpoint(); + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + String getApiVersion(); + /** * Gets The HTTP pipeline to send requests through. * @@ -39,62 +46,6 @@ public interface MySqlManagementClient { */ Duration getDefaultPollInterval(); - /** - * Gets the AzureADAdministratorsClient object to access its operations. - * - * @return the AzureADAdministratorsClient object. - */ - AzureADAdministratorsClient getAzureADAdministrators(); - - /** - * Gets the BackupsClient object to access its operations. - * - * @return the BackupsClient object. - */ - BackupsClient getBackups(); - - /** - * Gets the BackupAndExportsClient object to access its operations. - * - * @return the BackupAndExportsClient object. - */ - BackupAndExportsClient getBackupAndExports(); - - /** - * Gets the LongRunningBackupsClient object to access its operations. - * - * @return the LongRunningBackupsClient object. - */ - LongRunningBackupsClient getLongRunningBackups(); - - /** - * Gets the LongRunningBackupsOperationsClient object to access its operations. - * - * @return the LongRunningBackupsOperationsClient object. - */ - LongRunningBackupsOperationsClient getLongRunningBackupsOperations(); - - /** - * Gets the ConfigurationsClient object to access its operations. - * - * @return the ConfigurationsClient object. - */ - ConfigurationsClient getConfigurations(); - - /** - * Gets the DatabasesClient object to access its operations. - * - * @return the DatabasesClient object. - */ - DatabasesClient getDatabases(); - - /** - * Gets the FirewallRulesClient object to access its operations. - * - * @return the FirewallRulesClient object. - */ - FirewallRulesClient getFirewallRules(); - /** * Gets the ServersClient object to access its operations. * @@ -110,39 +61,39 @@ public interface MySqlManagementClient { ReplicasClient getReplicas(); /** - * Gets the ServersMigrationsClient object to access its operations. + * Gets the BackupsClient object to access its operations. * - * @return the ServersMigrationsClient object. + * @return the BackupsClient object. */ - ServersMigrationsClient getServersMigrations(); + BackupsClient getBackups(); /** - * Gets the AdvancedThreatProtectionSettingsClient object to access its operations. + * Gets the FirewallRulesClient object to access its operations. * - * @return the AdvancedThreatProtectionSettingsClient object. + * @return the FirewallRulesClient object. */ - AdvancedThreatProtectionSettingsClient getAdvancedThreatProtectionSettings(); + FirewallRulesClient getFirewallRules(); /** - * Gets the LogFilesClient object to access its operations. + * Gets the DatabasesClient object to access its operations. * - * @return the LogFilesClient object. + * @return the DatabasesClient object. */ - LogFilesClient getLogFiles(); + DatabasesClient getDatabases(); /** - * Gets the LocationBasedCapabilitiesClient object to access its operations. + * Gets the ConfigurationsClient object to access its operations. * - * @return the LocationBasedCapabilitiesClient object. + * @return the ConfigurationsClient object. */ - LocationBasedCapabilitiesClient getLocationBasedCapabilities(); + ConfigurationsClient getConfigurations(); /** - * Gets the LocationBasedCapabilitySetsClient object to access its operations. + * Gets the LocationBasedCapabilitiesClient object to access its operations. * - * @return the LocationBasedCapabilitySetsClient object. + * @return the LocationBasedCapabilitiesClient object. */ - LocationBasedCapabilitySetsClient getLocationBasedCapabilitySets(); + LocationBasedCapabilitiesClient getLocationBasedCapabilities(); /** * Gets the CheckVirtualNetworkSubnetUsagesClient object to access its operations. @@ -165,20 +116,6 @@ public interface MySqlManagementClient { */ CheckNameAvailabilityWithoutLocationsClient getCheckNameAvailabilityWithoutLocations(); - /** - * Gets the OperationResultsClient object to access its operations. - * - * @return the OperationResultsClient object. - */ - OperationResultsClient getOperationResults(); - - /** - * Gets the OperationProgressClient object to access its operations. - * - * @return the OperationProgressClient object. - */ - OperationProgressClient getOperationProgress(); - /** * Gets the GetPrivateDnsZoneSuffixesClient object to access its operations. * @@ -192,11 +129,4 @@ public interface MySqlManagementClient { * @return the OperationsClient object. */ OperationsClient getOperations(); - - /** - * Gets the MaintenancesClient object to access its operations. - * - * @return the MaintenancesClient object. - */ - MaintenancesClient getMaintenances(); } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/OperationProgressClient.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/OperationProgressClient.java deleted file mode 100644 index 4145eff4908c9..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/OperationProgressClient.java +++ /dev/null @@ -1,43 +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.mysqlflexibleserver.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.OperationProgressResultInner; - -/** - * An instance of this class provides access to all the operations defined in OperationProgressClient. - */ -public interface OperationProgressClient { - /** - * Get the operation result for a long running operation. - * - * @param locationName The name of the location. - * @param operationId The ID of an ongoing async operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the operation result for a long running operation along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String locationName, String operationId, Context context); - - /** - * Get the operation result for a long running operation. - * - * @param locationName The name of the location. - * @param operationId The ID of an ongoing async operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the operation result for a long running operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - OperationProgressResultInner get(String locationName, String operationId); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/OperationResultsClient.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/OperationResultsClient.java deleted file mode 100644 index 8647fc063175c..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/OperationResultsClient.java +++ /dev/null @@ -1,44 +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.mysqlflexibleserver.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.OperationStatusExtendedResultInner; - -/** - * An instance of this class provides access to all the operations defined in OperationResultsClient. - */ -public interface OperationResultsClient { - /** - * Get the operation result for a long running operation. - * - * @param locationName The name of the location. - * @param operationId The operation Id. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the operation result for a long running operation along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String locationName, String operationId, - Context context); - - /** - * Get the operation result for a long running operation. - * - * @param locationName The name of the location. - * @param operationId The operation Id. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the operation result for a long running operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - OperationStatusExtendedResultInner get(String locationName, String operationId); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/ServersClient.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/ServersClient.java index 12b95a2b0e190..ba7ffac6c34bc 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/ServersClient.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/ServersClient.java @@ -11,10 +11,8 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.HighAvailabilityValidationEstimationInner; import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerInner; import com.azure.resourcemanager.mysqlflexibleserver.models.ServerForUpdate; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerGtidSetParameter; import com.azure.resourcemanager.mysqlflexibleserver.models.ServerRestartParameter; /** @@ -323,38 +321,6 @@ SyncPoller, ServerInner> beginUpdate(String resourceGrou @ServiceMethod(returns = ReturnType.SINGLE) void failover(String resourceGroupName, String serverName, Context context); - /** - * Validate a deployment of high availability. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for validation of high availability deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return high availability validation properties of a server along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response validateEstimateHighAvailabilityWithResponse( - String resourceGroupName, String serverName, HighAvailabilityValidationEstimationInner parameters, - Context context); - - /** - * Validate a deployment of high availability. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for validation of high availability deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return high availability validation properties of a server. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - HighAvailabilityValidationEstimationInner validateEstimateHighAvailability(String resourceGroupName, - String serverName, HighAvailabilityValidationEstimationInner parameters); - /** * Restarts a server. * @@ -516,62 +482,4 @@ SyncPoller, Void> beginRestart(String resourceGroupName, String */ @ServiceMethod(returns = ReturnType.SINGLE) void stop(String resourceGroupName, String serverName, Context context); - - /** - * Resets GTID on a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for resetting GTID on a server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked 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> beginResetGtid(String resourceGroupName, String serverName, - ServerGtidSetParameter parameters); - - /** - * Resets GTID on a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for resetting GTID on a server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked 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> beginResetGtid(String resourceGroupName, String serverName, - ServerGtidSetParameter parameters, Context context); - - /** - * Resets GTID on a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for resetting GTID on a server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 resetGtid(String resourceGroupName, String serverName, ServerGtidSetParameter parameters); - - /** - * Resets GTID on a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for resetting GTID on a server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 resetGtid(String resourceGroupName, String serverName, ServerGtidSetParameter parameters, Context context); } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/ServersMigrationsClient.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/ServersMigrationsClient.java deleted file mode 100644 index aa80c129bb97a..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/ServersMigrationsClient.java +++ /dev/null @@ -1,72 +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.mysqlflexibleserver.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerInner; - -/** - * An instance of this class provides access to all the operations defined in ServersMigrationsClient. - */ -public interface ServersMigrationsClient { - /** - * Cutover migration for MySQL import, it will switch source elastic server DNS to flexible server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of represents a server. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ServerInner> beginCutoverMigration(String resourceGroupName, String serverName); - - /** - * Cutover migration for MySQL import, it will switch source elastic server DNS to flexible server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of represents a server. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ServerInner> beginCutoverMigration(String resourceGroupName, String serverName, - Context context); - - /** - * Cutover migration for MySQL import, it will switch source elastic server DNS to flexible server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a server. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ServerInner cutoverMigration(String resourceGroupName, String serverName); - - /** - * Cutover migration for MySQL import, it will switch source elastic server DNS to flexible server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a server. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ServerInner cutoverMigration(String resourceGroupName, String serverName, Context context); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/AdministratorProperties.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/AdministratorProperties.java deleted file mode 100644 index 473688c6ec8e6..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/AdministratorProperties.java +++ /dev/null @@ -1,208 +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.mysqlflexibleserver.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.mysqlflexibleserver.models.AdministratorType; -import java.io.IOException; - -/** - * The properties of an administrator. - */ -@Fluent -public final class AdministratorProperties implements JsonSerializable { - /* - * Type of the sever administrator. - */ - private AdministratorType administratorType; - - /* - * Login name of the server administrator. - */ - private String login; - - /* - * SID (object ID) of the server administrator. - */ - private String sid; - - /* - * Tenant ID of the administrator. - */ - private String tenantId; - - /* - * The resource id of the identity used for AAD Authentication. - */ - private String identityResourceId; - - /** - * Creates an instance of AdministratorProperties class. - */ - public AdministratorProperties() { - } - - /** - * Get the administratorType property: Type of the sever administrator. - * - * @return the administratorType value. - */ - public AdministratorType administratorType() { - return this.administratorType; - } - - /** - * Set the administratorType property: Type of the sever administrator. - * - * @param administratorType the administratorType value to set. - * @return the AdministratorProperties object itself. - */ - public AdministratorProperties withAdministratorType(AdministratorType administratorType) { - this.administratorType = administratorType; - return this; - } - - /** - * Get the login property: Login name of the server administrator. - * - * @return the login value. - */ - public String login() { - return this.login; - } - - /** - * Set the login property: Login name of the server administrator. - * - * @param login the login value to set. - * @return the AdministratorProperties object itself. - */ - public AdministratorProperties withLogin(String login) { - this.login = login; - return this; - } - - /** - * Get the sid property: SID (object ID) of the server administrator. - * - * @return the sid value. - */ - public String sid() { - return this.sid; - } - - /** - * Set the sid property: SID (object ID) of the server administrator. - * - * @param sid the sid value to set. - * @return the AdministratorProperties object itself. - */ - public AdministratorProperties withSid(String sid) { - this.sid = sid; - return this; - } - - /** - * Get the tenantId property: Tenant ID of the administrator. - * - * @return the tenantId value. - */ - public String tenantId() { - return this.tenantId; - } - - /** - * Set the tenantId property: Tenant ID of the administrator. - * - * @param tenantId the tenantId value to set. - * @return the AdministratorProperties object itself. - */ - public AdministratorProperties withTenantId(String tenantId) { - this.tenantId = tenantId; - return this; - } - - /** - * Get the identityResourceId property: The resource id of the identity used for AAD Authentication. - * - * @return the identityResourceId value. - */ - public String identityResourceId() { - return this.identityResourceId; - } - - /** - * Set the identityResourceId property: The resource id of the identity used for AAD Authentication. - * - * @param identityResourceId the identityResourceId value to set. - * @return the AdministratorProperties object itself. - */ - public AdministratorProperties withIdentityResourceId(String identityResourceId) { - this.identityResourceId = identityResourceId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("administratorType", - this.administratorType == null ? null : this.administratorType.toString()); - jsonWriter.writeStringField("login", this.login); - jsonWriter.writeStringField("sid", this.sid); - jsonWriter.writeStringField("tenantId", this.tenantId); - jsonWriter.writeStringField("identityResourceId", this.identityResourceId); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AdministratorProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AdministratorProperties if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IOException If an error occurs while reading the AdministratorProperties. - */ - public static AdministratorProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AdministratorProperties deserializedAdministratorProperties = new AdministratorProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("administratorType".equals(fieldName)) { - deserializedAdministratorProperties.administratorType - = AdministratorType.fromString(reader.getString()); - } else if ("login".equals(fieldName)) { - deserializedAdministratorProperties.login = reader.getString(); - } else if ("sid".equals(fieldName)) { - deserializedAdministratorProperties.sid = reader.getString(); - } else if ("tenantId".equals(fieldName)) { - deserializedAdministratorProperties.tenantId = reader.getString(); - } else if ("identityResourceId".equals(fieldName)) { - deserializedAdministratorProperties.identityResourceId = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAdministratorProperties; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/AdvancedThreatProtectionInner.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/AdvancedThreatProtectionInner.java deleted file mode 100644 index 8b65a85bbe836..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/AdvancedThreatProtectionInner.java +++ /dev/null @@ -1,202 +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.mysqlflexibleserver.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.mysqlflexibleserver.models.AdvancedThreatProtectionProvisioningState; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionState; -import java.io.IOException; -import java.time.OffsetDateTime; - -/** - * A server's Advanced Threat Protection. - */ -@Fluent -public final class AdvancedThreatProtectionInner extends ProxyResource { - /* - * Resource properties. - */ - private AdvancedThreatProtectionProperties innerProperties; - - /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - */ - private SystemData systemData; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of AdvancedThreatProtectionInner class. - */ - public AdvancedThreatProtectionInner() { - } - - /** - * Get the innerProperties property: Resource properties. - * - * @return the innerProperties value. - */ - private AdvancedThreatProtectionProperties 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 type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * Get the creationTime property: Specifies the UTC creation time of the policy. - * - * @return the creationTime value. - */ - public OffsetDateTime creationTime() { - return this.innerProperties() == null ? null : this.innerProperties().creationTime(); - } - - /** - * Get the state property: Specifies the state of the Advanced Threat Protection, whether it is enabled or disabled - * or a state has not been applied yet on the specific database or server. - * - * @return the state value. - */ - public AdvancedThreatProtectionState state() { - return this.innerProperties() == null ? null : this.innerProperties().state(); - } - - /** - * Set the state property: Specifies the state of the Advanced Threat Protection, whether it is enabled or disabled - * or a state has not been applied yet on the specific database or server. - * - * @param state the state value to set. - * @return the AdvancedThreatProtectionInner object itself. - */ - public AdvancedThreatProtectionInner withState(AdvancedThreatProtectionState state) { - if (this.innerProperties() == null) { - this.innerProperties = new AdvancedThreatProtectionProperties(); - } - this.innerProperties().withState(state); - return this; - } - - /** - * Get the provisioningState property: Provisioning state of the Threat Protection. - * - * @return the provisioningState value. - */ - public AdvancedThreatProtectionProvisioningState 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 AdvancedThreatProtectionInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AdvancedThreatProtectionInner if the JsonReader was pointing to an instance of it, or null - * if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the AdvancedThreatProtectionInner. - */ - public static AdvancedThreatProtectionInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AdvancedThreatProtectionInner deserializedAdvancedThreatProtectionInner - = new AdvancedThreatProtectionInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedAdvancedThreatProtectionInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedAdvancedThreatProtectionInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedAdvancedThreatProtectionInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedAdvancedThreatProtectionInner.innerProperties - = AdvancedThreatProtectionProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedAdvancedThreatProtectionInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAdvancedThreatProtectionInner; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/AdvancedThreatProtectionProperties.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/AdvancedThreatProtectionProperties.java deleted file mode 100644 index 7a3c58b6cef53..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/AdvancedThreatProtectionProperties.java +++ /dev/null @@ -1,136 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.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.mysqlflexibleserver.models.AdvancedThreatProtectionProvisioningState; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionState; -import java.io.IOException; -import java.time.OffsetDateTime; - -/** - * Properties of an Advanced Threat Protection setting. - */ -@Fluent -public final class AdvancedThreatProtectionProperties implements JsonSerializable { - /* - * Specifies the UTC creation time of the policy. - */ - private OffsetDateTime creationTime; - - /* - * Specifies the state of the Advanced Threat Protection, whether it is enabled or disabled or a state has not been - * applied yet on the specific database or server. - */ - private AdvancedThreatProtectionState state; - - /* - * Provisioning state of the Threat Protection. - */ - private AdvancedThreatProtectionProvisioningState provisioningState; - - /** - * Creates an instance of AdvancedThreatProtectionProperties class. - */ - public AdvancedThreatProtectionProperties() { - } - - /** - * Get the creationTime property: Specifies the UTC creation time of the policy. - * - * @return the creationTime value. - */ - public OffsetDateTime creationTime() { - return this.creationTime; - } - - /** - * Get the state property: Specifies the state of the Advanced Threat Protection, whether it is enabled or disabled - * or a state has not been applied yet on the specific database or server. - * - * @return the state value. - */ - public AdvancedThreatProtectionState state() { - return this.state; - } - - /** - * Set the state property: Specifies the state of the Advanced Threat Protection, whether it is enabled or disabled - * or a state has not been applied yet on the specific database or server. - * - * @param state the state value to set. - * @return the AdvancedThreatProtectionProperties object itself. - */ - public AdvancedThreatProtectionProperties withState(AdvancedThreatProtectionState state) { - this.state = state; - return this; - } - - /** - * Get the provisioningState property: Provisioning state of the Threat Protection. - * - * @return the provisioningState value. - */ - public AdvancedThreatProtectionProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AdvancedThreatProtectionProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AdvancedThreatProtectionProperties if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the AdvancedThreatProtectionProperties. - */ - public static AdvancedThreatProtectionProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AdvancedThreatProtectionProperties deserializedAdvancedThreatProtectionProperties - = new AdvancedThreatProtectionProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("creationTime".equals(fieldName)) { - deserializedAdvancedThreatProtectionProperties.creationTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("state".equals(fieldName)) { - deserializedAdvancedThreatProtectionProperties.state - = AdvancedThreatProtectionState.fromString(reader.getString()); - } else if ("provisioningState".equals(fieldName)) { - deserializedAdvancedThreatProtectionProperties.provisioningState - = AdvancedThreatProtectionProvisioningState.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedAdvancedThreatProtectionProperties; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/AdvancedThreatProtectionUpdateProperties.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/AdvancedThreatProtectionUpdateProperties.java deleted file mode 100644 index 463d9d5a5f077..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/AdvancedThreatProtectionUpdateProperties.java +++ /dev/null @@ -1,109 +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.mysqlflexibleserver.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.mysqlflexibleserver.models.AdvancedThreatProtectionState; -import java.io.IOException; - -/** - * Properties of Advanced Threat Protection that can be updated. - */ -@Fluent -public final class AdvancedThreatProtectionUpdateProperties - implements JsonSerializable { - /* - * Specifies the state of the Advanced Threat Protection, whether it is enabled or disabled or a state has not been - * applied yet on the specific database or server. - */ - private AdvancedThreatProtectionState state; - - /** - * Creates an instance of AdvancedThreatProtectionUpdateProperties class. - */ - public AdvancedThreatProtectionUpdateProperties() { - } - - /** - * Get the state property: Specifies the state of the Advanced Threat Protection, whether it is enabled or disabled - * or a state has not been applied yet on the specific database or server. - * - * @return the state value. - */ - public AdvancedThreatProtectionState state() { - return this.state; - } - - /** - * Set the state property: Specifies the state of the Advanced Threat Protection, whether it is enabled or disabled - * or a state has not been applied yet on the specific database or server. - * - * @param state the state value to set. - * @return the AdvancedThreatProtectionUpdateProperties object itself. - */ - public AdvancedThreatProtectionUpdateProperties withState(AdvancedThreatProtectionState state) { - this.state = state; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (state() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property state in model AdvancedThreatProtectionUpdateProperties")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(AdvancedThreatProtectionUpdateProperties.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AdvancedThreatProtectionUpdateProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AdvancedThreatProtectionUpdateProperties if the JsonReader was pointing to an instance of - * it, or null if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the AdvancedThreatProtectionUpdateProperties. - */ - public static AdvancedThreatProtectionUpdateProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AdvancedThreatProtectionUpdateProperties deserializedAdvancedThreatProtectionUpdateProperties - = new AdvancedThreatProtectionUpdateProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("state".equals(fieldName)) { - deserializedAdvancedThreatProtectionUpdateProperties.state - = AdvancedThreatProtectionState.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedAdvancedThreatProtectionUpdateProperties; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/AzureADAdministratorInner.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/AzureADAdministratorInner.java deleted file mode 100644 index ac756148dfc0e..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/AzureADAdministratorInner.java +++ /dev/null @@ -1,270 +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.mysqlflexibleserver.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.mysqlflexibleserver.models.AdministratorType; -import java.io.IOException; - -/** - * Represents a Administrator. - */ -@Fluent -public final class AzureADAdministratorInner extends ProxyResource { - /* - * The properties of an administrator. - */ - private AdministratorProperties innerProperties; - - /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - */ - private SystemData systemData; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of AzureADAdministratorInner class. - */ - public AzureADAdministratorInner() { - } - - /** - * Get the innerProperties property: The properties of an administrator. - * - * @return the innerProperties value. - */ - private AdministratorProperties 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 type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * Get the administratorType property: Type of the sever administrator. - * - * @return the administratorType value. - */ - public AdministratorType administratorType() { - return this.innerProperties() == null ? null : this.innerProperties().administratorType(); - } - - /** - * Set the administratorType property: Type of the sever administrator. - * - * @param administratorType the administratorType value to set. - * @return the AzureADAdministratorInner object itself. - */ - public AzureADAdministratorInner withAdministratorType(AdministratorType administratorType) { - if (this.innerProperties() == null) { - this.innerProperties = new AdministratorProperties(); - } - this.innerProperties().withAdministratorType(administratorType); - return this; - } - - /** - * Get the login property: Login name of the server administrator. - * - * @return the login value. - */ - public String login() { - return this.innerProperties() == null ? null : this.innerProperties().login(); - } - - /** - * Set the login property: Login name of the server administrator. - * - * @param login the login value to set. - * @return the AzureADAdministratorInner object itself. - */ - public AzureADAdministratorInner withLogin(String login) { - if (this.innerProperties() == null) { - this.innerProperties = new AdministratorProperties(); - } - this.innerProperties().withLogin(login); - return this; - } - - /** - * Get the sid property: SID (object ID) of the server administrator. - * - * @return the sid value. - */ - public String sid() { - return this.innerProperties() == null ? null : this.innerProperties().sid(); - } - - /** - * Set the sid property: SID (object ID) of the server administrator. - * - * @param sid the sid value to set. - * @return the AzureADAdministratorInner object itself. - */ - public AzureADAdministratorInner withSid(String sid) { - if (this.innerProperties() == null) { - this.innerProperties = new AdministratorProperties(); - } - this.innerProperties().withSid(sid); - return this; - } - - /** - * Get the tenantId property: Tenant ID of the administrator. - * - * @return the tenantId value. - */ - public String tenantId() { - return this.innerProperties() == null ? null : this.innerProperties().tenantId(); - } - - /** - * Set the tenantId property: Tenant ID of the administrator. - * - * @param tenantId the tenantId value to set. - * @return the AzureADAdministratorInner object itself. - */ - public AzureADAdministratorInner withTenantId(String tenantId) { - if (this.innerProperties() == null) { - this.innerProperties = new AdministratorProperties(); - } - this.innerProperties().withTenantId(tenantId); - return this; - } - - /** - * Get the identityResourceId property: The resource id of the identity used for AAD Authentication. - * - * @return the identityResourceId value. - */ - public String identityResourceId() { - return this.innerProperties() == null ? null : this.innerProperties().identityResourceId(); - } - - /** - * Set the identityResourceId property: The resource id of the identity used for AAD Authentication. - * - * @param identityResourceId the identityResourceId value to set. - * @return the AzureADAdministratorInner object itself. - */ - public AzureADAdministratorInner withIdentityResourceId(String identityResourceId) { - if (this.innerProperties() == null) { - this.innerProperties = new AdministratorProperties(); - } - this.innerProperties().withIdentityResourceId(identityResourceId); - 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 AzureADAdministratorInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureADAdministratorInner if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the AzureADAdministratorInner. - */ - public static AzureADAdministratorInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureADAdministratorInner deserializedAzureADAdministratorInner = new AzureADAdministratorInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedAzureADAdministratorInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedAzureADAdministratorInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedAzureADAdministratorInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedAzureADAdministratorInner.innerProperties = AdministratorProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedAzureADAdministratorInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureADAdministratorInner; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/BackupAndExportResponseInner.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/BackupAndExportResponseInner.java deleted file mode 100644 index 2ce1d491e88e7..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/BackupAndExportResponseInner.java +++ /dev/null @@ -1,376 +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.mysqlflexibleserver.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.core.management.exception.ManagementError; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.mysqlflexibleserver.models.OperationStatus; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; - -/** - * Represents BackupAndExport API Response. - */ -@Fluent -public final class BackupAndExportResponseInner extends ProxyResource { - /* - * The operation status - */ - private OperationStatus status; - - /* - * Start time - */ - private OffsetDateTime startTime; - - /* - * End time - */ - private OffsetDateTime endTime; - - /* - * Operation progress (0-100). - */ - private Double percentComplete; - - /* - * The response properties of a backup and export operation. - */ - private BackupAndExportResponseProperties innerProperties; - - /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - */ - private SystemData systemData; - - /* - * The error object. - */ - private ManagementError error; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of BackupAndExportResponseInner class. - */ - public BackupAndExportResponseInner() { - } - - /** - * Get the status property: The operation status. - * - * @return the status value. - */ - public OperationStatus status() { - return this.status; - } - - /** - * Set the status property: The operation status. - * - * @param status the status value to set. - * @return the BackupAndExportResponseInner object itself. - */ - public BackupAndExportResponseInner withStatus(OperationStatus status) { - this.status = status; - return this; - } - - /** - * Get the startTime property: Start time. - * - * @return the startTime value. - */ - public OffsetDateTime startTime() { - return this.startTime; - } - - /** - * Set the startTime property: Start time. - * - * @param startTime the startTime value to set. - * @return the BackupAndExportResponseInner object itself. - */ - public BackupAndExportResponseInner withStartTime(OffsetDateTime startTime) { - this.startTime = startTime; - return this; - } - - /** - * Get the endTime property: End time. - * - * @return the endTime value. - */ - public OffsetDateTime endTime() { - return this.endTime; - } - - /** - * Set the endTime property: End time. - * - * @param endTime the endTime value to set. - * @return the BackupAndExportResponseInner object itself. - */ - public BackupAndExportResponseInner withEndTime(OffsetDateTime endTime) { - this.endTime = endTime; - return this; - } - - /** - * Get the percentComplete property: Operation progress (0-100). - * - * @return the percentComplete value. - */ - public Double percentComplete() { - return this.percentComplete; - } - - /** - * Set the percentComplete property: Operation progress (0-100). - * - * @param percentComplete the percentComplete value to set. - * @return the BackupAndExportResponseInner object itself. - */ - public BackupAndExportResponseInner withPercentComplete(Double percentComplete) { - this.percentComplete = percentComplete; - return this; - } - - /** - * Get the innerProperties property: The response properties of a backup and export operation. - * - * @return the innerProperties value. - */ - private BackupAndExportResponseProperties 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 error property: The error object. - * - * @return the error value. - */ - public ManagementError error() { - return this.error; - } - - /** - * Set the error property: The error object. - * - * @param error the error value to set. - * @return the BackupAndExportResponseInner object itself. - */ - public BackupAndExportResponseInner withError(ManagementError error) { - this.error = error; - return this; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * Get the datasourceSizeInBytes property: Size of datasource in bytes. - * - * @return the datasourceSizeInBytes value. - */ - public Long datasourceSizeInBytes() { - return this.innerProperties() == null ? null : this.innerProperties().datasourceSizeInBytes(); - } - - /** - * Set the datasourceSizeInBytes property: Size of datasource in bytes. - * - * @param datasourceSizeInBytes the datasourceSizeInBytes value to set. - * @return the BackupAndExportResponseInner object itself. - */ - public BackupAndExportResponseInner withDatasourceSizeInBytes(Long datasourceSizeInBytes) { - if (this.innerProperties() == null) { - this.innerProperties = new BackupAndExportResponseProperties(); - } - this.innerProperties().withDatasourceSizeInBytes(datasourceSizeInBytes); - return this; - } - - /** - * Get the dataTransferredInBytes property: Data transferred in bytes. - * - * @return the dataTransferredInBytes value. - */ - public Long dataTransferredInBytes() { - return this.innerProperties() == null ? null : this.innerProperties().dataTransferredInBytes(); - } - - /** - * Set the dataTransferredInBytes property: Data transferred in bytes. - * - * @param dataTransferredInBytes the dataTransferredInBytes value to set. - * @return the BackupAndExportResponseInner object itself. - */ - public BackupAndExportResponseInner withDataTransferredInBytes(Long dataTransferredInBytes) { - if (this.innerProperties() == null) { - this.innerProperties = new BackupAndExportResponseProperties(); - } - this.innerProperties().withDataTransferredInBytes(dataTransferredInBytes); - return this; - } - - /** - * Get the backupMetadata property: Metadata related to backup to be stored for restoring resource in key-value - * pairs. - * - * @return the backupMetadata value. - */ - public String backupMetadata() { - return this.innerProperties() == null ? null : this.innerProperties().backupMetadata(); - } - - /** - * Set the backupMetadata property: Metadata related to backup to be stored for restoring resource in key-value - * pairs. - * - * @param backupMetadata the backupMetadata value to set. - * @return the BackupAndExportResponseInner object itself. - */ - public BackupAndExportResponseInner withBackupMetadata(String backupMetadata) { - if (this.innerProperties() == null) { - this.innerProperties = new BackupAndExportResponseProperties(); - } - this.innerProperties().withBackupMetadata(backupMetadata); - 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.writeStringField("status", this.status == null ? null : this.status.toString()); - 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("percentComplete", this.percentComplete); - jsonWriter.writeJsonField("properties", this.innerProperties); - jsonWriter.writeJsonField("error", this.error); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of BackupAndExportResponseInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of BackupAndExportResponseInner if the JsonReader was pointing to an instance of it, or null - * if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the BackupAndExportResponseInner. - */ - public static BackupAndExportResponseInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - BackupAndExportResponseInner deserializedBackupAndExportResponseInner = new BackupAndExportResponseInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedBackupAndExportResponseInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedBackupAndExportResponseInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedBackupAndExportResponseInner.type = reader.getString(); - } else if ("status".equals(fieldName)) { - deserializedBackupAndExportResponseInner.status = OperationStatus.fromString(reader.getString()); - } else if ("startTime".equals(fieldName)) { - deserializedBackupAndExportResponseInner.startTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("endTime".equals(fieldName)) { - deserializedBackupAndExportResponseInner.endTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("percentComplete".equals(fieldName)) { - deserializedBackupAndExportResponseInner.percentComplete - = reader.getNullable(JsonReader::getDouble); - } else if ("properties".equals(fieldName)) { - deserializedBackupAndExportResponseInner.innerProperties - = BackupAndExportResponseProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedBackupAndExportResponseInner.systemData = SystemData.fromJson(reader); - } else if ("error".equals(fieldName)) { - deserializedBackupAndExportResponseInner.error = ManagementError.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedBackupAndExportResponseInner; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/BackupAndExportResponseProperties.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/BackupAndExportResponseProperties.java deleted file mode 100644 index d3a735bc7a4ca..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/BackupAndExportResponseProperties.java +++ /dev/null @@ -1,154 +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.mysqlflexibleserver.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; - -/** - * BackupAndExport Response Properties. - */ -@Fluent -public final class BackupAndExportResponseProperties implements JsonSerializable { - /* - * Size of datasource in bytes - */ - private Long datasourceSizeInBytes; - - /* - * Data transferred in bytes - */ - private Long dataTransferredInBytes; - - /* - * Metadata related to backup to be stored for restoring resource in key-value pairs. - */ - private String backupMetadata; - - /** - * Creates an instance of BackupAndExportResponseProperties class. - */ - public BackupAndExportResponseProperties() { - } - - /** - * Get the datasourceSizeInBytes property: Size of datasource in bytes. - * - * @return the datasourceSizeInBytes value. - */ - public Long datasourceSizeInBytes() { - return this.datasourceSizeInBytes; - } - - /** - * Set the datasourceSizeInBytes property: Size of datasource in bytes. - * - * @param datasourceSizeInBytes the datasourceSizeInBytes value to set. - * @return the BackupAndExportResponseProperties object itself. - */ - public BackupAndExportResponseProperties withDatasourceSizeInBytes(Long datasourceSizeInBytes) { - this.datasourceSizeInBytes = datasourceSizeInBytes; - return this; - } - - /** - * Get the dataTransferredInBytes property: Data transferred in bytes. - * - * @return the dataTransferredInBytes value. - */ - public Long dataTransferredInBytes() { - return this.dataTransferredInBytes; - } - - /** - * Set the dataTransferredInBytes property: Data transferred in bytes. - * - * @param dataTransferredInBytes the dataTransferredInBytes value to set. - * @return the BackupAndExportResponseProperties object itself. - */ - public BackupAndExportResponseProperties withDataTransferredInBytes(Long dataTransferredInBytes) { - this.dataTransferredInBytes = dataTransferredInBytes; - return this; - } - - /** - * Get the backupMetadata property: Metadata related to backup to be stored for restoring resource in key-value - * pairs. - * - * @return the backupMetadata value. - */ - public String backupMetadata() { - return this.backupMetadata; - } - - /** - * Set the backupMetadata property: Metadata related to backup to be stored for restoring resource in key-value - * pairs. - * - * @param backupMetadata the backupMetadata value to set. - * @return the BackupAndExportResponseProperties object itself. - */ - public BackupAndExportResponseProperties withBackupMetadata(String backupMetadata) { - this.backupMetadata = backupMetadata; - return this; - } - - /** - * Validates the instance. - * - * @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("datasourceSizeInBytes", this.datasourceSizeInBytes); - jsonWriter.writeNumberField("dataTransferredInBytes", this.dataTransferredInBytes); - jsonWriter.writeStringField("backupMetadata", this.backupMetadata); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of BackupAndExportResponseProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of BackupAndExportResponseProperties if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the BackupAndExportResponseProperties. - */ - public static BackupAndExportResponseProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - BackupAndExportResponseProperties deserializedBackupAndExportResponseProperties - = new BackupAndExportResponseProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("datasourceSizeInBytes".equals(fieldName)) { - deserializedBackupAndExportResponseProperties.datasourceSizeInBytes - = reader.getNullable(JsonReader::getLong); - } else if ("dataTransferredInBytes".equals(fieldName)) { - deserializedBackupAndExportResponseProperties.dataTransferredInBytes - = reader.getNullable(JsonReader::getLong); - } else if ("backupMetadata".equals(fieldName)) { - deserializedBackupAndExportResponseProperties.backupMetadata = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedBackupAndExportResponseProperties; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/CapabilityInner.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/CapabilityInner.java deleted file mode 100644 index 867fdbaf4ccbb..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/CapabilityInner.java +++ /dev/null @@ -1,184 +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.mysqlflexibleserver.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.mysqlflexibleserver.models.ServerEditionCapabilityV2; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerVersionCapabilityV2; -import java.io.IOException; -import java.util.List; - -/** - * Represents a location capability set. - */ -@Immutable -public final class CapabilityInner extends ProxyResource { - /* - * The properties of a location capability set. - */ - private CapabilityPropertiesV2 innerProperties; - - /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - */ - private SystemData systemData; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of CapabilityInner class. - */ - public CapabilityInner() { - } - - /** - * Get the innerProperties property: The properties of a location capability set. - * - * @return the innerProperties value. - */ - private CapabilityPropertiesV2 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 type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * Get the supportedGeoBackupRegions property: supported geo backup regions. - * - * @return the supportedGeoBackupRegions value. - */ - public List supportedGeoBackupRegions() { - return this.innerProperties() == null ? null : this.innerProperties().supportedGeoBackupRegions(); - } - - /** - * Get the supportedFlexibleServerEditions property: A list of supported flexible server editions. - * - * @return the supportedFlexibleServerEditions value. - */ - public List supportedFlexibleServerEditions() { - return this.innerProperties() == null ? null : this.innerProperties().supportedFlexibleServerEditions(); - } - - /** - * Get the supportedServerVersions property: A list of supported server versions. - * - * @return the supportedServerVersions value. - */ - public List supportedServerVersions() { - return this.innerProperties() == null ? null : this.innerProperties().supportedServerVersions(); - } - - /** - * 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 CapabilityInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CapabilityInner if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the CapabilityInner. - */ - public static CapabilityInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CapabilityInner deserializedCapabilityInner = new CapabilityInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedCapabilityInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedCapabilityInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedCapabilityInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedCapabilityInner.innerProperties = CapabilityPropertiesV2.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedCapabilityInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedCapabilityInner; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/CapabilityPropertiesV2.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/CapabilityPropertiesV2.java deleted file mode 100644 index b4294d627a748..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/CapabilityPropertiesV2.java +++ /dev/null @@ -1,128 +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.mysqlflexibleserver.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.mysqlflexibleserver.models.ServerEditionCapabilityV2; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerVersionCapabilityV2; -import java.io.IOException; -import java.util.List; - -/** - * Location capability. - */ -@Immutable -public final class CapabilityPropertiesV2 implements JsonSerializable { - /* - * supported geo backup regions - */ - private List supportedGeoBackupRegions; - - /* - * A list of supported flexible server editions. - */ - private List supportedFlexibleServerEditions; - - /* - * A list of supported server versions. - */ - private List supportedServerVersions; - - /** - * Creates an instance of CapabilityPropertiesV2 class. - */ - public CapabilityPropertiesV2() { - } - - /** - * Get the supportedGeoBackupRegions property: supported geo backup regions. - * - * @return the supportedGeoBackupRegions value. - */ - public List supportedGeoBackupRegions() { - return this.supportedGeoBackupRegions; - } - - /** - * Get the supportedFlexibleServerEditions property: A list of supported flexible server editions. - * - * @return the supportedFlexibleServerEditions value. - */ - public List supportedFlexibleServerEditions() { - return this.supportedFlexibleServerEditions; - } - - /** - * Get the supportedServerVersions property: A list of supported server versions. - * - * @return the supportedServerVersions value. - */ - public List supportedServerVersions() { - return this.supportedServerVersions; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (supportedFlexibleServerEditions() != null) { - supportedFlexibleServerEditions().forEach(e -> e.validate()); - } - if (supportedServerVersions() != null) { - supportedServerVersions().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CapabilityPropertiesV2 from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CapabilityPropertiesV2 if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IOException If an error occurs while reading the CapabilityPropertiesV2. - */ - public static CapabilityPropertiesV2 fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CapabilityPropertiesV2 deserializedCapabilityPropertiesV2 = new CapabilityPropertiesV2(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("supportedGeoBackupRegions".equals(fieldName)) { - List supportedGeoBackupRegions = reader.readArray(reader1 -> reader1.getString()); - deserializedCapabilityPropertiesV2.supportedGeoBackupRegions = supportedGeoBackupRegions; - } else if ("supportedFlexibleServerEditions".equals(fieldName)) { - List supportedFlexibleServerEditions - = reader.readArray(reader1 -> ServerEditionCapabilityV2.fromJson(reader1)); - deserializedCapabilityPropertiesV2.supportedFlexibleServerEditions - = supportedFlexibleServerEditions; - } else if ("supportedServerVersions".equals(fieldName)) { - List supportedServerVersions - = reader.readArray(reader1 -> ServerVersionCapabilityV2.fromJson(reader1)); - deserializedCapabilityPropertiesV2.supportedServerVersions = supportedServerVersions; - } else { - reader.skipChildren(); - } - } - - return deserializedCapabilityPropertiesV2; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ConfigurationInner.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ConfigurationInner.java index 7ab7fa162144b..abffbd42f30fd 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ConfigurationInner.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ConfigurationInner.java @@ -27,7 +27,7 @@ public final class ConfigurationInner extends ProxyResource { private ConfigurationProperties innerProperties; /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. + * The system metadata relating to this resource. */ private SystemData systemData; @@ -62,7 +62,7 @@ private ConfigurationProperties innerProperties() { } /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * Get the systemData property: The system metadata relating to this resource. * * @return the systemData value. */ @@ -123,29 +123,6 @@ public ConfigurationInner withValue(String value) { return this; } - /** - * Get the currentValue property: Current value of the configuration. - * - * @return the currentValue value. - */ - public String currentValue() { - return this.innerProperties() == null ? null : this.innerProperties().currentValue(); - } - - /** - * Set the currentValue property: Current value of the configuration. - * - * @param currentValue the currentValue value to set. - * @return the ConfigurationInner object itself. - */ - public ConfigurationInner withCurrentValue(String currentValue) { - if (this.innerProperties() == null) { - this.innerProperties = new ConfigurationProperties(); - } - this.innerProperties().withCurrentValue(currentValue); - return this; - } - /** * Get the description property: Description of the configuration. * @@ -155,15 +132,6 @@ public String description() { return this.innerProperties() == null ? null : this.innerProperties().description(); } - /** - * Get the documentationLink property: The link used to get the document from community or Azure site. - * - * @return the documentationLink value. - */ - public String documentationLink() { - return this.innerProperties() == null ? null : this.innerProperties().documentationLink(); - } - /** * Get the defaultValue property: Default value of the configuration. * diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ConfigurationProperties.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ConfigurationProperties.java index d97d297328c09..8c29eaa6b1861 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ConfigurationProperties.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ConfigurationProperties.java @@ -25,21 +25,11 @@ public final class ConfigurationProperties implements JsonSerializable { - /* - * Estimated seconds of downtime for the deployment. - */ - private Integer estimatedDowntime; - - /* - * Scheduled Availability zone of the standby server. - */ - private String scheduledStandbyAvailabilityZone; - - /* - * Expected Availability zone of the standby server. - */ - private String expectedStandbyAvailabilityZone; - - /** - * Creates an instance of HighAvailabilityValidationEstimationInner class. - */ - public HighAvailabilityValidationEstimationInner() { - } - - /** - * Get the estimatedDowntime property: Estimated seconds of downtime for the deployment. - * - * @return the estimatedDowntime value. - */ - public Integer estimatedDowntime() { - return this.estimatedDowntime; - } - - /** - * Get the scheduledStandbyAvailabilityZone property: Scheduled Availability zone of the standby server. - * - * @return the scheduledStandbyAvailabilityZone value. - */ - public String scheduledStandbyAvailabilityZone() { - return this.scheduledStandbyAvailabilityZone; - } - - /** - * Get the expectedStandbyAvailabilityZone property: Expected Availability zone of the standby server. - * - * @return the expectedStandbyAvailabilityZone value. - */ - public String expectedStandbyAvailabilityZone() { - return this.expectedStandbyAvailabilityZone; - } - - /** - * Set the expectedStandbyAvailabilityZone property: Expected Availability zone of the standby server. - * - * @param expectedStandbyAvailabilityZone the expectedStandbyAvailabilityZone value to set. - * @return the HighAvailabilityValidationEstimationInner object itself. - */ - public HighAvailabilityValidationEstimationInner - withExpectedStandbyAvailabilityZone(String expectedStandbyAvailabilityZone) { - this.expectedStandbyAvailabilityZone = expectedStandbyAvailabilityZone; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("expectedStandbyAvailabilityZone", this.expectedStandbyAvailabilityZone); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of HighAvailabilityValidationEstimationInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of HighAvailabilityValidationEstimationInner if the JsonReader was pointing to an instance of - * it, or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the HighAvailabilityValidationEstimationInner. - */ - public static HighAvailabilityValidationEstimationInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - HighAvailabilityValidationEstimationInner deserializedHighAvailabilityValidationEstimationInner - = new HighAvailabilityValidationEstimationInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("estimatedDowntime".equals(fieldName)) { - deserializedHighAvailabilityValidationEstimationInner.estimatedDowntime - = reader.getNullable(JsonReader::getInt); - } else if ("scheduledStandbyAvailabilityZone".equals(fieldName)) { - deserializedHighAvailabilityValidationEstimationInner.scheduledStandbyAvailabilityZone - = reader.getString(); - } else if ("expectedStandbyAvailabilityZone".equals(fieldName)) { - deserializedHighAvailabilityValidationEstimationInner.expectedStandbyAvailabilityZone - = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedHighAvailabilityValidationEstimationInner; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/LogFileInner.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/LogFileInner.java deleted file mode 100644 index bd0e3d3cbeeb5..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/LogFileInner.java +++ /dev/null @@ -1,270 +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.mysqlflexibleserver.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.time.OffsetDateTime; - -/** - * Represents a logFile. - */ -@Fluent -public final class LogFileInner extends ProxyResource { - /* - * The properties of a logFile. - */ - private LogFileProperties innerProperties; - - /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - */ - private SystemData systemData; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of LogFileInner class. - */ - public LogFileInner() { - } - - /** - * Get the innerProperties property: The properties of a logFile. - * - * @return the innerProperties value. - */ - private LogFileProperties 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 type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * Get the sizeInKB property: The size in kb of the logFile. - * - * @return the sizeInKB value. - */ - public Long sizeInKB() { - return this.innerProperties() == null ? null : this.innerProperties().sizeInKB(); - } - - /** - * Set the sizeInKB property: The size in kb of the logFile. - * - * @param sizeInKB the sizeInKB value to set. - * @return the LogFileInner object itself. - */ - public LogFileInner withSizeInKB(Long sizeInKB) { - if (this.innerProperties() == null) { - this.innerProperties = new LogFileProperties(); - } - this.innerProperties().withSizeInKB(sizeInKB); - return this; - } - - /** - * Get the createdTime property: Creation timestamp of the log file. - * - * @return the createdTime value. - */ - public OffsetDateTime createdTime() { - return this.innerProperties() == null ? null : this.innerProperties().createdTime(); - } - - /** - * Set the createdTime property: Creation timestamp of the log file. - * - * @param createdTime the createdTime value to set. - * @return the LogFileInner object itself. - */ - public LogFileInner withCreatedTime(OffsetDateTime createdTime) { - if (this.innerProperties() == null) { - this.innerProperties = new LogFileProperties(); - } - this.innerProperties().withCreatedTime(createdTime); - return this; - } - - /** - * Get the type property: Type of the log file. - * - * @return the type value. - */ - public String typePropertiesType() { - return this.innerProperties() == null ? null : this.innerProperties().type(); - } - - /** - * Set the type property: Type of the log file. - * - * @param type the type value to set. - * @return the LogFileInner object itself. - */ - public LogFileInner withTypePropertiesType(String type) { - if (this.innerProperties() == null) { - this.innerProperties = new LogFileProperties(); - } - this.innerProperties().withType(type); - return this; - } - - /** - * Get the lastModifiedTime property: Last modified timestamp of the log file. - * - * @return the lastModifiedTime value. - */ - public OffsetDateTime lastModifiedTime() { - return this.innerProperties() == null ? null : this.innerProperties().lastModifiedTime(); - } - - /** - * Set the lastModifiedTime property: Last modified timestamp of the log file. - * - * @param lastModifiedTime the lastModifiedTime value to set. - * @return the LogFileInner object itself. - */ - public LogFileInner withLastModifiedTime(OffsetDateTime lastModifiedTime) { - if (this.innerProperties() == null) { - this.innerProperties = new LogFileProperties(); - } - this.innerProperties().withLastModifiedTime(lastModifiedTime); - return this; - } - - /** - * Get the url property: The url to download the log file from. - * - * @return the url value. - */ - public String url() { - return this.innerProperties() == null ? null : this.innerProperties().url(); - } - - /** - * Set the url property: The url to download the log file from. - * - * @param url the url value to set. - * @return the LogFileInner object itself. - */ - public LogFileInner withUrl(String url) { - if (this.innerProperties() == null) { - this.innerProperties = new LogFileProperties(); - } - this.innerProperties().withUrl(url); - 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 LogFileInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of LogFileInner if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the LogFileInner. - */ - public static LogFileInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - LogFileInner deserializedLogFileInner = new LogFileInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedLogFileInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedLogFileInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedLogFileInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedLogFileInner.innerProperties = LogFileProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedLogFileInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedLogFileInner; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/LogFileProperties.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/LogFileProperties.java deleted file mode 100644 index 4662c7bdf953d..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/LogFileProperties.java +++ /dev/null @@ -1,214 +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.mysqlflexibleserver.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 java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; - -/** - * The properties of a logFile. - */ -@Fluent -public final class LogFileProperties implements JsonSerializable { - /* - * The size in kb of the logFile. - */ - private Long sizeInKB; - - /* - * Creation timestamp of the log file. - */ - private OffsetDateTime createdTime; - - /* - * Type of the log file. - */ - private String type; - - /* - * Last modified timestamp of the log file. - */ - private OffsetDateTime lastModifiedTime; - - /* - * The url to download the log file from. - */ - private String url; - - /** - * Creates an instance of LogFileProperties class. - */ - public LogFileProperties() { - } - - /** - * Get the sizeInKB property: The size in kb of the logFile. - * - * @return the sizeInKB value. - */ - public Long sizeInKB() { - return this.sizeInKB; - } - - /** - * Set the sizeInKB property: The size in kb of the logFile. - * - * @param sizeInKB the sizeInKB value to set. - * @return the LogFileProperties object itself. - */ - public LogFileProperties withSizeInKB(Long sizeInKB) { - this.sizeInKB = sizeInKB; - return this; - } - - /** - * Get the createdTime property: Creation timestamp of the log file. - * - * @return the createdTime value. - */ - public OffsetDateTime createdTime() { - return this.createdTime; - } - - /** - * Set the createdTime property: Creation timestamp of the log file. - * - * @param createdTime the createdTime value to set. - * @return the LogFileProperties object itself. - */ - public LogFileProperties withCreatedTime(OffsetDateTime createdTime) { - this.createdTime = createdTime; - return this; - } - - /** - * Get the type property: Type of the log file. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Set the type property: Type of the log file. - * - * @param type the type value to set. - * @return the LogFileProperties object itself. - */ - public LogFileProperties withType(String type) { - this.type = type; - return this; - } - - /** - * Get the lastModifiedTime property: Last modified timestamp of the log file. - * - * @return the lastModifiedTime value. - */ - public OffsetDateTime lastModifiedTime() { - return this.lastModifiedTime; - } - - /** - * Set the lastModifiedTime property: Last modified timestamp of the log file. - * - * @param lastModifiedTime the lastModifiedTime value to set. - * @return the LogFileProperties object itself. - */ - public LogFileProperties withLastModifiedTime(OffsetDateTime lastModifiedTime) { - this.lastModifiedTime = lastModifiedTime; - return this; - } - - /** - * Get the url property: The url to download the log file from. - * - * @return the url value. - */ - public String url() { - return this.url; - } - - /** - * Set the url property: The url to download the log file from. - * - * @param url the url value to set. - * @return the LogFileProperties object itself. - */ - public LogFileProperties withUrl(String url) { - this.url = url; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeNumberField("sizeInKB", this.sizeInKB); - jsonWriter.writeStringField("createdTime", - this.createdTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdTime)); - jsonWriter.writeStringField("type", this.type); - jsonWriter.writeStringField("lastModifiedTime", - this.lastModifiedTime == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastModifiedTime)); - jsonWriter.writeStringField("url", this.url); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of LogFileProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of LogFileProperties if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the LogFileProperties. - */ - public static LogFileProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - LogFileProperties deserializedLogFileProperties = new LogFileProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("sizeInKB".equals(fieldName)) { - deserializedLogFileProperties.sizeInKB = reader.getNullable(JsonReader::getLong); - } else if ("createdTime".equals(fieldName)) { - deserializedLogFileProperties.createdTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("type".equals(fieldName)) { - deserializedLogFileProperties.type = reader.getString(); - } else if ("lastModifiedTime".equals(fieldName)) { - deserializedLogFileProperties.lastModifiedTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("url".equals(fieldName)) { - deserializedLogFileProperties.url = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedLogFileProperties; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/MaintenanceInner.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/MaintenanceInner.java deleted file mode 100644 index cb6eaf3474e2e..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/MaintenanceInner.java +++ /dev/null @@ -1,278 +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.mysqlflexibleserver.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.core.util.logging.ClientLogger; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceProvisioningState; -import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceState; -import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceType; -import java.io.IOException; -import java.time.OffsetDateTime; - -/** - * Represents a maintenance. - */ -@Fluent -public final class MaintenanceInner extends ProxyResource { - /* - * The properties of a maintenance - */ - private MaintenanceProperties innerProperties = new MaintenanceProperties(); - - /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - */ - private SystemData systemData; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of MaintenanceInner class. - */ - public MaintenanceInner() { - } - - /** - * Get the innerProperties property: The properties of a maintenance. - * - * @return the innerProperties value. - */ - private MaintenanceProperties 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 type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * Get the maintenanceType property: A string defines maintenance type. - * - * @return the maintenanceType value. - */ - public MaintenanceType maintenanceType() { - return this.innerProperties() == null ? null : this.innerProperties().maintenanceType(); - } - - /** - * Get the maintenanceState property: A string describes the maintenance status. - * - * @return the maintenanceState value. - */ - public MaintenanceState maintenanceState() { - return this.innerProperties() == null ? null : this.innerProperties().maintenanceState(); - } - - /** - * Get the maintenanceStartTime property: The start time for a maintenance. - * - * @return the maintenanceStartTime value. - */ - public OffsetDateTime maintenanceStartTime() { - return this.innerProperties() == null ? null : this.innerProperties().maintenanceStartTime(); - } - - /** - * Set the maintenanceStartTime property: The start time for a maintenance. - * - * @param maintenanceStartTime the maintenanceStartTime value to set. - * @return the MaintenanceInner object itself. - */ - public MaintenanceInner withMaintenanceStartTime(OffsetDateTime maintenanceStartTime) { - if (this.innerProperties() == null) { - this.innerProperties = new MaintenanceProperties(); - } - this.innerProperties().withMaintenanceStartTime(maintenanceStartTime); - return this; - } - - /** - * Get the maintenanceEndTime property: The end time for a maintenance. - * - * @return the maintenanceEndTime value. - */ - public OffsetDateTime maintenanceEndTime() { - return this.innerProperties() == null ? null : this.innerProperties().maintenanceEndTime(); - } - - /** - * Get the maintenanceExecutionStartTime property: The start time for a maintenance execution. - * - * @return the maintenanceExecutionStartTime value. - */ - public OffsetDateTime maintenanceExecutionStartTime() { - return this.innerProperties() == null ? null : this.innerProperties().maintenanceExecutionStartTime(); - } - - /** - * Get the maintenanceExecutionEndTime property: The end time for a maintenance execution. - * - * @return the maintenanceExecutionEndTime value. - */ - public OffsetDateTime maintenanceExecutionEndTime() { - return this.innerProperties() == null ? null : this.innerProperties().maintenanceExecutionEndTime(); - } - - /** - * Get the maintenanceAvailableScheduleMinTime property: The min time the maintenance can be rescheduled. - * - * @return the maintenanceAvailableScheduleMinTime value. - */ - public OffsetDateTime maintenanceAvailableScheduleMinTime() { - return this.innerProperties() == null ? null : this.innerProperties().maintenanceAvailableScheduleMinTime(); - } - - /** - * Get the maintenanceAvailableScheduleMaxTime property: The max time the maintenance can be rescheduled. - * - * @return the maintenanceAvailableScheduleMaxTime value. - */ - public OffsetDateTime maintenanceAvailableScheduleMaxTime() { - return this.innerProperties() == null ? null : this.innerProperties().maintenanceAvailableScheduleMaxTime(); - } - - /** - * Get the maintenanceTitle property: The maintenance title. - * - * @return the maintenanceTitle value. - */ - public String maintenanceTitle() { - return this.innerProperties() == null ? null : this.innerProperties().maintenanceTitle(); - } - - /** - * Get the maintenanceDescription property: The maintenance description. - * - * @return the maintenanceDescription value. - */ - public String maintenanceDescription() { - return this.innerProperties() == null ? null : this.innerProperties().maintenanceDescription(); - } - - /** - * Get the provisioningState property: Provisioning state of the Maintenance. - * - * @return the provisioningState value. - */ - public MaintenanceProvisioningState 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) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property innerProperties in model MaintenanceInner")); - } else { - innerProperties().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(MaintenanceInner.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of MaintenanceInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of MaintenanceInner if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the MaintenanceInner. - */ - public static MaintenanceInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - MaintenanceInner deserializedMaintenanceInner = new MaintenanceInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedMaintenanceInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedMaintenanceInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedMaintenanceInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedMaintenanceInner.innerProperties = MaintenanceProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedMaintenanceInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedMaintenanceInner; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/MaintenanceProperties.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/MaintenanceProperties.java deleted file mode 100644 index 995c7d7d4ce39..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/MaintenanceProperties.java +++ /dev/null @@ -1,270 +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.mysqlflexibleserver.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.mysqlflexibleserver.models.MaintenanceProvisioningState; -import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceState; -import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceType; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; - -/** - * The properties of a maintenance resource. - */ -@Fluent -public final class MaintenanceProperties implements JsonSerializable { - /* - * A string defines maintenance type. - */ - private MaintenanceType maintenanceType; - - /* - * A string describes the maintenance status - */ - private MaintenanceState maintenanceState; - - /* - * The start time for a maintenance. - */ - private OffsetDateTime maintenanceStartTime; - - /* - * The end time for a maintenance. - */ - private OffsetDateTime maintenanceEndTime; - - /* - * The start time for a maintenance execution. - */ - private OffsetDateTime maintenanceExecutionStartTime; - - /* - * The end time for a maintenance execution. - */ - private OffsetDateTime maintenanceExecutionEndTime; - - /* - * The min time the maintenance can be rescheduled. - */ - private OffsetDateTime maintenanceAvailableScheduleMinTime; - - /* - * The max time the maintenance can be rescheduled. - */ - private OffsetDateTime maintenanceAvailableScheduleMaxTime; - - /* - * The maintenance title. - */ - private String maintenanceTitle; - - /* - * The maintenance description. - */ - private String maintenanceDescription; - - /* - * Provisioning state of the Maintenance. - */ - private MaintenanceProvisioningState provisioningState; - - /** - * Creates an instance of MaintenanceProperties class. - */ - public MaintenanceProperties() { - } - - /** - * Get the maintenanceType property: A string defines maintenance type. - * - * @return the maintenanceType value. - */ - public MaintenanceType maintenanceType() { - return this.maintenanceType; - } - - /** - * Get the maintenanceState property: A string describes the maintenance status. - * - * @return the maintenanceState value. - */ - public MaintenanceState maintenanceState() { - return this.maintenanceState; - } - - /** - * Get the maintenanceStartTime property: The start time for a maintenance. - * - * @return the maintenanceStartTime value. - */ - public OffsetDateTime maintenanceStartTime() { - return this.maintenanceStartTime; - } - - /** - * Set the maintenanceStartTime property: The start time for a maintenance. - * - * @param maintenanceStartTime the maintenanceStartTime value to set. - * @return the MaintenanceProperties object itself. - */ - public MaintenanceProperties withMaintenanceStartTime(OffsetDateTime maintenanceStartTime) { - this.maintenanceStartTime = maintenanceStartTime; - return this; - } - - /** - * Get the maintenanceEndTime property: The end time for a maintenance. - * - * @return the maintenanceEndTime value. - */ - public OffsetDateTime maintenanceEndTime() { - return this.maintenanceEndTime; - } - - /** - * Get the maintenanceExecutionStartTime property: The start time for a maintenance execution. - * - * @return the maintenanceExecutionStartTime value. - */ - public OffsetDateTime maintenanceExecutionStartTime() { - return this.maintenanceExecutionStartTime; - } - - /** - * Get the maintenanceExecutionEndTime property: The end time for a maintenance execution. - * - * @return the maintenanceExecutionEndTime value. - */ - public OffsetDateTime maintenanceExecutionEndTime() { - return this.maintenanceExecutionEndTime; - } - - /** - * Get the maintenanceAvailableScheduleMinTime property: The min time the maintenance can be rescheduled. - * - * @return the maintenanceAvailableScheduleMinTime value. - */ - public OffsetDateTime maintenanceAvailableScheduleMinTime() { - return this.maintenanceAvailableScheduleMinTime; - } - - /** - * Get the maintenanceAvailableScheduleMaxTime property: The max time the maintenance can be rescheduled. - * - * @return the maintenanceAvailableScheduleMaxTime value. - */ - public OffsetDateTime maintenanceAvailableScheduleMaxTime() { - return this.maintenanceAvailableScheduleMaxTime; - } - - /** - * Get the maintenanceTitle property: The maintenance title. - * - * @return the maintenanceTitle value. - */ - public String maintenanceTitle() { - return this.maintenanceTitle; - } - - /** - * Get the maintenanceDescription property: The maintenance description. - * - * @return the maintenanceDescription value. - */ - public String maintenanceDescription() { - return this.maintenanceDescription; - } - - /** - * Get the provisioningState property: Provisioning state of the Maintenance. - * - * @return the provisioningState value. - */ - public MaintenanceProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("maintenanceStartTime", - this.maintenanceStartTime == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.maintenanceStartTime)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of MaintenanceProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of MaintenanceProperties if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IOException If an error occurs while reading the MaintenanceProperties. - */ - public static MaintenanceProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - MaintenanceProperties deserializedMaintenanceProperties = new MaintenanceProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("maintenanceType".equals(fieldName)) { - deserializedMaintenanceProperties.maintenanceType = MaintenanceType.fromString(reader.getString()); - } else if ("maintenanceState".equals(fieldName)) { - deserializedMaintenanceProperties.maintenanceState - = MaintenanceState.fromString(reader.getString()); - } else if ("maintenanceStartTime".equals(fieldName)) { - deserializedMaintenanceProperties.maintenanceStartTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("maintenanceEndTime".equals(fieldName)) { - deserializedMaintenanceProperties.maintenanceEndTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("maintenanceExecutionStartTime".equals(fieldName)) { - deserializedMaintenanceProperties.maintenanceExecutionStartTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("maintenanceExecutionEndTime".equals(fieldName)) { - deserializedMaintenanceProperties.maintenanceExecutionEndTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("maintenanceAvailableScheduleMinTime".equals(fieldName)) { - deserializedMaintenanceProperties.maintenanceAvailableScheduleMinTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("maintenanceAvailableScheduleMaxTime".equals(fieldName)) { - deserializedMaintenanceProperties.maintenanceAvailableScheduleMaxTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("maintenanceTitle".equals(fieldName)) { - deserializedMaintenanceProperties.maintenanceTitle = reader.getString(); - } else if ("maintenanceDescription".equals(fieldName)) { - deserializedMaintenanceProperties.maintenanceDescription = reader.getString(); - } else if ("provisioningState".equals(fieldName)) { - deserializedMaintenanceProperties.provisioningState - = MaintenanceProvisioningState.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedMaintenanceProperties; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/MaintenancePropertiesForUpdate.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/MaintenancePropertiesForUpdate.java deleted file mode 100644 index 70c63230412db..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/MaintenancePropertiesForUpdate.java +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.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 java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; - -/** - * The properties of a maintenance update parameter. - */ -@Fluent -public final class MaintenancePropertiesForUpdate implements JsonSerializable { - /* - * The start time for a maintenance. - */ - private OffsetDateTime maintenanceStartTime; - - /** - * Creates an instance of MaintenancePropertiesForUpdate class. - */ - public MaintenancePropertiesForUpdate() { - } - - /** - * Get the maintenanceStartTime property: The start time for a maintenance. - * - * @return the maintenanceStartTime value. - */ - public OffsetDateTime maintenanceStartTime() { - return this.maintenanceStartTime; - } - - /** - * Set the maintenanceStartTime property: The start time for a maintenance. - * - * @param maintenanceStartTime the maintenanceStartTime value to set. - * @return the MaintenancePropertiesForUpdate object itself. - */ - public MaintenancePropertiesForUpdate withMaintenanceStartTime(OffsetDateTime maintenanceStartTime) { - this.maintenanceStartTime = maintenanceStartTime; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("maintenanceStartTime", - this.maintenanceStartTime == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.maintenanceStartTime)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of MaintenancePropertiesForUpdate from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of MaintenancePropertiesForUpdate if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the MaintenancePropertiesForUpdate. - */ - public static MaintenancePropertiesForUpdate fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - MaintenancePropertiesForUpdate deserializedMaintenancePropertiesForUpdate - = new MaintenancePropertiesForUpdate(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("maintenanceStartTime".equals(fieldName)) { - deserializedMaintenancePropertiesForUpdate.maintenanceStartTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else { - reader.skipChildren(); - } - } - - return deserializedMaintenancePropertiesForUpdate; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/OperationProgressResultInner.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/OperationProgressResultInner.java deleted file mode 100644 index 5792530f69875..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/OperationProgressResultInner.java +++ /dev/null @@ -1,237 +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.mysqlflexibleserver.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.exception.ManagementError; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.logging.ClientLogger; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.mysqlflexibleserver.models.OperationProgressResponseType; -import com.azure.resourcemanager.mysqlflexibleserver.models.OperationStatusResult; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.List; - -/** - * Represents Operation Results API Response. - */ -@Fluent -public final class OperationProgressResultInner extends OperationStatusResult { - /* - * The response properties specific to the operation - */ - private OperationProgressResponseType properties; - - /* - * Fully qualified ID of the resource against which the original async operation was started. - */ - private String resourceId; - - /** - * Creates an instance of OperationProgressResultInner class. - */ - public OperationProgressResultInner() { - } - - /** - * Get the properties property: The response properties specific to the operation. - * - * @return the properties value. - */ - public OperationProgressResponseType properties() { - return this.properties; - } - - /** - * Set the properties property: The response properties specific to the operation. - * - * @param properties the properties value to set. - * @return the OperationProgressResultInner object itself. - */ - public OperationProgressResultInner withProperties(OperationProgressResponseType properties) { - this.properties = properties; - return this; - } - - /** - * Get the resourceId property: Fully qualified ID of the resource against which the original async operation was - * started. - * - * @return the resourceId value. - */ - @Override - public String resourceId() { - return this.resourceId; - } - - /** - * {@inheritDoc} - */ - @Override - public OperationProgressResultInner withId(String id) { - super.withId(id); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public OperationProgressResultInner withName(String name) { - super.withName(name); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public OperationProgressResultInner withStatus(String status) { - super.withStatus(status); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public OperationProgressResultInner withPercentComplete(Float percentComplete) { - super.withPercentComplete(percentComplete); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public OperationProgressResultInner withStartTime(OffsetDateTime startTime) { - super.withStartTime(startTime); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public OperationProgressResultInner withEndTime(OffsetDateTime endTime) { - super.withEndTime(endTime); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public OperationProgressResultInner withOperations(List operations) { - super.withOperations(operations); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public OperationProgressResultInner withError(ManagementError error) { - super.withError(error); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (properties() != null) { - properties().validate(); - } - if (status() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property status in model OperationProgressResultInner")); - } - if (operations() != null) { - operations().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(OperationProgressResultInner.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("status", status()); - jsonWriter.writeStringField("id", id()); - jsonWriter.writeStringField("name", name()); - jsonWriter.writeNumberField("percentComplete", percentComplete()); - jsonWriter.writeStringField("startTime", - startTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(startTime())); - jsonWriter.writeStringField("endTime", - endTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(endTime())); - jsonWriter.writeArrayField("operations", operations(), (writer, element) -> writer.writeJson(element)); - jsonWriter.writeJsonField("error", error()); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of OperationProgressResultInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of OperationProgressResultInner if the JsonReader was pointing to an instance of it, or null - * if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the OperationProgressResultInner. - */ - public static OperationProgressResultInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - OperationProgressResultInner deserializedOperationProgressResultInner = new OperationProgressResultInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("status".equals(fieldName)) { - deserializedOperationProgressResultInner.withStatus(reader.getString()); - } else if ("id".equals(fieldName)) { - deserializedOperationProgressResultInner.withId(reader.getString()); - } else if ("resourceId".equals(fieldName)) { - deserializedOperationProgressResultInner.resourceId = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedOperationProgressResultInner.withName(reader.getString()); - } else if ("percentComplete".equals(fieldName)) { - deserializedOperationProgressResultInner - .withPercentComplete(reader.getNullable(JsonReader::getFloat)); - } else if ("startTime".equals(fieldName)) { - deserializedOperationProgressResultInner.withStartTime(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("endTime".equals(fieldName)) { - deserializedOperationProgressResultInner.withEndTime(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("operations".equals(fieldName)) { - List operations - = reader.readArray(reader1 -> OperationStatusResult.fromJson(reader1)); - deserializedOperationProgressResultInner.withOperations(operations); - } else if ("error".equals(fieldName)) { - deserializedOperationProgressResultInner.withError(ManagementError.fromJson(reader)); - } else if ("properties".equals(fieldName)) { - deserializedOperationProgressResultInner.properties - = OperationProgressResponseType.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedOperationProgressResultInner; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/OperationStatusExtendedResultInner.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/OperationStatusExtendedResultInner.java deleted file mode 100644 index 788cc02e22185..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/OperationStatusExtendedResultInner.java +++ /dev/null @@ -1,235 +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.mysqlflexibleserver.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.exception.ManagementError; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.logging.ClientLogger; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.mysqlflexibleserver.models.OperationStatusResult; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.List; -import java.util.Map; - -/** - * Represents Operation Results API Response. - */ -@Fluent -public final class OperationStatusExtendedResultInner extends OperationStatusResult { - /* - * The extended properties of Operation Results - */ - private Map properties; - - /* - * Fully qualified ID of the resource against which the original async operation was started. - */ - private String resourceId; - - /** - * Creates an instance of OperationStatusExtendedResultInner class. - */ - public OperationStatusExtendedResultInner() { - } - - /** - * Get the properties property: The extended properties of Operation Results. - * - * @return the properties value. - */ - public Map properties() { - return this.properties; - } - - /** - * Set the properties property: The extended properties of Operation Results. - * - * @param properties the properties value to set. - * @return the OperationStatusExtendedResultInner object itself. - */ - public OperationStatusExtendedResultInner withProperties(Map properties) { - this.properties = properties; - return this; - } - - /** - * Get the resourceId property: Fully qualified ID of the resource against which the original async operation was - * started. - * - * @return the resourceId value. - */ - @Override - public String resourceId() { - return this.resourceId; - } - - /** - * {@inheritDoc} - */ - @Override - public OperationStatusExtendedResultInner withId(String id) { - super.withId(id); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public OperationStatusExtendedResultInner withName(String name) { - super.withName(name); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public OperationStatusExtendedResultInner withStatus(String status) { - super.withStatus(status); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public OperationStatusExtendedResultInner withPercentComplete(Float percentComplete) { - super.withPercentComplete(percentComplete); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public OperationStatusExtendedResultInner withStartTime(OffsetDateTime startTime) { - super.withStartTime(startTime); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public OperationStatusExtendedResultInner withEndTime(OffsetDateTime endTime) { - super.withEndTime(endTime); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public OperationStatusExtendedResultInner withOperations(List operations) { - super.withOperations(operations); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public OperationStatusExtendedResultInner withError(ManagementError error) { - super.withError(error); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (status() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property status in model OperationStatusExtendedResultInner")); - } - if (operations() != null) { - operations().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(OperationStatusExtendedResultInner.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("status", status()); - jsonWriter.writeStringField("id", id()); - jsonWriter.writeStringField("name", name()); - jsonWriter.writeNumberField("percentComplete", percentComplete()); - jsonWriter.writeStringField("startTime", - startTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(startTime())); - jsonWriter.writeStringField("endTime", - endTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(endTime())); - jsonWriter.writeArrayField("operations", operations(), (writer, element) -> writer.writeJson(element)); - jsonWriter.writeJsonField("error", error()); - jsonWriter.writeMapField("properties", this.properties, (writer, element) -> writer.writeUntyped(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of OperationStatusExtendedResultInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of OperationStatusExtendedResultInner if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the OperationStatusExtendedResultInner. - */ - public static OperationStatusExtendedResultInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - OperationStatusExtendedResultInner deserializedOperationStatusExtendedResultInner - = new OperationStatusExtendedResultInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("status".equals(fieldName)) { - deserializedOperationStatusExtendedResultInner.withStatus(reader.getString()); - } else if ("id".equals(fieldName)) { - deserializedOperationStatusExtendedResultInner.withId(reader.getString()); - } else if ("resourceId".equals(fieldName)) { - deserializedOperationStatusExtendedResultInner.resourceId = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedOperationStatusExtendedResultInner.withName(reader.getString()); - } else if ("percentComplete".equals(fieldName)) { - deserializedOperationStatusExtendedResultInner - .withPercentComplete(reader.getNullable(JsonReader::getFloat)); - } else if ("startTime".equals(fieldName)) { - deserializedOperationStatusExtendedResultInner.withStartTime(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("endTime".equals(fieldName)) { - deserializedOperationStatusExtendedResultInner.withEndTime(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("operations".equals(fieldName)) { - List operations - = reader.readArray(reader1 -> OperationStatusResult.fromJson(reader1)); - deserializedOperationStatusExtendedResultInner.withOperations(operations); - } else if ("error".equals(fieldName)) { - deserializedOperationStatusExtendedResultInner.withError(ManagementError.fromJson(reader)); - } else if ("properties".equals(fieldName)) { - Map properties = reader.readMap(reader1 -> reader1.readUntyped()); - deserializedOperationStatusExtendedResultInner.properties = properties; - } else { - reader.skipChildren(); - } - } - - return deserializedOperationStatusExtendedResultInner; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/PrivateEndpointConnectionProperties.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/PrivateEndpointConnectionProperties.java deleted file mode 100644 index 19ddbfdc2a73c..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/PrivateEndpointConnectionProperties.java +++ /dev/null @@ -1,179 +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.mysqlflexibleserver.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.mysqlflexibleserver.models.PrivateEndpoint; -import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpointConnectionProvisioningState; -import com.azure.resourcemanager.mysqlflexibleserver.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 private endpoint resource. - */ - 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 private endpoint resource. - * - * @return the privateEndpoint value. - */ - public PrivateEndpoint privateEndpoint() { - return this.privateEndpoint; - } - - /** - * Set the privateEndpoint property: The private endpoint resource. - * - * @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/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerBackupInner.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerBackupInner.java index 9a9bfd57250a3..fb2bcb081b039 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerBackupInner.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerBackupInner.java @@ -24,7 +24,7 @@ public final class ServerBackupInner extends ProxyResource { private ServerBackupProperties innerProperties; /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. + * The system metadata relating to this resource. */ private SystemData systemData; @@ -59,7 +59,7 @@ private ServerBackupProperties innerProperties() { } /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * Get the systemData property: The system metadata relating to this resource. * * @return the systemData value. */ diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerBackupPropertiesV2.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerBackupPropertiesV2.java deleted file mode 100644 index 7b6cc175c67c7..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerBackupPropertiesV2.java +++ /dev/null @@ -1,201 +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.mysqlflexibleserver.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.mysqlflexibleserver.models.BackupType; -import com.azure.resourcemanager.mysqlflexibleserver.models.ProvisioningState; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; - -/** - * The properties of a server backup. - */ -@Fluent -public final class ServerBackupPropertiesV2 implements JsonSerializable { - /* - * Backup name - */ - private String backupNameV2; - - /* - * The backupType property. - */ - private BackupType backupType; - - /* - * Backup completed time (ISO8601 format). - */ - private OffsetDateTime completedTime; - - /* - * Backup source - */ - private String source; - - /* - * The provisioning state of backup resource. - */ - private ProvisioningState provisioningState; - - /** - * Creates an instance of ServerBackupPropertiesV2 class. - */ - public ServerBackupPropertiesV2() { - } - - /** - * Get the backupNameV2 property: Backup name. - * - * @return the backupNameV2 value. - */ - public String backupNameV2() { - return this.backupNameV2; - } - - /** - * Set the backupNameV2 property: Backup name. - * - * @param backupNameV2 the backupNameV2 value to set. - * @return the ServerBackupPropertiesV2 object itself. - */ - public ServerBackupPropertiesV2 withBackupNameV2(String backupNameV2) { - this.backupNameV2 = backupNameV2; - return this; - } - - /** - * Get the backupType property: The backupType property. - * - * @return the backupType value. - */ - public BackupType backupType() { - return this.backupType; - } - - /** - * Set the backupType property: The backupType property. - * - * @param backupType the backupType value to set. - * @return the ServerBackupPropertiesV2 object itself. - */ - public ServerBackupPropertiesV2 withBackupType(BackupType backupType) { - this.backupType = backupType; - return this; - } - - /** - * Get the completedTime property: Backup completed time (ISO8601 format). - * - * @return the completedTime value. - */ - public OffsetDateTime completedTime() { - return this.completedTime; - } - - /** - * Set the completedTime property: Backup completed time (ISO8601 format). - * - * @param completedTime the completedTime value to set. - * @return the ServerBackupPropertiesV2 object itself. - */ - public ServerBackupPropertiesV2 withCompletedTime(OffsetDateTime completedTime) { - this.completedTime = completedTime; - return this; - } - - /** - * Get the source property: Backup source. - * - * @return the source value. - */ - public String source() { - return this.source; - } - - /** - * Set the source property: Backup source. - * - * @param source the source value to set. - * @return the ServerBackupPropertiesV2 object itself. - */ - public ServerBackupPropertiesV2 withSource(String source) { - this.source = source; - return this; - } - - /** - * Get the provisioningState property: The provisioning state of backup resource. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("backupNameV2", this.backupNameV2); - jsonWriter.writeStringField("backupType", this.backupType == null ? null : this.backupType.toString()); - jsonWriter.writeStringField("completedTime", - this.completedTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.completedTime)); - jsonWriter.writeStringField("source", this.source); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ServerBackupPropertiesV2 from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ServerBackupPropertiesV2 if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IOException If an error occurs while reading the ServerBackupPropertiesV2. - */ - public static ServerBackupPropertiesV2 fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ServerBackupPropertiesV2 deserializedServerBackupPropertiesV2 = new ServerBackupPropertiesV2(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("backupNameV2".equals(fieldName)) { - deserializedServerBackupPropertiesV2.backupNameV2 = reader.getString(); - } else if ("backupType".equals(fieldName)) { - deserializedServerBackupPropertiesV2.backupType = BackupType.fromString(reader.getString()); - } else if ("completedTime".equals(fieldName)) { - deserializedServerBackupPropertiesV2.completedTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("source".equals(fieldName)) { - deserializedServerBackupPropertiesV2.source = reader.getString(); - } else if ("provisioningState".equals(fieldName)) { - deserializedServerBackupPropertiesV2.provisioningState - = ProvisioningState.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedServerBackupPropertiesV2; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerBackupV2Inner.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerBackupV2Inner.java deleted file mode 100644 index e916cd8a708c2..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerBackupV2Inner.java +++ /dev/null @@ -1,258 +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.mysqlflexibleserver.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.mysqlflexibleserver.models.BackupType; -import com.azure.resourcemanager.mysqlflexibleserver.models.ProvisioningState; -import java.io.IOException; -import java.time.OffsetDateTime; - -/** - * Server backup properties. - */ -@Fluent -public final class ServerBackupV2Inner extends ProxyResource { - /* - * The properties of a server backup. - */ - private ServerBackupPropertiesV2 innerProperties; - - /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - */ - private SystemData systemData; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of ServerBackupV2Inner class. - */ - public ServerBackupV2Inner() { - } - - /** - * Get the innerProperties property: The properties of a server backup. - * - * @return the innerProperties value. - */ - private ServerBackupPropertiesV2 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 type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * Get the backupNameV2 property: Backup name. - * - * @return the backupNameV2 value. - */ - public String backupNameV2() { - return this.innerProperties() == null ? null : this.innerProperties().backupNameV2(); - } - - /** - * Set the backupNameV2 property: Backup name. - * - * @param backupNameV2 the backupNameV2 value to set. - * @return the ServerBackupV2Inner object itself. - */ - public ServerBackupV2Inner withBackupNameV2(String backupNameV2) { - if (this.innerProperties() == null) { - this.innerProperties = new ServerBackupPropertiesV2(); - } - this.innerProperties().withBackupNameV2(backupNameV2); - return this; - } - - /** - * Get the backupType property: The backupType property. - * - * @return the backupType value. - */ - public BackupType backupType() { - return this.innerProperties() == null ? null : this.innerProperties().backupType(); - } - - /** - * Set the backupType property: The backupType property. - * - * @param backupType the backupType value to set. - * @return the ServerBackupV2Inner object itself. - */ - public ServerBackupV2Inner withBackupType(BackupType backupType) { - if (this.innerProperties() == null) { - this.innerProperties = new ServerBackupPropertiesV2(); - } - this.innerProperties().withBackupType(backupType); - return this; - } - - /** - * Get the completedTime property: Backup completed time (ISO8601 format). - * - * @return the completedTime value. - */ - public OffsetDateTime completedTime() { - return this.innerProperties() == null ? null : this.innerProperties().completedTime(); - } - - /** - * Set the completedTime property: Backup completed time (ISO8601 format). - * - * @param completedTime the completedTime value to set. - * @return the ServerBackupV2Inner object itself. - */ - public ServerBackupV2Inner withCompletedTime(OffsetDateTime completedTime) { - if (this.innerProperties() == null) { - this.innerProperties = new ServerBackupPropertiesV2(); - } - this.innerProperties().withCompletedTime(completedTime); - return this; - } - - /** - * Get the source property: Backup source. - * - * @return the source value. - */ - public String source() { - return this.innerProperties() == null ? null : this.innerProperties().source(); - } - - /** - * Set the source property: Backup source. - * - * @param source the source value to set. - * @return the ServerBackupV2Inner object itself. - */ - public ServerBackupV2Inner withSource(String source) { - if (this.innerProperties() == null) { - this.innerProperties = new ServerBackupPropertiesV2(); - } - this.innerProperties().withSource(source); - return this; - } - - /** - * Get the provisioningState property: The provisioning state of backup resource. - * - * @return the provisioningState value. - */ - public ProvisioningState 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 ServerBackupV2Inner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ServerBackupV2Inner if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the ServerBackupV2Inner. - */ - public static ServerBackupV2Inner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ServerBackupV2Inner deserializedServerBackupV2Inner = new ServerBackupV2Inner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedServerBackupV2Inner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedServerBackupV2Inner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedServerBackupV2Inner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedServerBackupV2Inner.innerProperties = ServerBackupPropertiesV2.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedServerBackupV2Inner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedServerBackupV2Inner; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerInner.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerInner.java index d50518bed3b80..508feeccbf1a2 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerInner.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerInner.java @@ -14,19 +14,16 @@ import com.azure.resourcemanager.mysqlflexibleserver.models.CreateMode; import com.azure.resourcemanager.mysqlflexibleserver.models.DataEncryption; import com.azure.resourcemanager.mysqlflexibleserver.models.HighAvailability; -import com.azure.resourcemanager.mysqlflexibleserver.models.ImportSourceProperties; +import com.azure.resourcemanager.mysqlflexibleserver.models.Identity; import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceWindow; -import com.azure.resourcemanager.mysqlflexibleserver.models.MySqlServerIdentity; -import com.azure.resourcemanager.mysqlflexibleserver.models.MySqlServerSku; import com.azure.resourcemanager.mysqlflexibleserver.models.Network; -import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpointConnection; import com.azure.resourcemanager.mysqlflexibleserver.models.ReplicationRole; import com.azure.resourcemanager.mysqlflexibleserver.models.ServerState; import com.azure.resourcemanager.mysqlflexibleserver.models.ServerVersion; +import com.azure.resourcemanager.mysqlflexibleserver.models.Sku; import com.azure.resourcemanager.mysqlflexibleserver.models.Storage; import java.io.IOException; import java.time.OffsetDateTime; -import java.util.List; import java.util.Map; /** @@ -37,12 +34,12 @@ public final class ServerInner extends Resource { /* * The cmk identity for the server. */ - private MySqlServerIdentity identity; + private Identity identity; /* * The SKU (pricing tier) of the server. */ - private MySqlServerSku sku; + private Sku sku; /* * Properties of the server. @@ -50,7 +47,7 @@ public final class ServerInner extends Resource { private ServerProperties innerProperties; /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. + * The system metadata relating to this resource. */ private SystemData systemData; @@ -80,7 +77,7 @@ public ServerInner() { * * @return the identity value. */ - public MySqlServerIdentity identity() { + public Identity identity() { return this.identity; } @@ -90,7 +87,7 @@ public MySqlServerIdentity identity() { * @param identity the identity value to set. * @return the ServerInner object itself. */ - public ServerInner withIdentity(MySqlServerIdentity identity) { + public ServerInner withIdentity(Identity identity) { this.identity = identity; return this; } @@ -100,7 +97,7 @@ public ServerInner withIdentity(MySqlServerIdentity identity) { * * @return the sku value. */ - public MySqlServerSku sku() { + public Sku sku() { return this.sku; } @@ -110,7 +107,7 @@ public MySqlServerSku sku() { * @param sku the sku value to set. * @return the ServerInner object itself. */ - public ServerInner withSku(MySqlServerSku sku) { + public ServerInner withSku(Sku sku) { this.sku = sku; return this; } @@ -125,7 +122,7 @@ private ServerProperties innerProperties() { } /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * Get the systemData property: The system metadata relating to this resource. * * @return the systemData value. */ @@ -513,15 +510,6 @@ public ServerInner withNetwork(Network network) { return this; } - /** - * Get the privateEndpointConnections property: PrivateEndpointConnections related properties of a server. - * - * @return the privateEndpointConnections value. - */ - public List privateEndpointConnections() { - return this.innerProperties() == null ? null : this.innerProperties().privateEndpointConnections(); - } - /** * Get the maintenanceWindow property: Maintenance window of a server. * @@ -545,29 +533,6 @@ public ServerInner withMaintenanceWindow(MaintenanceWindow maintenanceWindow) { return this; } - /** - * Get the importSourceProperties property: Source properties for import from storage. - * - * @return the importSourceProperties value. - */ - public ImportSourceProperties importSourceProperties() { - return this.innerProperties() == null ? null : this.innerProperties().importSourceProperties(); - } - - /** - * Set the importSourceProperties property: Source properties for import from storage. - * - * @param importSourceProperties the importSourceProperties value to set. - * @return the ServerInner object itself. - */ - public ServerInner withImportSourceProperties(ImportSourceProperties importSourceProperties) { - if (this.innerProperties() == null) { - this.innerProperties = new ServerProperties(); - } - this.innerProperties().withImportSourceProperties(importSourceProperties); - return this; - } - /** * Validates the instance. * @@ -627,9 +592,9 @@ public static ServerInner fromJson(JsonReader jsonReader) throws IOException { Map tags = reader.readMap(reader1 -> reader1.getString()); deserializedServerInner.withTags(tags); } else if ("identity".equals(fieldName)) { - deserializedServerInner.identity = MySqlServerIdentity.fromJson(reader); + deserializedServerInner.identity = Identity.fromJson(reader); } else if ("sku".equals(fieldName)) { - deserializedServerInner.sku = MySqlServerSku.fromJson(reader); + deserializedServerInner.sku = Sku.fromJson(reader); } else if ("properties".equals(fieldName)) { deserializedServerInner.innerProperties = ServerProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerProperties.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerProperties.java index 04d68b4f983e2..6dd62aff6100f 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerProperties.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerProperties.java @@ -14,10 +14,8 @@ import com.azure.resourcemanager.mysqlflexibleserver.models.CreateMode; import com.azure.resourcemanager.mysqlflexibleserver.models.DataEncryption; import com.azure.resourcemanager.mysqlflexibleserver.models.HighAvailability; -import com.azure.resourcemanager.mysqlflexibleserver.models.ImportSourceProperties; import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceWindow; import com.azure.resourcemanager.mysqlflexibleserver.models.Network; -import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpointConnection; import com.azure.resourcemanager.mysqlflexibleserver.models.ReplicationRole; import com.azure.resourcemanager.mysqlflexibleserver.models.ServerState; import com.azure.resourcemanager.mysqlflexibleserver.models.ServerVersion; @@ -25,7 +23,6 @@ import java.io.IOException; import java.time.OffsetDateTime; import java.time.format.DateTimeFormatter; -import java.util.List; /** * The properties of a server. @@ -113,21 +110,11 @@ public final class ServerProperties implements JsonSerializable privateEndpointConnections; - /* * Maintenance window of a server. */ private MaintenanceWindow maintenanceWindow; - /* - * Source properties for import from storage. - */ - private ImportSourceProperties importSourceProperties; - /** * Creates an instance of ServerProperties class. */ @@ -427,15 +414,6 @@ public ServerProperties withNetwork(Network network) { return this; } - /** - * Get the privateEndpointConnections property: PrivateEndpointConnections related properties of a server. - * - * @return the privateEndpointConnections value. - */ - public List privateEndpointConnections() { - return this.privateEndpointConnections; - } - /** * Get the maintenanceWindow property: Maintenance window of a server. * @@ -456,26 +434,6 @@ public ServerProperties withMaintenanceWindow(MaintenanceWindow maintenanceWindo return this; } - /** - * Get the importSourceProperties property: Source properties for import from storage. - * - * @return the importSourceProperties value. - */ - public ImportSourceProperties importSourceProperties() { - return this.importSourceProperties; - } - - /** - * Set the importSourceProperties property: Source properties for import from storage. - * - * @param importSourceProperties the importSourceProperties value to set. - * @return the ServerProperties object itself. - */ - public ServerProperties withImportSourceProperties(ImportSourceProperties importSourceProperties) { - this.importSourceProperties = importSourceProperties; - return this; - } - /** * Validates the instance. * @@ -497,15 +455,9 @@ public void validate() { if (network() != null) { network().validate(); } - if (privateEndpointConnections() != null) { - privateEndpointConnections().forEach(e -> e.validate()); - } if (maintenanceWindow() != null) { maintenanceWindow().validate(); } - if (importSourceProperties() != null) { - importSourceProperties().validate(); - } } /** @@ -532,7 +484,6 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeJsonField("highAvailability", this.highAvailability); jsonWriter.writeJsonField("network", this.network); jsonWriter.writeJsonField("maintenanceWindow", this.maintenanceWindow); - jsonWriter.writeJsonField("importSourceProperties", this.importSourceProperties); return jsonWriter.writeEndObject(); } @@ -584,14 +535,8 @@ public static ServerProperties fromJson(JsonReader jsonReader) throws IOExceptio deserializedServerProperties.highAvailability = HighAvailability.fromJson(reader); } else if ("network".equals(fieldName)) { deserializedServerProperties.network = Network.fromJson(reader); - } else if ("privateEndpointConnections".equals(fieldName)) { - List privateEndpointConnections - = reader.readArray(reader1 -> PrivateEndpointConnection.fromJson(reader1)); - deserializedServerProperties.privateEndpointConnections = privateEndpointConnections; } else if ("maintenanceWindow".equals(fieldName)) { deserializedServerProperties.maintenanceWindow = MaintenanceWindow.fromJson(reader); - } else if ("importSourceProperties".equals(fieldName)) { - deserializedServerProperties.importSourceProperties = ImportSourceProperties.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerPropertiesForUpdate.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerPropertiesForUpdate.java index 49dddaa9514e8..e4db5bc6ca0e3 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerPropertiesForUpdate.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ServerPropertiesForUpdate.java @@ -13,9 +13,7 @@ import com.azure.resourcemanager.mysqlflexibleserver.models.DataEncryption; import com.azure.resourcemanager.mysqlflexibleserver.models.HighAvailability; import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceWindow; -import com.azure.resourcemanager.mysqlflexibleserver.models.Network; import com.azure.resourcemanager.mysqlflexibleserver.models.ReplicationRole; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerVersion; import com.azure.resourcemanager.mysqlflexibleserver.models.Storage; import java.io.IOException; @@ -29,11 +27,6 @@ public final class ServerPropertiesForUpdate implements JsonSerializable { - /* - * The response properties of a pre backup operation. - */ - private ValidateBackupResponseProperties innerProperties; - - /** - * Creates an instance of ValidateBackupResponseInner class. - */ - public ValidateBackupResponseInner() { - } - - /** - * Get the innerProperties property: The response properties of a pre backup operation. - * - * @return the innerProperties value. - */ - private ValidateBackupResponseProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the numberOfContainers property: Estimated no of storage containers required for resource data to be backed - * up. - * - * @return the numberOfContainers value. - */ - public Integer numberOfContainers() { - return this.innerProperties() == null ? null : this.innerProperties().numberOfContainers(); - } - - /** - * Set the numberOfContainers property: Estimated no of storage containers required for resource data to be backed - * up. - * - * @param numberOfContainers the numberOfContainers value to set. - * @return the ValidateBackupResponseInner object itself. - */ - public ValidateBackupResponseInner withNumberOfContainers(Integer numberOfContainers) { - if (this.innerProperties() == null) { - this.innerProperties = new ValidateBackupResponseProperties(); - } - this.innerProperties().withNumberOfContainers(numberOfContainers); - 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 ValidateBackupResponseInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ValidateBackupResponseInner if the JsonReader was pointing to an instance of it, or null - * if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the ValidateBackupResponseInner. - */ - public static ValidateBackupResponseInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ValidateBackupResponseInner deserializedValidateBackupResponseInner = new ValidateBackupResponseInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("properties".equals(fieldName)) { - deserializedValidateBackupResponseInner.innerProperties - = ValidateBackupResponseProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedValidateBackupResponseInner; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ValidateBackupResponseProperties.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ValidateBackupResponseProperties.java deleted file mode 100644 index a09825eb03a74..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/fluent/models/ValidateBackupResponseProperties.java +++ /dev/null @@ -1,97 +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.mysqlflexibleserver.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; - -/** - * ValidateBackup Response Properties. - */ -@Fluent -public final class ValidateBackupResponseProperties implements JsonSerializable { - /* - * Estimated no of storage containers required for resource data to be backed up. - */ - private Integer numberOfContainers; - - /** - * Creates an instance of ValidateBackupResponseProperties class. - */ - public ValidateBackupResponseProperties() { - } - - /** - * Get the numberOfContainers property: Estimated no of storage containers required for resource data to be backed - * up. - * - * @return the numberOfContainers value. - */ - public Integer numberOfContainers() { - return this.numberOfContainers; - } - - /** - * Set the numberOfContainers property: Estimated no of storage containers required for resource data to be backed - * up. - * - * @param numberOfContainers the numberOfContainers value to set. - * @return the ValidateBackupResponseProperties object itself. - */ - public ValidateBackupResponseProperties withNumberOfContainers(Integer numberOfContainers) { - this.numberOfContainers = numberOfContainers; - return this; - } - - /** - * Validates the instance. - * - * @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("numberOfContainers", this.numberOfContainers); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ValidateBackupResponseProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ValidateBackupResponseProperties if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the ValidateBackupResponseProperties. - */ - public static ValidateBackupResponseProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ValidateBackupResponseProperties deserializedValidateBackupResponseProperties - = new ValidateBackupResponseProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("numberOfContainers".equals(fieldName)) { - deserializedValidateBackupResponseProperties.numberOfContainers - = reader.getNullable(JsonReader::getInt); - } else { - reader.skipChildren(); - } - } - - return deserializedValidateBackupResponseProperties; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AdvancedThreatProtectionImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AdvancedThreatProtectionImpl.java deleted file mode 100644 index f16ea1cbff87f..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AdvancedThreatProtectionImpl.java +++ /dev/null @@ -1,60 +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.mysqlflexibleserver.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AdvancedThreatProtectionInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtection; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionProvisioningState; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionState; -import java.time.OffsetDateTime; - -public final class AdvancedThreatProtectionImpl implements AdvancedThreatProtection { - private AdvancedThreatProtectionInner innerObject; - - private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; - - AdvancedThreatProtectionImpl(AdvancedThreatProtectionInner innerObject, - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager 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 OffsetDateTime creationTime() { - return this.innerModel().creationTime(); - } - - public AdvancedThreatProtectionState state() { - return this.innerModel().state(); - } - - public AdvancedThreatProtectionProvisioningState provisioningState() { - return this.innerModel().provisioningState(); - } - - public AdvancedThreatProtectionInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AdvancedThreatProtectionSettingsClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AdvancedThreatProtectionSettingsClientImpl.java deleted file mode 100644 index 851a980aec005..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AdvancedThreatProtectionSettingsClientImpl.java +++ /dev/null @@ -1,990 +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.mysqlflexibleserver.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.AdvancedThreatProtectionSettingsClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AdvancedThreatProtectionInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionForUpdate; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionListResult; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionName; -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 AdvancedThreatProtectionSettingsClient. - */ -public final class AdvancedThreatProtectionSettingsClientImpl implements AdvancedThreatProtectionSettingsClient { - /** - * The proxy service used to perform REST calls. - */ - private final AdvancedThreatProtectionSettingsService service; - - /** - * The service client containing this operation class. - */ - private final MySqlManagementClientImpl client; - - /** - * Initializes an instance of AdvancedThreatProtectionSettingsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - AdvancedThreatProtectionSettingsClientImpl(MySqlManagementClientImpl client) { - this.service = RestProxy.create(AdvancedThreatProtectionSettingsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MySqlManagementClientAdvancedThreatProtectionSettings to be used by - * the proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MySqlManagementClien") - public interface AdvancedThreatProtectionSettingsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, - @PathParam("advancedThreatProtectionName") AdvancedThreatProtectionName advancedThreatProtectionName, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, - @PathParam("advancedThreatProtectionName") AdvancedThreatProtectionName advancedThreatProtectionName, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") AdvancedThreatProtectionForUpdate parameters, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}") - @ExpectedResponses({ 200, 201, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> updatePut(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, - @PathParam("advancedThreatProtectionName") AdvancedThreatProtectionName advancedThreatProtectionName, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") AdvancedThreatProtectionInner parameters, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/advancedThreatProtectionSettings") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, - @PathParam("subscriptionId") String subscriptionId, @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); - } - - /** - * Get a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a server's Advanced Threat Protection state along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String serverName, AdvancedThreatProtectionName advancedThreatProtectionName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - if (advancedThreatProtectionName == null) { - return Mono.error( - new IllegalArgumentException("Parameter advancedThreatProtectionName is required 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 apiVersion = "2023-12-30"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, serverName, - advancedThreatProtectionName, this.client.getSubscriptionId(), apiVersion, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a server's Advanced Threat Protection state along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String serverName, AdvancedThreatProtectionName advancedThreatProtectionName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - if (advancedThreatProtectionName == null) { - return Mono.error( - new IllegalArgumentException("Parameter advancedThreatProtectionName is required 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 apiVersion = "2023-12-30"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), resourceGroupName, serverName, advancedThreatProtectionName, - this.client.getSubscriptionId(), apiVersion, accept, context); - } - - /** - * Get a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a server's Advanced Threat Protection state on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String serverName, - AdvancedThreatProtectionName advancedThreatProtectionName) { - return getWithResponseAsync(resourceGroupName, serverName, advancedThreatProtectionName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a server's Advanced Threat Protection state along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String serverName, - AdvancedThreatProtectionName advancedThreatProtectionName, Context context) { - return getWithResponseAsync(resourceGroupName, serverName, advancedThreatProtectionName, context).block(); - } - - /** - * Get a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a server's Advanced Threat Protection state. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AdvancedThreatProtectionInner get(String resourceGroupName, String serverName, - AdvancedThreatProtectionName advancedThreatProtectionName) { - return getWithResponse(resourceGroupName, serverName, advancedThreatProtectionName, Context.NONE).getValue(); - } - - /** - * Updates a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param parameters The server's Advanced Threat Protection body to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a server's Advanced Threat Protection along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, String serverName, - AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionForUpdate parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - if (advancedThreatProtectionName == null) { - return Mono.error( - new IllegalArgumentException("Parameter advancedThreatProtectionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2023-12-30"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), resourceGroupName, serverName, - advancedThreatProtectionName, this.client.getSubscriptionId(), apiVersion, parameters, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param parameters The server's Advanced Threat Protection body to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a server's Advanced Threat Protection along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, String serverName, - AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionForUpdate parameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - if (advancedThreatProtectionName == null) { - return Mono.error( - new IllegalArgumentException("Parameter advancedThreatProtectionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2023-12-30"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), resourceGroupName, serverName, advancedThreatProtectionName, - this.client.getSubscriptionId(), apiVersion, parameters, accept, context); - } - - /** - * Updates a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param parameters The server's Advanced Threat Protection body to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of a server's Advanced Threat Protection. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, AdvancedThreatProtectionInner> beginUpdateAsync( - String resourceGroupName, String serverName, AdvancedThreatProtectionName advancedThreatProtectionName, - AdvancedThreatProtectionForUpdate parameters) { - Mono>> mono - = updateWithResponseAsync(resourceGroupName, serverName, advancedThreatProtectionName, parameters); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), AdvancedThreatProtectionInner.class, AdvancedThreatProtectionInner.class, - this.client.getContext()); - } - - /** - * Updates a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param parameters The server's Advanced Threat Protection body to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of a server's Advanced Threat Protection. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, AdvancedThreatProtectionInner> beginUpdateAsync( - String resourceGroupName, String serverName, AdvancedThreatProtectionName advancedThreatProtectionName, - AdvancedThreatProtectionForUpdate parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = updateWithResponseAsync(resourceGroupName, serverName, advancedThreatProtectionName, parameters, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), AdvancedThreatProtectionInner.class, AdvancedThreatProtectionInner.class, - context); - } - - /** - * Updates a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param parameters The server's Advanced Threat Protection body to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of a server's Advanced Threat Protection. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, AdvancedThreatProtectionInner> beginUpdate( - String resourceGroupName, String serverName, AdvancedThreatProtectionName advancedThreatProtectionName, - AdvancedThreatProtectionForUpdate parameters) { - return this.beginUpdateAsync(resourceGroupName, serverName, advancedThreatProtectionName, parameters) - .getSyncPoller(); - } - - /** - * Updates a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param parameters The server's Advanced Threat Protection body to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of a server's Advanced Threat Protection. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, AdvancedThreatProtectionInner> beginUpdate( - String resourceGroupName, String serverName, AdvancedThreatProtectionName advancedThreatProtectionName, - AdvancedThreatProtectionForUpdate parameters, Context context) { - return this.beginUpdateAsync(resourceGroupName, serverName, advancedThreatProtectionName, parameters, context) - .getSyncPoller(); - } - - /** - * Updates a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param parameters The server's Advanced Threat Protection body to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a server's Advanced Threat Protection on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String serverName, - AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionForUpdate parameters) { - return beginUpdateAsync(resourceGroupName, serverName, advancedThreatProtectionName, parameters).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param parameters The server's Advanced Threat Protection body to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a server's Advanced Threat Protection on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String serverName, - AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionForUpdate parameters, - Context context) { - return beginUpdateAsync(resourceGroupName, serverName, advancedThreatProtectionName, parameters, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param parameters The server's Advanced Threat Protection body to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a server's Advanced Threat Protection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AdvancedThreatProtectionInner update(String resourceGroupName, String serverName, - AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionForUpdate parameters) { - return updateAsync(resourceGroupName, serverName, advancedThreatProtectionName, parameters).block(); - } - - /** - * Updates a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param parameters The server's Advanced Threat Protection body to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a server's Advanced Threat Protection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AdvancedThreatProtectionInner update(String resourceGroupName, String serverName, - AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionForUpdate parameters, - Context context) { - return updateAsync(resourceGroupName, serverName, advancedThreatProtectionName, parameters, context).block(); - } - - /** - * Updates a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param parameters The server's Advanced Threat Protection body to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a server's Advanced Threat Protection along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updatePutWithResponseAsync(String resourceGroupName, String serverName, - AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - if (advancedThreatProtectionName == null) { - return Mono.error( - new IllegalArgumentException("Parameter advancedThreatProtectionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2023-12-30"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.updatePut(this.client.getEndpoint(), resourceGroupName, serverName, - advancedThreatProtectionName, this.client.getSubscriptionId(), apiVersion, parameters, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param parameters The server's Advanced Threat Protection body to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a server's Advanced Threat Protection along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updatePutWithResponseAsync(String resourceGroupName, String serverName, - AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionInner parameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - if (advancedThreatProtectionName == null) { - return Mono.error( - new IllegalArgumentException("Parameter advancedThreatProtectionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2023-12-30"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.updatePut(this.client.getEndpoint(), resourceGroupName, serverName, advancedThreatProtectionName, - this.client.getSubscriptionId(), apiVersion, parameters, accept, context); - } - - /** - * Updates a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param parameters The server's Advanced Threat Protection body to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of a server's Advanced Threat Protection. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, AdvancedThreatProtectionInner> beginUpdatePutAsync( - String resourceGroupName, String serverName, AdvancedThreatProtectionName advancedThreatProtectionName, - AdvancedThreatProtectionInner parameters) { - Mono>> mono - = updatePutWithResponseAsync(resourceGroupName, serverName, advancedThreatProtectionName, parameters); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), AdvancedThreatProtectionInner.class, AdvancedThreatProtectionInner.class, - this.client.getContext()); - } - - /** - * Updates a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param parameters The server's Advanced Threat Protection body to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of a server's Advanced Threat Protection. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, AdvancedThreatProtectionInner> beginUpdatePutAsync( - String resourceGroupName, String serverName, AdvancedThreatProtectionName advancedThreatProtectionName, - AdvancedThreatProtectionInner parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = updatePutWithResponseAsync(resourceGroupName, serverName, - advancedThreatProtectionName, parameters, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), AdvancedThreatProtectionInner.class, AdvancedThreatProtectionInner.class, - context); - } - - /** - * Updates a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param parameters The server's Advanced Threat Protection body to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of a server's Advanced Threat Protection. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, AdvancedThreatProtectionInner> beginUpdatePut( - String resourceGroupName, String serverName, AdvancedThreatProtectionName advancedThreatProtectionName, - AdvancedThreatProtectionInner parameters) { - return this.beginUpdatePutAsync(resourceGroupName, serverName, advancedThreatProtectionName, parameters) - .getSyncPoller(); - } - - /** - * Updates a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param parameters The server's Advanced Threat Protection body to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of a server's Advanced Threat Protection. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, AdvancedThreatProtectionInner> beginUpdatePut( - String resourceGroupName, String serverName, AdvancedThreatProtectionName advancedThreatProtectionName, - AdvancedThreatProtectionInner parameters, Context context) { - return this - .beginUpdatePutAsync(resourceGroupName, serverName, advancedThreatProtectionName, parameters, context) - .getSyncPoller(); - } - - /** - * Updates a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param parameters The server's Advanced Threat Protection body to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a server's Advanced Threat Protection on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updatePutAsync(String resourceGroupName, String serverName, - AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionInner parameters) { - return beginUpdatePutAsync(resourceGroupName, serverName, advancedThreatProtectionName, parameters).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param parameters The server's Advanced Threat Protection body to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a server's Advanced Threat Protection on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updatePutAsync(String resourceGroupName, String serverName, - AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionInner parameters, - Context context) { - return beginUpdatePutAsync(resourceGroupName, serverName, advancedThreatProtectionName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param parameters The server's Advanced Threat Protection body to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a server's Advanced Threat Protection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AdvancedThreatProtectionInner updatePut(String resourceGroupName, String serverName, - AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionInner parameters) { - return updatePutAsync(resourceGroupName, serverName, advancedThreatProtectionName, parameters).block(); - } - - /** - * Updates a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param parameters The server's Advanced Threat Protection body to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a server's Advanced Threat Protection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AdvancedThreatProtectionInner updatePut(String resourceGroupName, String serverName, - AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionInner parameters, - Context context) { - return updatePutAsync(resourceGroupName, serverName, advancedThreatProtectionName, parameters, context).block(); - } - - /** - * Gets a list of server's Advanced Threat Protection states. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 server's Advanced Threat Protection states along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String serverName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required 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 apiVersion = "2023-12-30"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), resourceGroupName, serverName, - this.client.getSubscriptionId(), apiVersion, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list of server's Advanced Threat Protection states. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 server's Advanced Threat Protection states along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String serverName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required 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 apiVersion = "2023-12-30"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), resourceGroupName, serverName, this.client.getSubscriptionId(), apiVersion, - accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Gets a list of server's Advanced Threat Protection states. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 server's Advanced Threat Protection states as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String serverName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, serverName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets a list of server's Advanced Threat Protection states. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 server's Advanced Threat Protection states as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String serverName, - Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, serverName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets a list of server's Advanced Threat Protection states. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 server's Advanced Threat Protection states as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String serverName) { - return new PagedIterable<>(listAsync(resourceGroupName, serverName)); - } - - /** - * Gets a list of server's Advanced Threat Protection states. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 server's Advanced Threat Protection states as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String serverName, - Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, serverName, 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 the server's Advanced Threat Protection configurations 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 the server's Advanced Threat Protection configurations 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/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AdvancedThreatProtectionSettingsImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AdvancedThreatProtectionSettingsImpl.java deleted file mode 100644 index 7a90939f638c8..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AdvancedThreatProtectionSettingsImpl.java +++ /dev/null @@ -1,119 +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.mysqlflexibleserver.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.mysqlflexibleserver.fluent.AdvancedThreatProtectionSettingsClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AdvancedThreatProtectionInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtection; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionForUpdate; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionName; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionSettings; - -public final class AdvancedThreatProtectionSettingsImpl implements AdvancedThreatProtectionSettings { - private static final ClientLogger LOGGER = new ClientLogger(AdvancedThreatProtectionSettingsImpl.class); - - private final AdvancedThreatProtectionSettingsClient innerClient; - - private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; - - public AdvancedThreatProtectionSettingsImpl(AdvancedThreatProtectionSettingsClient innerClient, - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceGroupName, String serverName, - AdvancedThreatProtectionName advancedThreatProtectionName, Context context) { - Response inner = this.serviceClient() - .getWithResponse(resourceGroupName, serverName, advancedThreatProtectionName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AdvancedThreatProtectionImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public AdvancedThreatProtection get(String resourceGroupName, String serverName, - AdvancedThreatProtectionName advancedThreatProtectionName) { - AdvancedThreatProtectionInner inner - = this.serviceClient().get(resourceGroupName, serverName, advancedThreatProtectionName); - if (inner != null) { - return new AdvancedThreatProtectionImpl(inner, this.manager()); - } else { - return null; - } - } - - public AdvancedThreatProtection update(String resourceGroupName, String serverName, - AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionForUpdate parameters) { - AdvancedThreatProtectionInner inner - = this.serviceClient().update(resourceGroupName, serverName, advancedThreatProtectionName, parameters); - if (inner != null) { - return new AdvancedThreatProtectionImpl(inner, this.manager()); - } else { - return null; - } - } - - public AdvancedThreatProtection update(String resourceGroupName, String serverName, - AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionForUpdate parameters, - Context context) { - AdvancedThreatProtectionInner inner = this.serviceClient() - .update(resourceGroupName, serverName, advancedThreatProtectionName, parameters, context); - if (inner != null) { - return new AdvancedThreatProtectionImpl(inner, this.manager()); - } else { - return null; - } - } - - public AdvancedThreatProtection updatePut(String resourceGroupName, String serverName, - AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionInner parameters) { - AdvancedThreatProtectionInner inner - = this.serviceClient().updatePut(resourceGroupName, serverName, advancedThreatProtectionName, parameters); - if (inner != null) { - return new AdvancedThreatProtectionImpl(inner, this.manager()); - } else { - return null; - } - } - - public AdvancedThreatProtection updatePut(String resourceGroupName, String serverName, - AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionInner parameters, - Context context) { - AdvancedThreatProtectionInner inner = this.serviceClient() - .updatePut(resourceGroupName, serverName, advancedThreatProtectionName, parameters, context); - if (inner != null) { - return new AdvancedThreatProtectionImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable list(String resourceGroupName, String serverName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, serverName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AdvancedThreatProtectionImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String serverName, Context context) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, serverName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AdvancedThreatProtectionImpl(inner1, this.manager())); - } - - private AdvancedThreatProtectionSettingsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AzureADAdministratorImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AzureADAdministratorImpl.java deleted file mode 100644 index 7bdadb8ff89d1..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AzureADAdministratorImpl.java +++ /dev/null @@ -1,169 +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.mysqlflexibleserver.implementation; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AzureADAdministratorInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorName; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorType; -import com.azure.resourcemanager.mysqlflexibleserver.models.AzureADAdministrator; - -public final class AzureADAdministratorImpl - implements AzureADAdministrator, AzureADAdministrator.Definition, AzureADAdministrator.Update { - private AzureADAdministratorInner innerObject; - - private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager 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 AdministratorType administratorType() { - return this.innerModel().administratorType(); - } - - public String login() { - return this.innerModel().login(); - } - - public String sid() { - return this.innerModel().sid(); - } - - public String tenantId() { - return this.innerModel().tenantId(); - } - - public String identityResourceId() { - return this.innerModel().identityResourceId(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public AzureADAdministratorInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String serverName; - - private AdministratorName administratorName; - - public AzureADAdministratorImpl withExistingFlexibleServer(String resourceGroupName, String serverName) { - this.resourceGroupName = resourceGroupName; - this.serverName = serverName; - return this; - } - - public AzureADAdministrator create() { - this.innerObject = serviceManager.serviceClient() - .getAzureADAdministrators() - .createOrUpdate(resourceGroupName, serverName, administratorName, this.innerModel(), Context.NONE); - return this; - } - - public AzureADAdministrator create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getAzureADAdministrators() - .createOrUpdate(resourceGroupName, serverName, administratorName, this.innerModel(), context); - return this; - } - - AzureADAdministratorImpl(AdministratorName name, - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { - this.innerObject = new AzureADAdministratorInner(); - this.serviceManager = serviceManager; - this.administratorName = name; - } - - public AzureADAdministratorImpl update() { - return this; - } - - public AzureADAdministrator apply() { - this.innerObject = serviceManager.serviceClient() - .getAzureADAdministrators() - .createOrUpdate(resourceGroupName, serverName, administratorName, this.innerModel(), Context.NONE); - return this; - } - - public AzureADAdministrator apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getAzureADAdministrators() - .createOrUpdate(resourceGroupName, serverName, administratorName, this.innerModel(), context); - return this; - } - - AzureADAdministratorImpl(AzureADAdministratorInner innerObject, - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.serverName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "flexibleServers"); - this.administratorName = AdministratorName - .fromString(ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "administrators")); - } - - public AzureADAdministrator refresh() { - this.innerObject = serviceManager.serviceClient() - .getAzureADAdministrators() - .getWithResponse(resourceGroupName, serverName, administratorName, Context.NONE) - .getValue(); - return this; - } - - public AzureADAdministrator refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getAzureADAdministrators() - .getWithResponse(resourceGroupName, serverName, administratorName, context) - .getValue(); - return this; - } - - public AzureADAdministratorImpl withAdministratorType(AdministratorType administratorType) { - this.innerModel().withAdministratorType(administratorType); - return this; - } - - public AzureADAdministratorImpl withLogin(String login) { - this.innerModel().withLogin(login); - return this; - } - - public AzureADAdministratorImpl withSid(String sid) { - this.innerModel().withSid(sid); - return this; - } - - public AzureADAdministratorImpl withTenantId(String tenantId) { - this.innerModel().withTenantId(tenantId); - return this; - } - - public AzureADAdministratorImpl withIdentityResourceId(String identityResourceId) { - this.innerModel().withIdentityResourceId(identityResourceId); - return this; - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AzureADAdministratorsClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AzureADAdministratorsClientImpl.java deleted file mode 100644 index 980f0d89350ed..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AzureADAdministratorsClientImpl.java +++ /dev/null @@ -1,945 +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.mysqlflexibleserver.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.mysqlflexibleserver.fluent.AzureADAdministratorsClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AzureADAdministratorInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorListResult; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorName; -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 AzureADAdministratorsClient. - */ -public final class AzureADAdministratorsClientImpl implements AzureADAdministratorsClient { - /** - * The proxy service used to perform REST calls. - */ - private final AzureADAdministratorsService service; - - /** - * The service client containing this operation class. - */ - private final MySqlManagementClientImpl client; - - /** - * Initializes an instance of AzureADAdministratorsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - AzureADAdministratorsClientImpl(MySqlManagementClientImpl client) { - this.service = RestProxy.create(AzureADAdministratorsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MySqlManagementClientAzureADAdministrators to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MySqlManagementClien") - public interface AzureADAdministratorsService { - @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/administrators/{administratorName}") - @ExpectedResponses({ 200, 201, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, - @PathParam("administratorName") AdministratorName administratorName, - @BodyParam("application/json") AzureADAdministratorInner parameters, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/administrators/{administratorName}") - @ExpectedResponses({ 200, 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, - @PathParam("administratorName") AdministratorName administratorName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/administrators/{administratorName}") - @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("serverName") String serverName, - @PathParam("administratorName") AdministratorName administratorName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/administrators") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByServer(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByServerNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Creates or updates an existing Azure Active Directory administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @param parameters The required parameters for creating or updating an aad administrator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a Administrator along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String serverName, AdministratorName administratorName, AzureADAdministratorInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - if (administratorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter administratorName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2023-06-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, serverName, administratorName, parameters, accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates an existing Azure Active Directory administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @param parameters The required parameters for creating or updating an aad administrator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a Administrator along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String serverName, AdministratorName administratorName, AzureADAdministratorInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - if (administratorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter administratorName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2023-06-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, serverName, administratorName, parameters, accept, context); - } - - /** - * Creates or updates an existing Azure Active Directory administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @param parameters The required parameters for creating or updating an aad administrator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of represents a Administrator. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, AzureADAdministratorInner> beginCreateOrUpdateAsync( - String resourceGroupName, String serverName, AdministratorName administratorName, - AzureADAdministratorInner parameters) { - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, serverName, administratorName, parameters); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), AzureADAdministratorInner.class, AzureADAdministratorInner.class, - this.client.getContext()); - } - - /** - * Creates or updates an existing Azure Active Directory administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @param parameters The required parameters for creating or updating an aad administrator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of represents a Administrator. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, AzureADAdministratorInner> beginCreateOrUpdateAsync( - String resourceGroupName, String serverName, AdministratorName administratorName, - AzureADAdministratorInner parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, serverName, administratorName, parameters, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), AzureADAdministratorInner.class, AzureADAdministratorInner.class, context); - } - - /** - * Creates or updates an existing Azure Active Directory administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @param parameters The required parameters for creating or updating an aad administrator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of represents a Administrator. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, AzureADAdministratorInner> beginCreateOrUpdate( - String resourceGroupName, String serverName, AdministratorName administratorName, - AzureADAdministratorInner parameters) { - return this.beginCreateOrUpdateAsync(resourceGroupName, serverName, administratorName, parameters) - .getSyncPoller(); - } - - /** - * Creates or updates an existing Azure Active Directory administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @param parameters The required parameters for creating or updating an aad administrator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of represents a Administrator. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, AzureADAdministratorInner> beginCreateOrUpdate( - String resourceGroupName, String serverName, AdministratorName administratorName, - AzureADAdministratorInner parameters, Context context) { - return this.beginCreateOrUpdateAsync(resourceGroupName, serverName, administratorName, parameters, context) - .getSyncPoller(); - } - - /** - * Creates or updates an existing Azure Active Directory administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @param parameters The required parameters for creating or updating an aad administrator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a Administrator on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String serverName, - AdministratorName administratorName, AzureADAdministratorInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, serverName, administratorName, parameters).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates an existing Azure Active Directory administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @param parameters The required parameters for creating or updating an aad administrator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a Administrator on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String serverName, - AdministratorName administratorName, AzureADAdministratorInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, serverName, administratorName, parameters, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates an existing Azure Active Directory administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @param parameters The required parameters for creating or updating an aad administrator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a Administrator. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AzureADAdministratorInner createOrUpdate(String resourceGroupName, String serverName, - AdministratorName administratorName, AzureADAdministratorInner parameters) { - return createOrUpdateAsync(resourceGroupName, serverName, administratorName, parameters).block(); - } - - /** - * Creates or updates an existing Azure Active Directory administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @param parameters The required parameters for creating or updating an aad administrator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a Administrator. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AzureADAdministratorInner createOrUpdate(String resourceGroupName, String serverName, - AdministratorName administratorName, AzureADAdministratorInner parameters, Context context) { - return createOrUpdateAsync(resourceGroupName, serverName, administratorName, parameters, context).block(); - } - - /** - * Deletes an Azure AD Administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 serverName, - AdministratorName administratorName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - if (administratorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter administratorName is required and cannot be null.")); - } - final String apiVersion = "2023-06-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, serverName, administratorName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes an Azure AD Administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 serverName, - AdministratorName administratorName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - if (administratorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter administratorName is required and cannot be null.")); - } - final String apiVersion = "2023-06-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - serverName, administratorName, accept, context); - } - - /** - * Deletes an Azure AD Administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is 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 serverName, - AdministratorName administratorName) { - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, serverName, administratorName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Deletes an Azure AD Administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is 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 serverName, - AdministratorName administratorName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, serverName, administratorName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); - } - - /** - * Deletes an Azure AD Administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked 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 serverName, - AdministratorName administratorName) { - return this.beginDeleteAsync(resourceGroupName, serverName, administratorName).getSyncPoller(); - } - - /** - * Deletes an Azure AD Administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked 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 serverName, - AdministratorName administratorName, Context context) { - return this.beginDeleteAsync(resourceGroupName, serverName, administratorName, context).getSyncPoller(); - } - - /** - * Deletes an Azure AD Administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 serverName, AdministratorName administratorName) { - return beginDeleteAsync(resourceGroupName, serverName, administratorName).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes an Azure AD Administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 serverName, AdministratorName administratorName, - Context context) { - return beginDeleteAsync(resourceGroupName, serverName, administratorName, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes an Azure AD Administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 serverName, AdministratorName administratorName) { - deleteAsync(resourceGroupName, serverName, administratorName).block(); - } - - /** - * Deletes an Azure AD Administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 serverName, AdministratorName administratorName, - Context context) { - deleteAsync(resourceGroupName, serverName, administratorName, context).block(); - } - - /** - * Gets information about an azure ad administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about an azure ad administrator along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String serverName, - AdministratorName administratorName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - if (administratorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter administratorName is required and cannot be null.")); - } - final String apiVersion = "2023-06-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, serverName, administratorName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets information about an azure ad administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about an azure ad administrator along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String serverName, - AdministratorName administratorName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - if (administratorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter administratorName is required and cannot be null.")); - } - final String apiVersion = "2023-06-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - serverName, administratorName, accept, context); - } - - /** - * Gets information about an azure ad administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about an azure ad administrator on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String serverName, - AdministratorName administratorName) { - return getWithResponseAsync(resourceGroupName, serverName, administratorName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets information about an azure ad administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about an azure ad administrator along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String serverName, - AdministratorName administratorName, Context context) { - return getWithResponseAsync(resourceGroupName, serverName, administratorName, context).block(); - } - - /** - * Gets information about an azure ad administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about an azure ad administrator. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AzureADAdministratorInner get(String resourceGroupName, String serverName, - AdministratorName administratorName) { - return getWithResponse(resourceGroupName, serverName, administratorName, Context.NONE).getValue(); - } - - /** - * List all the AAD administrators in a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 azure ad administrators along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByServerSinglePageAsync(String resourceGroupName, - String serverName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - final String apiVersion = "2023-06-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByServer(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, serverName, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List all the AAD administrators in a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 azure ad administrators along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByServerSinglePageAsync(String resourceGroupName, - String serverName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - final String apiVersion = "2023-06-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByServer(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - serverName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List all the AAD administrators in a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 azure ad administrators as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByServerAsync(String resourceGroupName, String serverName) { - return new PagedFlux<>(() -> listByServerSinglePageAsync(resourceGroupName, serverName), - nextLink -> listByServerNextSinglePageAsync(nextLink)); - } - - /** - * List all the AAD administrators in a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 azure ad administrators as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByServerAsync(String resourceGroupName, String serverName, - Context context) { - return new PagedFlux<>(() -> listByServerSinglePageAsync(resourceGroupName, serverName, context), - nextLink -> listByServerNextSinglePageAsync(nextLink, context)); - } - - /** - * List all the AAD administrators in a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 azure ad administrators as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByServer(String resourceGroupName, String serverName) { - return new PagedIterable<>(listByServerAsync(resourceGroupName, serverName)); - } - - /** - * List all the AAD administrators in a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 azure ad administrators as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByServer(String resourceGroupName, String serverName, - Context context) { - return new PagedIterable<>(listByServerAsync(resourceGroupName, serverName, 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 azure ad administrators along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByServerNextSinglePageAsync(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.listByServerNext(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 azure ad administrators along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByServerNextSinglePageAsync(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.listByServerNext(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/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AzureADAdministratorsImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AzureADAdministratorsImpl.java deleted file mode 100644 index 23e322189c45d..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/AzureADAdministratorsImpl.java +++ /dev/null @@ -1,165 +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.mysqlflexibleserver.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.mysqlflexibleserver.fluent.AzureADAdministratorsClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AzureADAdministratorInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorName; -import com.azure.resourcemanager.mysqlflexibleserver.models.AzureADAdministrator; -import com.azure.resourcemanager.mysqlflexibleserver.models.AzureADAdministrators; - -public final class AzureADAdministratorsImpl implements AzureADAdministrators { - private static final ClientLogger LOGGER = new ClientLogger(AzureADAdministratorsImpl.class); - - private final AzureADAdministratorsClient innerClient; - - private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; - - public AzureADAdministratorsImpl(AzureADAdministratorsClient innerClient, - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public void delete(String resourceGroupName, String serverName, AdministratorName administratorName) { - this.serviceClient().delete(resourceGroupName, serverName, administratorName); - } - - public void delete(String resourceGroupName, String serverName, AdministratorName administratorName, - Context context) { - this.serviceClient().delete(resourceGroupName, serverName, administratorName, context); - } - - public Response getWithResponse(String resourceGroupName, String serverName, - AdministratorName administratorName, Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceGroupName, serverName, administratorName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AzureADAdministratorImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public AzureADAdministrator get(String resourceGroupName, String serverName, AdministratorName administratorName) { - AzureADAdministratorInner inner = this.serviceClient().get(resourceGroupName, serverName, administratorName); - if (inner != null) { - return new AzureADAdministratorImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable listByServer(String resourceGroupName, String serverName) { - PagedIterable inner - = this.serviceClient().listByServer(resourceGroupName, serverName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AzureADAdministratorImpl(inner1, this.manager())); - } - - public PagedIterable listByServer(String resourceGroupName, String serverName, - Context context) { - PagedIterable inner - = this.serviceClient().listByServer(resourceGroupName, serverName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AzureADAdministratorImpl(inner1, this.manager())); - } - - public AzureADAdministrator 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 serverName = ResourceManagerUtils.getValueFromIdByName(id, "flexibleServers"); - if (serverName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'flexibleServers'.", id))); - } - String administratorNameLocal = ResourceManagerUtils.getValueFromIdByName(id, "administrators"); - if (administratorNameLocal == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'administrators'.", id))); - } - AdministratorName administratorName = AdministratorName.fromString(administratorNameLocal); - return this.getWithResponse(resourceGroupName, serverName, administratorName, 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 serverName = ResourceManagerUtils.getValueFromIdByName(id, "flexibleServers"); - if (serverName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'flexibleServers'.", id))); - } - String administratorNameLocal = ResourceManagerUtils.getValueFromIdByName(id, "administrators"); - if (administratorNameLocal == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'administrators'.", id))); - } - AdministratorName administratorName = AdministratorName.fromString(administratorNameLocal); - return this.getWithResponse(resourceGroupName, serverName, administratorName, 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 serverName = ResourceManagerUtils.getValueFromIdByName(id, "flexibleServers"); - if (serverName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'flexibleServers'.", id))); - } - String administratorNameLocal = ResourceManagerUtils.getValueFromIdByName(id, "administrators"); - if (administratorNameLocal == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'administrators'.", id))); - } - AdministratorName administratorName = AdministratorName.fromString(administratorNameLocal); - this.delete(resourceGroupName, serverName, administratorName, 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 serverName = ResourceManagerUtils.getValueFromIdByName(id, "flexibleServers"); - if (serverName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'flexibleServers'.", id))); - } - String administratorNameLocal = ResourceManagerUtils.getValueFromIdByName(id, "administrators"); - if (administratorNameLocal == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'administrators'.", id))); - } - AdministratorName administratorName = AdministratorName.fromString(administratorNameLocal); - this.delete(resourceGroupName, serverName, administratorName, context); - } - - private AzureADAdministratorsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { - return this.serviceManager; - } - - public AzureADAdministratorImpl define(AdministratorName name) { - return new AzureADAdministratorImpl(name, this.manager()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupAndExportResponseImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupAndExportResponseImpl.java deleted file mode 100644 index 5b23fc76bddd7..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupAndExportResponseImpl.java +++ /dev/null @@ -1,80 +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.mysqlflexibleserver.implementation; - -import com.azure.core.management.SystemData; -import com.azure.core.management.exception.ManagementError; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.BackupAndExportResponseInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupAndExportResponse; -import com.azure.resourcemanager.mysqlflexibleserver.models.OperationStatus; -import java.time.OffsetDateTime; - -public final class BackupAndExportResponseImpl implements BackupAndExportResponse { - private BackupAndExportResponseInner innerObject; - - private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; - - BackupAndExportResponseImpl(BackupAndExportResponseInner innerObject, - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager 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 OperationStatus status() { - return this.innerModel().status(); - } - - public OffsetDateTime startTime() { - return this.innerModel().startTime(); - } - - public OffsetDateTime endTime() { - return this.innerModel().endTime(); - } - - public Double percentComplete() { - return this.innerModel().percentComplete(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public ManagementError error() { - return this.innerModel().error(); - } - - public Long datasourceSizeInBytes() { - return this.innerModel().datasourceSizeInBytes(); - } - - public Long dataTransferredInBytes() { - return this.innerModel().dataTransferredInBytes(); - } - - public String backupMetadata() { - return this.innerModel().backupMetadata(); - } - - public BackupAndExportResponseInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupAndExportsClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupAndExportsClientImpl.java deleted file mode 100644 index 16a2767fbe01c..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupAndExportsClientImpl.java +++ /dev/null @@ -1,445 +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.mysqlflexibleserver.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.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.mysqlflexibleserver.fluent.BackupAndExportsClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.BackupAndExportResponseInner; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ValidateBackupResponseInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupAndExportRequest; -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 BackupAndExportsClient. - */ -public final class BackupAndExportsClientImpl implements BackupAndExportsClient { - /** - * The proxy service used to perform REST calls. - */ - private final BackupAndExportsService service; - - /** - * The service client containing this operation class. - */ - private final MySqlManagementClientImpl client; - - /** - * Initializes an instance of BackupAndExportsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - BackupAndExportsClientImpl(MySqlManagementClientImpl client) { - this.service - = RestProxy.create(BackupAndExportsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MySqlManagementClientBackupAndExports to be used by the proxy service - * to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MySqlManagementClien") - public interface BackupAndExportsService { - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/backupAndExport") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> create(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, - @BodyParam("application/json") BackupAndExportRequest parameters, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/validateBackup") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> validateBackup(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Exports the backup of the given server by creating a backup if not existing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for creating and exporting backup of the given server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents BackupAndExport API Response along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync(String resourceGroupName, String serverName, - BackupAndExportRequest parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2023-10-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.create(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, serverName, parameters, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Exports the backup of the given server by creating a backup if not existing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for creating and exporting backup of the given server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents BackupAndExport API Response along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync(String resourceGroupName, String serverName, - BackupAndExportRequest parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2023-10-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.create(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - serverName, parameters, accept, context); - } - - /** - * Exports the backup of the given server by creating a backup if not existing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for creating and exporting backup of the given server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of represents BackupAndExport API Response. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, BackupAndExportResponseInner> - beginCreateAsync(String resourceGroupName, String serverName, BackupAndExportRequest parameters) { - Mono>> mono = createWithResponseAsync(resourceGroupName, serverName, parameters); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), BackupAndExportResponseInner.class, BackupAndExportResponseInner.class, - this.client.getContext()); - } - - /** - * Exports the backup of the given server by creating a backup if not existing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for creating and exporting backup of the given server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of represents BackupAndExport API Response. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, BackupAndExportResponseInner> beginCreateAsync( - String resourceGroupName, String serverName, BackupAndExportRequest parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = createWithResponseAsync(resourceGroupName, serverName, parameters, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), BackupAndExportResponseInner.class, BackupAndExportResponseInner.class, - context); - } - - /** - * Exports the backup of the given server by creating a backup if not existing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for creating and exporting backup of the given server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of represents BackupAndExport API Response. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, BackupAndExportResponseInner> - beginCreate(String resourceGroupName, String serverName, BackupAndExportRequest parameters) { - return this.beginCreateAsync(resourceGroupName, serverName, parameters).getSyncPoller(); - } - - /** - * Exports the backup of the given server by creating a backup if not existing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for creating and exporting backup of the given server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of represents BackupAndExport API Response. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, BackupAndExportResponseInner> - beginCreate(String resourceGroupName, String serverName, BackupAndExportRequest parameters, Context context) { - return this.beginCreateAsync(resourceGroupName, serverName, parameters, context).getSyncPoller(); - } - - /** - * Exports the backup of the given server by creating a backup if not existing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for creating and exporting backup of the given server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents BackupAndExport API Response on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(String resourceGroupName, String serverName, - BackupAndExportRequest parameters) { - return beginCreateAsync(resourceGroupName, serverName, parameters).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Exports the backup of the given server by creating a backup if not existing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for creating and exporting backup of the given server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents BackupAndExport API Response on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(String resourceGroupName, String serverName, - BackupAndExportRequest parameters, Context context) { - return beginCreateAsync(resourceGroupName, serverName, parameters, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Exports the backup of the given server by creating a backup if not existing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for creating and exporting backup of the given server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents BackupAndExport API Response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BackupAndExportResponseInner create(String resourceGroupName, String serverName, - BackupAndExportRequest parameters) { - return createAsync(resourceGroupName, serverName, parameters).block(); - } - - /** - * Exports the backup of the given server by creating a backup if not existing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for creating and exporting backup of the given server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents BackupAndExport API Response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BackupAndExportResponseInner create(String resourceGroupName, String serverName, - BackupAndExportRequest parameters, Context context) { - return createAsync(resourceGroupName, serverName, parameters, context).block(); - } - - /** - * Validates if backup can be performed for given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents ValidateBackup API Response along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> validateBackupWithResponseAsync(String resourceGroupName, - String serverName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - final String apiVersion = "2023-10-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.validateBackup(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, serverName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Validates if backup can be performed for given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents ValidateBackup API Response along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> validateBackupWithResponseAsync(String resourceGroupName, - String serverName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - final String apiVersion = "2023-10-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.validateBackup(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, serverName, accept, context); - } - - /** - * Validates if backup can be performed for given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents ValidateBackup API Response on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono validateBackupAsync(String resourceGroupName, String serverName) { - return validateBackupWithResponseAsync(resourceGroupName, serverName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Validates if backup can be performed for given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents ValidateBackup API Response along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response validateBackupWithResponse(String resourceGroupName, String serverName, - Context context) { - return validateBackupWithResponseAsync(resourceGroupName, serverName, context).block(); - } - - /** - * Validates if backup can be performed for given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents ValidateBackup API Response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ValidateBackupResponseInner validateBackup(String resourceGroupName, String serverName) { - return validateBackupWithResponse(resourceGroupName, serverName, Context.NONE).getValue(); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupAndExportsImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupAndExportsImpl.java deleted file mode 100644 index bb4bf15d4d9f6..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupAndExportsImpl.java +++ /dev/null @@ -1,81 +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.mysqlflexibleserver.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.mysqlflexibleserver.fluent.BackupAndExportsClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.BackupAndExportResponseInner; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ValidateBackupResponseInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupAndExportRequest; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupAndExportResponse; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupAndExports; -import com.azure.resourcemanager.mysqlflexibleserver.models.ValidateBackupResponse; - -public final class BackupAndExportsImpl implements BackupAndExports { - private static final ClientLogger LOGGER = new ClientLogger(BackupAndExportsImpl.class); - - private final BackupAndExportsClient innerClient; - - private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; - - public BackupAndExportsImpl(BackupAndExportsClient innerClient, - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public BackupAndExportResponse create(String resourceGroupName, String serverName, - BackupAndExportRequest parameters) { - BackupAndExportResponseInner inner = this.serviceClient().create(resourceGroupName, serverName, parameters); - if (inner != null) { - return new BackupAndExportResponseImpl(inner, this.manager()); - } else { - return null; - } - } - - public BackupAndExportResponse create(String resourceGroupName, String serverName, - BackupAndExportRequest parameters, Context context) { - BackupAndExportResponseInner inner - = this.serviceClient().create(resourceGroupName, serverName, parameters, context); - if (inner != null) { - return new BackupAndExportResponseImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response validateBackupWithResponse(String resourceGroupName, String serverName, - Context context) { - Response inner - = this.serviceClient().validateBackupWithResponse(resourceGroupName, serverName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ValidateBackupResponseImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public ValidateBackupResponse validateBackup(String resourceGroupName, String serverName) { - ValidateBackupResponseInner inner = this.serviceClient().validateBackup(resourceGroupName, serverName); - if (inner != null) { - return new ValidateBackupResponseImpl(inner, this.manager()); - } else { - return null; - } - } - - private BackupAndExportsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupsClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupsClientImpl.java index ec2fa0fe8f2e7..713b6d936e36f 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupsClientImpl.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupsClientImpl.java @@ -11,7 +11,6 @@ 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; @@ -62,15 +61,6 @@ public final class BackupsClientImpl implements BackupsClient { @Host("{$host}") @ServiceInterface(name = "MySqlManagementClien") public interface BackupsService { - @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/backups/{backupName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> put(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, - @PathParam("backupName") String backupName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/backups/{backupName}") @ExpectedResponses({ 200 }) @@ -98,137 +88,6 @@ Mono> listByServerNext( @HeaderParam("Accept") String accept, Context context); } - /** - * Create backup for a given server with specified backup name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param backupName The name of the backup. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return server backup properties along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> putWithResponseAsync(String resourceGroupName, String serverName, - String backupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - if (backupName == null) { - return Mono.error(new IllegalArgumentException("Parameter backupName is required and cannot be null.")); - } - final String apiVersion = "2023-10-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.put(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, serverName, backupName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create backup for a given server with specified backup name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param backupName The name of the backup. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return server backup properties along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> putWithResponseAsync(String resourceGroupName, String serverName, - String backupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - if (backupName == null) { - return Mono.error(new IllegalArgumentException("Parameter backupName is required and cannot be null.")); - } - final String apiVersion = "2023-10-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.put(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - serverName, backupName, accept, context); - } - - /** - * Create backup for a given server with specified backup name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param backupName The name of the backup. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return server backup properties on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono putAsync(String resourceGroupName, String serverName, String backupName) { - return putWithResponseAsync(resourceGroupName, serverName, backupName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Create backup for a given server with specified backup name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param backupName The name of the backup. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return server backup properties along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response putWithResponse(String resourceGroupName, String serverName, String backupName, - Context context) { - return putWithResponseAsync(resourceGroupName, serverName, backupName, context).block(); - } - - /** - * Create backup for a given server with specified backup name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param backupName The name of the backup. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return server backup properties. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ServerBackupInner put(String resourceGroupName, String serverName, String backupName) { - return putWithResponse(resourceGroupName, serverName, backupName, Context.NONE).getValue(); - } - /** * List all the backups for a given server. * @@ -261,11 +120,10 @@ private Mono> getWithResponseAsync(String resourceGr if (backupName == null) { return Mono.error(new IllegalArgumentException("Parameter backupName is required and cannot be null.")); } - final String apiVersion = "2023-10-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, serverName, backupName, accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, backupName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -302,11 +160,10 @@ private Mono> getWithResponseAsync(String resourceGr if (backupName == null) { return Mono.error(new IllegalArgumentException("Parameter backupName is required and cannot be null.")); } - final String apiVersion = "2023-10-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - serverName, backupName, accept, context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, serverName, backupName, accept, context); } /** @@ -388,10 +245,9 @@ private Mono> listByServerSinglePageAsync(Strin if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } - final String apiVersion = "2023-10-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByServer(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.listByServer(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, serverName, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) @@ -427,12 +283,11 @@ private Mono> listByServerSinglePageAsync(Strin if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } - final String apiVersion = "2023-10-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByServer(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - serverName, accept, context) + .listByServer(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, serverName, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupsImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupsImpl.java index 7b8809b8c41b1..978c5749d31e0 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupsImpl.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/BackupsImpl.java @@ -27,27 +27,6 @@ public BackupsImpl(BackupsClient innerClient, this.serviceManager = serviceManager; } - public Response putWithResponse(String resourceGroupName, String serverName, String backupName, - Context context) { - Response inner - = this.serviceClient().putWithResponse(resourceGroupName, serverName, backupName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ServerBackupImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public ServerBackup put(String resourceGroupName, String serverName, String backupName) { - ServerBackupInner inner = this.serviceClient().put(resourceGroupName, serverName, backupName); - if (inner != null) { - return new ServerBackupImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getWithResponse(String resourceGroupName, String serverName, String backupName, Context context) { Response inner diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CapabilityImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CapabilityImpl.java deleted file mode 100644 index 95da88844c6a6..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CapabilityImpl.java +++ /dev/null @@ -1,76 +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.mysqlflexibleserver.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.CapabilityInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.Capability; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerEditionCapabilityV2; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerVersionCapabilityV2; -import java.util.Collections; -import java.util.List; - -public final class CapabilityImpl implements Capability { - private CapabilityInner innerObject; - - private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; - - CapabilityImpl(CapabilityInner innerObject, - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager 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 List supportedGeoBackupRegions() { - List inner = this.innerModel().supportedGeoBackupRegions(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List supportedFlexibleServerEditions() { - List inner = this.innerModel().supportedFlexibleServerEditions(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List supportedServerVersions() { - List inner = this.innerModel().supportedServerVersions(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public CapabilityInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CheckNameAvailabilitiesClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CheckNameAvailabilitiesClientImpl.java index b175f018d2587..a8426abeb5a38 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CheckNameAvailabilitiesClientImpl.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CheckNameAvailabilitiesClientImpl.java @@ -101,10 +101,9 @@ private Mono> executeWithResponseAsync(String lo } else { nameAvailabilityRequest.validate(); } - final String apiVersion = "2023-12-30"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.execute(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.execute(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), locationName, nameAvailabilityRequest, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -141,11 +140,10 @@ private Mono> executeWithResponseAsync(String lo } else { nameAvailabilityRequest.validate(); } - final String apiVersion = "2023-12-30"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.execute(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), locationName, - nameAvailabilityRequest, accept, context); + return service.execute(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + locationName, nameAvailabilityRequest, accept, context); } /** diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CheckNameAvailabilityWithoutLocationsClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CheckNameAvailabilityWithoutLocationsClientImpl.java index 3bcaab571016b..abf77aa3d9ca3 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CheckNameAvailabilityWithoutLocationsClientImpl.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CheckNameAvailabilityWithoutLocationsClientImpl.java @@ -98,10 +98,9 @@ Mono> execute(@HostParam("$host") String endpoin } else { nameAvailabilityRequest.validate(); } - final String apiVersion = "2023-12-30"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.execute(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.execute(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), nameAvailabilityRequest, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -134,10 +133,9 @@ Mono> execute(@HostParam("$host") String endpoin } else { nameAvailabilityRequest.validate(); } - final String apiVersion = "2023-12-30"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.execute(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + return service.execute(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), nameAvailabilityRequest, accept, context); } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CheckVirtualNetworkSubnetUsagesClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CheckVirtualNetworkSubnetUsagesClientImpl.java index 3f3a94f7ca4a0..a29199c633626 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CheckVirtualNetworkSubnetUsagesClientImpl.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/CheckVirtualNetworkSubnetUsagesClientImpl.java @@ -100,10 +100,9 @@ private Mono> executeWithResponse } else { parameters.validate(); } - final String apiVersion = "2023-12-30"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.execute(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.execute(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), locationName, parameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -139,11 +138,10 @@ private Mono> executeWithResponse } else { parameters.validate(); } - final String apiVersion = "2023-12-30"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.execute(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), locationName, - parameters, accept, context); + return service.execute(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + locationName, parameters, accept, context); } /** diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ConfigurationImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ConfigurationImpl.java index 787d8f9e07147..fb3b8b3776a35 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ConfigurationImpl.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ConfigurationImpl.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.mysqlflexibleserver.implementation; import com.azure.core.management.SystemData; -import com.azure.core.util.Context; import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ConfigurationInner; import com.azure.resourcemanager.mysqlflexibleserver.models.Configuration; import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationSource; @@ -13,11 +12,17 @@ import com.azure.resourcemanager.mysqlflexibleserver.models.IsDynamicConfig; import com.azure.resourcemanager.mysqlflexibleserver.models.IsReadOnly; -public final class ConfigurationImpl implements Configuration, Configuration.Definition, Configuration.Update { +public final class ConfigurationImpl implements Configuration { private ConfigurationInner innerObject; private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; + ConfigurationImpl(ConfigurationInner innerObject, + com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + public String id() { return this.innerModel().id(); } @@ -38,18 +43,10 @@ public String value() { return this.innerModel().value(); } - public String currentValue() { - return this.innerModel().currentValue(); - } - public String description() { return this.innerModel().description(); } - public String documentationLink() { - return this.innerModel().documentationLink(); - } - public String defaultValue() { return this.innerModel().defaultValue(); } @@ -78,10 +75,6 @@ public IsDynamicConfig isDynamicConfig() { return this.innerModel().isDynamicConfig(); } - public String resourceGroupName() { - return resourceGroupName; - } - public ConfigurationInner innerModel() { return this.innerObject; } @@ -89,94 +82,4 @@ public ConfigurationInner innerModel() { private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { return this.serviceManager; } - - private String resourceGroupName; - - private String serverName; - - private String configurationName; - - public ConfigurationImpl withExistingFlexibleServer(String resourceGroupName, String serverName) { - this.resourceGroupName = resourceGroupName; - this.serverName = serverName; - return this; - } - - public Configuration create() { - this.innerObject = serviceManager.serviceClient() - .getConfigurations() - .createOrUpdate(resourceGroupName, serverName, configurationName, this.innerModel(), Context.NONE); - return this; - } - - public Configuration create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getConfigurations() - .createOrUpdate(resourceGroupName, serverName, configurationName, this.innerModel(), context); - return this; - } - - ConfigurationImpl(String name, com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { - this.innerObject = new ConfigurationInner(); - this.serviceManager = serviceManager; - this.configurationName = name; - } - - public ConfigurationImpl update() { - return this; - } - - public Configuration apply() { - this.innerObject = serviceManager.serviceClient() - .getConfigurations() - .update(resourceGroupName, serverName, configurationName, this.innerModel(), Context.NONE); - return this; - } - - public Configuration apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getConfigurations() - .update(resourceGroupName, serverName, configurationName, this.innerModel(), context); - return this; - } - - ConfigurationImpl(ConfigurationInner innerObject, - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.serverName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "flexibleServers"); - this.configurationName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "configurations"); - } - - public Configuration refresh() { - this.innerObject = serviceManager.serviceClient() - .getConfigurations() - .getWithResponse(resourceGroupName, serverName, configurationName, Context.NONE) - .getValue(); - return this; - } - - public Configuration refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getConfigurations() - .getWithResponse(resourceGroupName, serverName, configurationName, context) - .getValue(); - return this; - } - - public ConfigurationImpl withValue(String value) { - this.innerModel().withValue(value); - return this; - } - - public ConfigurationImpl withCurrentValue(String currentValue) { - this.innerModel().withCurrentValue(currentValue); - return this; - } - - public ConfigurationImpl withSource(ConfigurationSource source) { - this.innerModel().withSource(source); - return this; - } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ConfigurationsClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ConfigurationsClientImpl.java index 9ee5d2dda5ee8..03a5ceba6549f 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ConfigurationsClientImpl.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ConfigurationsClientImpl.java @@ -14,7 +14,6 @@ import com.azure.core.annotation.Patch; 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; @@ -72,17 +71,6 @@ public final class ConfigurationsClientImpl implements ConfigurationsClient { @Host("{$host}") @ServiceInterface(name = "MySqlManagementClien") public interface ConfigurationsService { - @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/configurations/{configurationName}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, - @PathParam("configurationName") String configurationName, - @BodyParam("application/json") ConfigurationInner parameters, @HeaderParam("Accept") String accept, - Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/configurations/{configurationName}") @ExpectedResponses({ 200, 202 }) @@ -121,8 +109,7 @@ Mono>> batchUpdate(@HostParam("$host") String endpoint Mono> listByServer(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, - @QueryParam("tags") String tags, @QueryParam("keyword") String keyword, @QueryParam("page") Integer page, - @QueryParam("pageSize") Integer pageSize, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @@ -133,261 +120,6 @@ Mono> listByServerNext( @HeaderParam("Accept") String accept, Context context); } - /** - * Updates a configuration of a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param configurationName The name of the server configuration. - * @param parameters The required parameters for updating a server configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a Configuration along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String serverName, String configurationName, ConfigurationInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - if (configurationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2023-06-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, serverName, configurationName, parameters, accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates a configuration of a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param configurationName The name of the server configuration. - * @param parameters The required parameters for updating a server configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a Configuration along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String serverName, String configurationName, ConfigurationInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - if (configurationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2023-06-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, serverName, configurationName, parameters, accept, context); - } - - /** - * Updates a configuration of a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param configurationName The name of the server configuration. - * @param parameters The required parameters for updating a server configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of represents a Configuration. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ConfigurationInner> beginCreateOrUpdateAsync( - String resourceGroupName, String serverName, String configurationName, ConfigurationInner parameters) { - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, serverName, configurationName, parameters); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ConfigurationInner.class, ConfigurationInner.class, this.client.getContext()); - } - - /** - * Updates a configuration of a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param configurationName The name of the server configuration. - * @param parameters The required parameters for updating a server configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of represents a Configuration. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ConfigurationInner> beginCreateOrUpdateAsync( - String resourceGroupName, String serverName, String configurationName, ConfigurationInner parameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, serverName, configurationName, parameters, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ConfigurationInner.class, ConfigurationInner.class, context); - } - - /** - * Updates a configuration of a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param configurationName The name of the server configuration. - * @param parameters The required parameters for updating a server configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of represents a Configuration. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ConfigurationInner> beginCreateOrUpdate(String resourceGroupName, - String serverName, String configurationName, ConfigurationInner parameters) { - return this.beginCreateOrUpdateAsync(resourceGroupName, serverName, configurationName, parameters) - .getSyncPoller(); - } - - /** - * Updates a configuration of a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param configurationName The name of the server configuration. - * @param parameters The required parameters for updating a server configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of represents a Configuration. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ConfigurationInner> beginCreateOrUpdate(String resourceGroupName, - String serverName, String configurationName, ConfigurationInner parameters, Context context) { - return this.beginCreateOrUpdateAsync(resourceGroupName, serverName, configurationName, parameters, context) - .getSyncPoller(); - } - - /** - * Updates a configuration of a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param configurationName The name of the server configuration. - * @param parameters The required parameters for updating a server configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a Configuration on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String serverName, - String configurationName, ConfigurationInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, serverName, configurationName, parameters).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a configuration of a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param configurationName The name of the server configuration. - * @param parameters The required parameters for updating a server configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a Configuration on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String serverName, - String configurationName, ConfigurationInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, serverName, configurationName, parameters, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a configuration of a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param configurationName The name of the server configuration. - * @param parameters The required parameters for updating a server configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a Configuration. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ConfigurationInner createOrUpdate(String resourceGroupName, String serverName, String configurationName, - ConfigurationInner parameters) { - return createOrUpdateAsync(resourceGroupName, serverName, configurationName, parameters).block(); - } - - /** - * Updates a configuration of a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param configurationName The name of the server configuration. - * @param parameters The required parameters for updating a server configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a Configuration. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ConfigurationInner createOrUpdate(String resourceGroupName, String serverName, String configurationName, - ConfigurationInner parameters, Context context) { - return createOrUpdateAsync(resourceGroupName, serverName, configurationName, parameters, context).block(); - } - /** * Updates a configuration of a server. * @@ -427,12 +159,11 @@ private Mono>> updateWithResponseAsync(String resource } else { parameters.validate(); } - final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, serverName, configurationName, parameters, accept, context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, configurationName, parameters, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -476,11 +207,10 @@ private Mono>> updateWithResponseAsync(String resource } else { parameters.validate(); } - final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - serverName, configurationName, parameters, accept, context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, serverName, configurationName, parameters, accept, context); } /** @@ -675,11 +405,10 @@ private Mono> getWithResponseAsync(String resourceG return Mono .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); } - final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, serverName, configurationName, accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, configurationName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -718,11 +447,10 @@ private Mono> getWithResponseAsync(String resourceG return Mono .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); } - final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - serverName, configurationName, accept, context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, serverName, configurationName, accept, context); } /** @@ -810,10 +538,9 @@ private Mono>> batchUpdateWithResponseAsync(String res } else { parameters.validate(); } - final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.batchUpdate(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.batchUpdate(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, serverName, parameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -853,11 +580,10 @@ private Mono>> batchUpdateWithResponseAsync(String res } else { parameters.validate(); } - final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.batchUpdate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, serverName, parameters, accept, context); + return service.batchUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, parameters, accept, context); } /** @@ -1015,10 +741,6 @@ public ConfigurationListResultInner batchUpdate(String resourceGroupName, String * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. - * @param tags The tags of the server configuration. - * @param keyword The keyword of the server configuration. - * @param page The page of the server configuration. - * @param pageSize The pageSize of the server configuration. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1027,7 +749,7 @@ public ConfigurationListResultInner batchUpdate(String resourceGroupName, String */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByServerSinglePageAsync(String resourceGroupName, - String serverName, String tags, String keyword, Integer page, Integer pageSize) { + String serverName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1043,12 +765,10 @@ private Mono> listByServerSinglePageAsync(Stri if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } - final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.listByServer(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, serverName, tags, keyword, page, pageSize, accept, context)) + .withContext(context -> service.listByServer(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -1059,10 +779,6 @@ private Mono> listByServerSinglePageAsync(Stri * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. - * @param tags The tags of the server configuration. - * @param keyword The keyword of the server configuration. - * @param page The page of the server configuration. - * @param pageSize The pageSize of the server configuration. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1072,7 +788,7 @@ private Mono> listByServerSinglePageAsync(Stri */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByServerSinglePageAsync(String resourceGroupName, - String serverName, String tags, String keyword, Integer page, Integer pageSize, Context context) { + String serverName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1088,38 +804,15 @@ private Mono> listByServerSinglePageAsync(Stri if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } - final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByServer(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - serverName, tags, keyword, page, pageSize, accept, context) + .listByServer(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, serverName, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } - /** - * List all the configurations in a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param tags The tags of the server configuration. - * @param keyword The keyword of the server configuration. - * @param page The page of the server configuration. - * @param pageSize The pageSize of the server configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 server configurations as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByServerAsync(String resourceGroupName, String serverName, String tags, - String keyword, Integer page, Integer pageSize) { - return new PagedFlux<>( - () -> listByServerSinglePageAsync(resourceGroupName, serverName, tags, keyword, page, pageSize), - nextLink -> listByServerNextSinglePageAsync(nextLink)); - } - /** * List all the configurations in a given server. * @@ -1132,12 +825,7 @@ private PagedFlux listByServerAsync(String resourceGroupName */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByServerAsync(String resourceGroupName, String serverName) { - final String tags = null; - final String keyword = null; - final Integer page = null; - final Integer pageSize = null; - return new PagedFlux<>( - () -> listByServerSinglePageAsync(resourceGroupName, serverName, tags, keyword, page, pageSize), + return new PagedFlux<>(() -> listByServerSinglePageAsync(resourceGroupName, serverName), nextLink -> listByServerNextSinglePageAsync(nextLink)); } @@ -1146,10 +834,6 @@ private PagedFlux listByServerAsync(String resourceGroupName * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. - * @param tags The tags of the server configuration. - * @param keyword The keyword of the server configuration. - * @param page The page of the server configuration. - * @param pageSize The pageSize of the server configuration. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1157,10 +841,9 @@ private PagedFlux listByServerAsync(String resourceGroupName * @return a list of server configurations as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByServerAsync(String resourceGroupName, String serverName, String tags, - String keyword, Integer page, Integer pageSize, Context context) { - return new PagedFlux<>( - () -> listByServerSinglePageAsync(resourceGroupName, serverName, tags, keyword, page, pageSize, context), + private PagedFlux listByServerAsync(String resourceGroupName, String serverName, + Context context) { + return new PagedFlux<>(() -> listByServerSinglePageAsync(resourceGroupName, serverName, context), nextLink -> listByServerNextSinglePageAsync(nextLink, context)); } @@ -1176,11 +859,7 @@ private PagedFlux listByServerAsync(String resourceGroupName */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByServer(String resourceGroupName, String serverName) { - final String tags = null; - final String keyword = null; - final Integer page = null; - final Integer pageSize = null; - return new PagedIterable<>(listByServerAsync(resourceGroupName, serverName, tags, keyword, page, pageSize)); + return new PagedIterable<>(listByServerAsync(resourceGroupName, serverName)); } /** @@ -1188,10 +867,6 @@ public PagedIterable listByServer(String resourceGroupName, * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. - * @param tags The tags of the server configuration. - * @param keyword The keyword of the server configuration. - * @param page The page of the server configuration. - * @param pageSize The pageSize of the server configuration. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1199,10 +874,9 @@ public PagedIterable listByServer(String resourceGroupName, * @return a list of server configurations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByServer(String resourceGroupName, String serverName, String tags, - String keyword, Integer page, Integer pageSize, Context context) { - return new PagedIterable<>( - listByServerAsync(resourceGroupName, serverName, tags, keyword, page, pageSize, context)); + public PagedIterable listByServer(String resourceGroupName, String serverName, + Context context) { + return new PagedIterable<>(listByServerAsync(resourceGroupName, serverName, context)); } /** diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ConfigurationsImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ConfigurationsImpl.java index ba67ccfaed888..95d286bf23eed 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ConfigurationsImpl.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ConfigurationsImpl.java @@ -30,6 +30,28 @@ public ConfigurationsImpl(ConfigurationsClient innerClient, this.serviceManager = serviceManager; } + public Configuration update(String resourceGroupName, String serverName, String configurationName, + ConfigurationInner parameters) { + ConfigurationInner inner + = this.serviceClient().update(resourceGroupName, serverName, configurationName, parameters); + if (inner != null) { + return new ConfigurationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Configuration update(String resourceGroupName, String serverName, String configurationName, + ConfigurationInner parameters, Context context) { + ConfigurationInner inner + = this.serviceClient().update(resourceGroupName, serverName, configurationName, parameters, context); + if (inner != null) { + return new ConfigurationImpl(inner, this.manager()); + } else { + return null; + } + } + public Response getWithResponse(String resourceGroupName, String serverName, String configurationName, Context context) { Response inner @@ -78,51 +100,12 @@ public PagedIterable listByServer(String resourceGroupName, Strin return ResourceManagerUtils.mapPage(inner, inner1 -> new ConfigurationImpl(inner1, this.manager())); } - public PagedIterable listByServer(String resourceGroupName, String serverName, String tags, - String keyword, Integer page, Integer pageSize, Context context) { + public PagedIterable listByServer(String resourceGroupName, String serverName, Context context) { PagedIterable inner - = this.serviceClient().listByServer(resourceGroupName, serverName, tags, keyword, page, pageSize, context); + = this.serviceClient().listByServer(resourceGroupName, serverName, context); return ResourceManagerUtils.mapPage(inner, inner1 -> new ConfigurationImpl(inner1, this.manager())); } - public Configuration 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 serverName = ResourceManagerUtils.getValueFromIdByName(id, "flexibleServers"); - if (serverName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'flexibleServers'.", id))); - } - String configurationName = ResourceManagerUtils.getValueFromIdByName(id, "configurations"); - if (configurationName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'configurations'.", id))); - } - return this.getWithResponse(resourceGroupName, serverName, configurationName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String serverName = ResourceManagerUtils.getValueFromIdByName(id, "flexibleServers"); - if (serverName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'flexibleServers'.", id))); - } - String configurationName = ResourceManagerUtils.getValueFromIdByName(id, "configurations"); - if (configurationName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'configurations'.", id))); - } - return this.getWithResponse(resourceGroupName, serverName, configurationName, context); - } - private ConfigurationsClient serviceClient() { return this.innerClient; } @@ -130,8 +113,4 @@ private ConfigurationsClient serviceClient() { private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { return this.serviceManager; } - - public ConfigurationImpl define(String name) { - return new ConfigurationImpl(name, this.manager()); - } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/DatabasesClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/DatabasesClientImpl.java index 7059393931d5e..a386d6d810e7f 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/DatabasesClientImpl.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/DatabasesClientImpl.java @@ -154,10 +154,11 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { parameters.validate(); } - final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, serverName, databaseName, parameters, accept, context)) + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, databaseName, parameters, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -200,11 +201,10 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { parameters.validate(); } - final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, serverName, databaseName, parameters, accept, context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, databaseName, parameters, accept, context); } /** @@ -397,10 +397,9 @@ private Mono>> deleteWithResponseAsync(String resource if (databaseName == null) { return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); } - final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, serverName, databaseName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -438,11 +437,10 @@ private Mono>> deleteWithResponseAsync(String resource if (databaseName == null) { return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); } - final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - serverName, databaseName, accept, context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, serverName, databaseName, accept, context); } /** @@ -619,11 +617,10 @@ private Mono> getWithResponseAsync(String resourceGroupN if (databaseName == null) { return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); } - final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, serverName, databaseName, accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, databaseName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -660,11 +657,10 @@ private Mono> getWithResponseAsync(String resourceGroupN if (databaseName == null) { return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); } - final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - serverName, databaseName, accept, context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, serverName, databaseName, accept, context); } /** @@ -746,10 +742,9 @@ private Mono> listByServerSinglePageAsync(String re if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } - final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByServer(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.listByServer(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, serverName, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) @@ -785,12 +780,11 @@ private Mono> listByServerSinglePageAsync(String re if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } - final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByServer(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - serverName, accept, context) + .listByServer(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, serverName, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/FirewallRulesClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/FirewallRulesClientImpl.java index 27aab06e0327b..3316f56e000f2 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/FirewallRulesClientImpl.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/FirewallRulesClientImpl.java @@ -158,10 +158,9 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { parameters.validate(); } - final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, serverName, firewallRuleName, parameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -207,11 +206,11 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { parameters.validate(); } - final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, serverName, firewallRuleName, parameters, accept, context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, firewallRuleName, parameters, accept, + context); } /** @@ -407,10 +406,9 @@ private Mono>> deleteWithResponseAsync(String resource return Mono .error(new IllegalArgumentException("Parameter firewallRuleName is required and cannot be null.")); } - final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, serverName, firewallRuleName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -449,11 +447,10 @@ private Mono>> deleteWithResponseAsync(String resource return Mono .error(new IllegalArgumentException("Parameter firewallRuleName is required and cannot be null.")); } - final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - serverName, firewallRuleName, accept, context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, serverName, firewallRuleName, accept, context); } /** @@ -634,11 +631,10 @@ private Mono> getWithResponseAsync(String resourceGr return Mono .error(new IllegalArgumentException("Parameter firewallRuleName is required and cannot be null.")); } - final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, serverName, firewallRuleName, accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, firewallRuleName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -677,11 +673,10 @@ private Mono> getWithResponseAsync(String resourceGr return Mono .error(new IllegalArgumentException("Parameter firewallRuleName is required and cannot be null.")); } - final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - serverName, firewallRuleName, accept, context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, serverName, firewallRuleName, accept, context); } /** @@ -763,10 +758,9 @@ private Mono> listByServerSinglePageAsync(Strin if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } - final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByServer(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.listByServer(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, serverName, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) @@ -802,12 +796,11 @@ private Mono> listByServerSinglePageAsync(Strin if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } - final String apiVersion = "2023-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByServer(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - serverName, accept, context) + .listByServer(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, serverName, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/GetPrivateDnsZoneSuffixesClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/GetPrivateDnsZoneSuffixesClientImpl.java index b2e05216b8c7b..7f48312bd655a 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/GetPrivateDnsZoneSuffixesClientImpl.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/GetPrivateDnsZoneSuffixesClientImpl.java @@ -78,9 +78,10 @@ private Mono> executeWithResponse return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - final String apiVersion = "2023-12-30"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.execute(this.client.getEndpoint(), apiVersion, accept, context)) + return FluxUtil + .withContext( + context -> service.execute(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -100,10 +101,9 @@ private Mono> executeWithResponse return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - final String apiVersion = "2023-12-30"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.execute(this.client.getEndpoint(), apiVersion, accept, context); + return service.execute(this.client.getEndpoint(), this.client.getApiVersion(), accept, context); } /** diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/HighAvailabilityValidationEstimationImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/HighAvailabilityValidationEstimationImpl.java deleted file mode 100644 index cfdb0c3a4eea5..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/HighAvailabilityValidationEstimationImpl.java +++ /dev/null @@ -1,40 +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.mysqlflexibleserver.implementation; - -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.HighAvailabilityValidationEstimationInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.HighAvailabilityValidationEstimation; - -public final class HighAvailabilityValidationEstimationImpl implements HighAvailabilityValidationEstimation { - private HighAvailabilityValidationEstimationInner innerObject; - - private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; - - HighAvailabilityValidationEstimationImpl(HighAvailabilityValidationEstimationInner innerObject, - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public Integer estimatedDowntime() { - return this.innerModel().estimatedDowntime(); - } - - public String scheduledStandbyAvailabilityZone() { - return this.innerModel().scheduledStandbyAvailabilityZone(); - } - - public String expectedStandbyAvailabilityZone() { - return this.innerModel().expectedStandbyAvailabilityZone(); - } - - public HighAvailabilityValidationEstimationInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LocationBasedCapabilitiesClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LocationBasedCapabilitiesClientImpl.java index 910ede01abfd5..eea36cc4a3319 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LocationBasedCapabilitiesClientImpl.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LocationBasedCapabilitiesClientImpl.java @@ -101,11 +101,10 @@ private Mono> listSinglePageAsync(Strin if (locationName == null) { return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); } - final String apiVersion = "2023-12-30"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - locationName, accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), locationName, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -135,11 +134,11 @@ private Mono> listSinglePageAsync(Strin if (locationName == null) { return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); } - final String apiVersion = "2023-12-30"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), locationName, accept, context) + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), locationName, + accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LocationBasedCapabilitySetsClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LocationBasedCapabilitySetsClientImpl.java deleted file mode 100644 index 27a4969d005fd..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LocationBasedCapabilitySetsClientImpl.java +++ /dev/null @@ -1,386 +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.mysqlflexibleserver.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.mysqlflexibleserver.fluent.LocationBasedCapabilitySetsClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.CapabilityInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.CapabilitySetsList; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in LocationBasedCapabilitySetsClient. - */ -public final class LocationBasedCapabilitySetsClientImpl implements LocationBasedCapabilitySetsClient { - /** - * The proxy service used to perform REST calls. - */ - private final LocationBasedCapabilitySetsService service; - - /** - * The service client containing this operation class. - */ - private final MySqlManagementClientImpl client; - - /** - * Initializes an instance of LocationBasedCapabilitySetsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - LocationBasedCapabilitySetsClientImpl(MySqlManagementClientImpl client) { - this.service = RestProxy.create(LocationBasedCapabilitySetsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MySqlManagementClientLocationBasedCapabilitySets to be used by the - * proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MySqlManagementClien") - public interface LocationBasedCapabilitySetsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/locations/{locationName}/capabilitySets") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("locationName") String locationName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/locations/{locationName}/capabilitySets/{capabilitySetName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("locationName") String locationName, @PathParam("capabilitySetName") String capabilitySetName, - @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); - } - - /** - * Get capabilities at specified location in a given subscription. - * - * @param locationName The name of the location. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return capabilities at specified location in a given subscription along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String locationName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (locationName == null) { - return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); - } - final String apiVersion = "2023-12-30"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - locationName, accept, context)) - .>map(res -> new 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 capabilities at specified location in a given subscription. - * - * @param locationName The name of the location. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return capabilities at specified location in a given subscription along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String locationName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (locationName == null) { - return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); - } - final String apiVersion = "2023-12-30"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), locationName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Get capabilities at specified location in a given subscription. - * - * @param locationName The name of the location. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return capabilities at specified location in a given subscription as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String locationName) { - return new PagedFlux<>(() -> listSinglePageAsync(locationName), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get capabilities at specified location in a given subscription. - * - * @param locationName The name of the location. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return capabilities at specified location in a given subscription as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String locationName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(locationName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Get capabilities at specified location in a given subscription. - * - * @param locationName The name of the location. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return capabilities at specified location in a given subscription as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String locationName) { - return new PagedIterable<>(listAsync(locationName)); - } - - /** - * Get capabilities at specified location in a given subscription. - * - * @param locationName The name of the location. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return capabilities at specified location in a given subscription as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String locationName, Context context) { - return new PagedIterable<>(listAsync(locationName, context)); - } - - /** - * Get capabilities at specified location in a given subscription. - * - * @param locationName The name of the location. - * @param capabilitySetName Name of capability set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return capabilities at specified location in a given subscription along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String locationName, String capabilitySetName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (locationName == null) { - return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); - } - if (capabilitySetName == null) { - return Mono - .error(new IllegalArgumentException("Parameter capabilitySetName is required and cannot be null.")); - } - final String apiVersion = "2023-12-30"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - locationName, capabilitySetName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get capabilities at specified location in a given subscription. - * - * @param locationName The name of the location. - * @param capabilitySetName Name of capability set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return capabilities at specified location in a given subscription along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String locationName, String capabilitySetName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (locationName == null) { - return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); - } - if (capabilitySetName == null) { - return Mono - .error(new IllegalArgumentException("Parameter capabilitySetName is required and cannot be null.")); - } - final String apiVersion = "2023-12-30"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), locationName, - capabilitySetName, accept, context); - } - - /** - * Get capabilities at specified location in a given subscription. - * - * @param locationName The name of the location. - * @param capabilitySetName Name of capability set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return capabilities at specified location in a given subscription on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String locationName, String capabilitySetName) { - return getWithResponseAsync(locationName, capabilitySetName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get capabilities at specified location in a given subscription. - * - * @param locationName The name of the location. - * @param capabilitySetName Name of capability set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return capabilities at specified location in a given subscription along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String locationName, String capabilitySetName, Context context) { - return getWithResponseAsync(locationName, capabilitySetName, context).block(); - } - - /** - * Get capabilities at specified location in a given subscription. - * - * @param locationName The name of the location. - * @param capabilitySetName Name of capability set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return capabilities at specified location in a given subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CapabilityInner get(String locationName, String capabilitySetName) { - return getWithResponse(locationName, capabilitySetName, 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 ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return location capability set 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 location capability set 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/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LocationBasedCapabilitySetsImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LocationBasedCapabilitySetsImpl.java deleted file mode 100644 index 9d1560ca158a1..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LocationBasedCapabilitySetsImpl.java +++ /dev/null @@ -1,67 +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.mysqlflexibleserver.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.mysqlflexibleserver.fluent.LocationBasedCapabilitySetsClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.CapabilityInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.Capability; -import com.azure.resourcemanager.mysqlflexibleserver.models.LocationBasedCapabilitySets; - -public final class LocationBasedCapabilitySetsImpl implements LocationBasedCapabilitySets { - private static final ClientLogger LOGGER = new ClientLogger(LocationBasedCapabilitySetsImpl.class); - - private final LocationBasedCapabilitySetsClient innerClient; - - private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; - - public LocationBasedCapabilitySetsImpl(LocationBasedCapabilitySetsClient innerClient, - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list(String locationName) { - PagedIterable inner = this.serviceClient().list(locationName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new CapabilityImpl(inner1, this.manager())); - } - - public PagedIterable list(String locationName, Context context) { - PagedIterable inner = this.serviceClient().list(locationName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new CapabilityImpl(inner1, this.manager())); - } - - public Response getWithResponse(String locationName, String capabilitySetName, Context context) { - Response inner - = this.serviceClient().getWithResponse(locationName, capabilitySetName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new CapabilityImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public Capability get(String locationName, String capabilitySetName) { - CapabilityInner inner = this.serviceClient().get(locationName, capabilitySetName); - if (inner != null) { - return new CapabilityImpl(inner, this.manager()); - } else { - return null; - } - } - - private LocationBasedCapabilitySetsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LogFileImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LogFileImpl.java deleted file mode 100644 index e0b9fc6ffa020..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LogFileImpl.java +++ /dev/null @@ -1,65 +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.mysqlflexibleserver.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.LogFileInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.LogFile; -import java.time.OffsetDateTime; - -public final class LogFileImpl implements LogFile { - private LogFileInner innerObject; - - private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; - - LogFileImpl(LogFileInner innerObject, com.azure.resourcemanager.mysqlflexibleserver.MySqlManager 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 Long sizeInKB() { - return this.innerModel().sizeInKB(); - } - - public OffsetDateTime createdTime() { - return this.innerModel().createdTime(); - } - - public String typePropertiesType() { - return this.innerModel().typePropertiesType(); - } - - public OffsetDateTime lastModifiedTime() { - return this.innerModel().lastModifiedTime(); - } - - public String url() { - return this.innerModel().url(); - } - - public LogFileInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LogFilesClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LogFilesClientImpl.java deleted file mode 100644 index 36c182eab4cd8..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LogFilesClientImpl.java +++ /dev/null @@ -1,273 +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.mysqlflexibleserver.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.mysqlflexibleserver.fluent.LogFilesClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.LogFileInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.LogFileListResult; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in LogFilesClient. - */ -public final class LogFilesClientImpl implements LogFilesClient { - /** - * The proxy service used to perform REST calls. - */ - private final LogFilesService service; - - /** - * The service client containing this operation class. - */ - private final MySqlManagementClientImpl client; - - /** - * Initializes an instance of LogFilesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - LogFilesClientImpl(MySqlManagementClientImpl client) { - this.service = RestProxy.create(LogFilesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MySqlManagementClientLogFiles to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MySqlManagementClien") - public interface LogFilesService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/logFiles") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByServer(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByServerNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * List all the server log files in a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 logFiles along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByServerSinglePageAsync(String resourceGroupName, String serverName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - final String apiVersion = "2023-06-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByServer(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, serverName, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List all the server log files in a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 logFiles along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByServerSinglePageAsync(String resourceGroupName, String serverName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - final String apiVersion = "2023-06-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByServer(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - serverName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List all the server log files in a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 logFiles as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByServerAsync(String resourceGroupName, String serverName) { - return new PagedFlux<>(() -> listByServerSinglePageAsync(resourceGroupName, serverName), - nextLink -> listByServerNextSinglePageAsync(nextLink)); - } - - /** - * List all the server log files in a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 logFiles as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByServerAsync(String resourceGroupName, String serverName, Context context) { - return new PagedFlux<>(() -> listByServerSinglePageAsync(resourceGroupName, serverName, context), - nextLink -> listByServerNextSinglePageAsync(nextLink, context)); - } - - /** - * List all the server log files in a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 logFiles as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByServer(String resourceGroupName, String serverName) { - return new PagedIterable<>(listByServerAsync(resourceGroupName, serverName)); - } - - /** - * List all the server log files in a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 logFiles as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByServer(String resourceGroupName, String serverName, Context context) { - return new PagedIterable<>(listByServerAsync(resourceGroupName, serverName, 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 logFiles along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByServerNextSinglePageAsync(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.listByServerNext(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 logFiles along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByServerNextSinglePageAsync(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.listByServerNext(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/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LogFilesImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LogFilesImpl.java deleted file mode 100644 index f102763920eee..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LogFilesImpl.java +++ /dev/null @@ -1,45 +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.mysqlflexibleserver.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.mysqlflexibleserver.fluent.LogFilesClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.LogFileInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.LogFile; -import com.azure.resourcemanager.mysqlflexibleserver.models.LogFiles; - -public final class LogFilesImpl implements LogFiles { - private static final ClientLogger LOGGER = new ClientLogger(LogFilesImpl.class); - - private final LogFilesClient innerClient; - - private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; - - public LogFilesImpl(LogFilesClient innerClient, - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable listByServer(String resourceGroupName, String serverName) { - PagedIterable inner = this.serviceClient().listByServer(resourceGroupName, serverName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new LogFileImpl(inner1, this.manager())); - } - - public PagedIterable listByServer(String resourceGroupName, String serverName, Context context) { - PagedIterable inner = this.serviceClient().listByServer(resourceGroupName, serverName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new LogFileImpl(inner1, this.manager())); - } - - private LogFilesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LongRunningBackupsClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LongRunningBackupsClientImpl.java deleted file mode 100644 index 4ce1c25cb42f1..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LongRunningBackupsClientImpl.java +++ /dev/null @@ -1,360 +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.mysqlflexibleserver.implementation; - -import com.azure.core.annotation.BodyParam; -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.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.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.mysqlflexibleserver.fluent.LongRunningBackupsClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerBackupV2Inner; -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 LongRunningBackupsClient. - */ -public final class LongRunningBackupsClientImpl implements LongRunningBackupsClient { - /** - * The proxy service used to perform REST calls. - */ - private final LongRunningBackupsService service; - - /** - * The service client containing this operation class. - */ - private final MySqlManagementClientImpl client; - - /** - * Initializes an instance of LongRunningBackupsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - LongRunningBackupsClientImpl(MySqlManagementClientImpl client) { - this.service = RestProxy.create(LongRunningBackupsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MySqlManagementClientLongRunningBackups to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MySqlManagementClien") - public interface LongRunningBackupsService { - @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/backupsV2/{backupName}") - @ExpectedResponses({ 200, 201, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> create(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, - @PathParam("backupName") String backupName, @BodyParam("application/json") ServerBackupV2Inner parameters, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Create backup for a given server with specified backup name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param backupName The name of the backup. - * @param parameters The required parameters for creating and exporting backup of the given server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return server backup properties along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync(String resourceGroupName, String serverName, - String backupName, ServerBackupV2Inner parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - if (backupName == null) { - return Mono.error(new IllegalArgumentException("Parameter backupName is required and cannot be null.")); - } - if (parameters != null) { - parameters.validate(); - } - final String apiVersion = "2023-10-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.create(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, serverName, backupName, parameters, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create backup for a given server with specified backup name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param backupName The name of the backup. - * @param parameters The required parameters for creating and exporting backup of the given server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return server backup properties along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync(String resourceGroupName, String serverName, - String backupName, ServerBackupV2Inner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - if (backupName == null) { - return Mono.error(new IllegalArgumentException("Parameter backupName is required and cannot be null.")); - } - if (parameters != null) { - parameters.validate(); - } - final String apiVersion = "2023-10-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.create(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - serverName, backupName, parameters, accept, context); - } - - /** - * Create backup for a given server with specified backup name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param backupName The name of the backup. - * @param parameters The required parameters for creating and exporting backup of the given server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of server backup properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ServerBackupV2Inner> beginCreateAsync(String resourceGroupName, - String serverName, String backupName, ServerBackupV2Inner parameters) { - Mono>> mono - = createWithResponseAsync(resourceGroupName, serverName, backupName, parameters); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ServerBackupV2Inner.class, ServerBackupV2Inner.class, this.client.getContext()); - } - - /** - * Create backup for a given server with specified backup name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param backupName The name of the backup. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of server backup properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ServerBackupV2Inner> beginCreateAsync(String resourceGroupName, - String serverName, String backupName) { - final ServerBackupV2Inner parameters = null; - Mono>> mono - = createWithResponseAsync(resourceGroupName, serverName, backupName, parameters); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ServerBackupV2Inner.class, ServerBackupV2Inner.class, this.client.getContext()); - } - - /** - * Create backup for a given server with specified backup name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param backupName The name of the backup. - * @param parameters The required parameters for creating and exporting backup of the given server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of server backup properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ServerBackupV2Inner> beginCreateAsync(String resourceGroupName, - String serverName, String backupName, ServerBackupV2Inner parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = createWithResponseAsync(resourceGroupName, serverName, backupName, parameters, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ServerBackupV2Inner.class, ServerBackupV2Inner.class, context); - } - - /** - * Create backup for a given server with specified backup name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param backupName The name of the backup. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of server backup properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ServerBackupV2Inner> beginCreate(String resourceGroupName, - String serverName, String backupName) { - final ServerBackupV2Inner parameters = null; - return this.beginCreateAsync(resourceGroupName, serverName, backupName, parameters).getSyncPoller(); - } - - /** - * Create backup for a given server with specified backup name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param backupName The name of the backup. - * @param parameters The required parameters for creating and exporting backup of the given server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of server backup properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ServerBackupV2Inner> beginCreate(String resourceGroupName, - String serverName, String backupName, ServerBackupV2Inner parameters, Context context) { - return this.beginCreateAsync(resourceGroupName, serverName, backupName, parameters, context).getSyncPoller(); - } - - /** - * Create backup for a given server with specified backup name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param backupName The name of the backup. - * @param parameters The required parameters for creating and exporting backup of the given server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return server backup properties on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(String resourceGroupName, String serverName, String backupName, - ServerBackupV2Inner parameters) { - return beginCreateAsync(resourceGroupName, serverName, backupName, parameters).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create backup for a given server with specified backup name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param backupName The name of the backup. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return server backup properties on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(String resourceGroupName, String serverName, String backupName) { - final ServerBackupV2Inner parameters = null; - return beginCreateAsync(resourceGroupName, serverName, backupName, parameters).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create backup for a given server with specified backup name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param backupName The name of the backup. - * @param parameters The required parameters for creating and exporting backup of the given server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return server backup properties on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(String resourceGroupName, String serverName, String backupName, - ServerBackupV2Inner parameters, Context context) { - return beginCreateAsync(resourceGroupName, serverName, backupName, parameters, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create backup for a given server with specified backup name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param backupName The name of the backup. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return server backup properties. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ServerBackupV2Inner create(String resourceGroupName, String serverName, String backupName) { - final ServerBackupV2Inner parameters = null; - return createAsync(resourceGroupName, serverName, backupName, parameters).block(); - } - - /** - * Create backup for a given server with specified backup name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param backupName The name of the backup. - * @param parameters The required parameters for creating and exporting backup of the given server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return server backup properties. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ServerBackupV2Inner create(String resourceGroupName, String serverName, String backupName, - ServerBackupV2Inner parameters, Context context) { - return createAsync(resourceGroupName, serverName, backupName, parameters, context).block(); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LongRunningBackupsImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LongRunningBackupsImpl.java deleted file mode 100644 index 9d8ca1a3b55eb..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LongRunningBackupsImpl.java +++ /dev/null @@ -1,35 +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.mysqlflexibleserver.implementation; - -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.LongRunningBackupsClient; -import com.azure.resourcemanager.mysqlflexibleserver.models.LongRunningBackups; - -public final class LongRunningBackupsImpl implements LongRunningBackups { - private static final ClientLogger LOGGER = new ClientLogger(LongRunningBackupsImpl.class); - - private final LongRunningBackupsClient innerClient; - - private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; - - public LongRunningBackupsImpl(LongRunningBackupsClient innerClient, - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - private LongRunningBackupsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { - return this.serviceManager; - } - - public ServerBackupV2Impl define(String name) { - return new ServerBackupV2Impl(name, this.manager()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LongRunningBackupsOperationsClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LongRunningBackupsOperationsClientImpl.java deleted file mode 100644 index 61b1b4486c772..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LongRunningBackupsOperationsClientImpl.java +++ /dev/null @@ -1,413 +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.mysqlflexibleserver.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.mysqlflexibleserver.fluent.LongRunningBackupsOperationsClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerBackupV2Inner; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerBackupV2ListResult; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in LongRunningBackupsOperationsClient. - */ -public final class LongRunningBackupsOperationsClientImpl implements LongRunningBackupsOperationsClient { - /** - * The proxy service used to perform REST calls. - */ - private final LongRunningBackupsOperationsService service; - - /** - * The service client containing this operation class. - */ - private final MySqlManagementClientImpl client; - - /** - * Initializes an instance of LongRunningBackupsOperationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - LongRunningBackupsOperationsClientImpl(MySqlManagementClientImpl client) { - this.service = RestProxy.create(LongRunningBackupsOperationsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MySqlManagementClientLongRunningBackupsOperations to be used by the - * proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MySqlManagementClien") - public interface LongRunningBackupsOperationsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/backupsV2/{backupName}") - @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("serverName") String serverName, - @PathParam("backupName") String backupName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/backupsV2") - @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("serverName") String serverName, - @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); - } - - /** - * Get backup for a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param backupName The name of the backup. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup for a given server along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String serverName, - String backupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - if (backupName == null) { - return Mono.error(new IllegalArgumentException("Parameter backupName is required and cannot be null.")); - } - final String apiVersion = "2023-10-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, serverName, backupName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get backup for a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param backupName The name of the backup. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup for a given server along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String serverName, - String backupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - if (backupName == null) { - return Mono.error(new IllegalArgumentException("Parameter backupName is required and cannot be null.")); - } - final String apiVersion = "2023-10-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - serverName, backupName, accept, context); - } - - /** - * Get backup for a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param backupName The name of the backup. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup for a given server on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String serverName, String backupName) { - return getWithResponseAsync(resourceGroupName, serverName, backupName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get backup for a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param backupName The name of the backup. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup for a given server along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String serverName, String backupName, - Context context) { - return getWithResponseAsync(resourceGroupName, serverName, backupName, context).block(); - } - - /** - * Get backup for a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param backupName The name of the backup. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup for a given server. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ServerBackupV2Inner get(String resourceGroupName, String serverName, String backupName) { - return getWithResponse(resourceGroupName, serverName, backupName, Context.NONE).getValue(); - } - - /** - * List all the backups for a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 server backups along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String serverName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - final String apiVersion = "2023-10-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, serverName, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List all the backups for a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 server backups along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String serverName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - final String apiVersion = "2023-10-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, serverName, - accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List all the backups for a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 server backups as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String serverName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, serverName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List all the backups for a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 server backups as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String serverName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, serverName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * List all the backups for a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 server backups as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String serverName) { - return new PagedIterable<>(listAsync(resourceGroupName, serverName)); - } - - /** - * List all the backups for a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 server backups as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String serverName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, serverName, 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 server backups 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 server backups 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/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LongRunningBackupsOperationsImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LongRunningBackupsOperationsImpl.java deleted file mode 100644 index 11b02bcb2f9d3..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/LongRunningBackupsOperationsImpl.java +++ /dev/null @@ -1,68 +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.mysqlflexibleserver.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.mysqlflexibleserver.fluent.LongRunningBackupsOperationsClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerBackupV2Inner; -import com.azure.resourcemanager.mysqlflexibleserver.models.LongRunningBackupsOperations; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerBackupV2; - -public final class LongRunningBackupsOperationsImpl implements LongRunningBackupsOperations { - private static final ClientLogger LOGGER = new ClientLogger(LongRunningBackupsOperationsImpl.class); - - private final LongRunningBackupsOperationsClient innerClient; - - private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; - - public LongRunningBackupsOperationsImpl(LongRunningBackupsOperationsClient innerClient, - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceGroupName, String serverName, String backupName, - Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceGroupName, serverName, backupName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ServerBackupV2Impl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public ServerBackupV2 get(String resourceGroupName, String serverName, String backupName) { - ServerBackupV2Inner inner = this.serviceClient().get(resourceGroupName, serverName, backupName); - if (inner != null) { - return new ServerBackupV2Impl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable list(String resourceGroupName, String serverName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, serverName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ServerBackupV2Impl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String serverName, Context context) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, serverName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ServerBackupV2Impl(inner1, this.manager())); - } - - private LongRunningBackupsOperationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/MaintenanceImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/MaintenanceImpl.java deleted file mode 100644 index 0a925ebbd3b20..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/MaintenanceImpl.java +++ /dev/null @@ -1,93 +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.mysqlflexibleserver.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.MaintenanceInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.Maintenance; -import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceProvisioningState; -import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceState; -import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceType; -import java.time.OffsetDateTime; - -public final class MaintenanceImpl implements Maintenance { - private MaintenanceInner innerObject; - - private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; - - MaintenanceImpl(MaintenanceInner innerObject, - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager 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 MaintenanceType maintenanceType() { - return this.innerModel().maintenanceType(); - } - - public MaintenanceState maintenanceState() { - return this.innerModel().maintenanceState(); - } - - public OffsetDateTime maintenanceStartTime() { - return this.innerModel().maintenanceStartTime(); - } - - public OffsetDateTime maintenanceEndTime() { - return this.innerModel().maintenanceEndTime(); - } - - public OffsetDateTime maintenanceExecutionStartTime() { - return this.innerModel().maintenanceExecutionStartTime(); - } - - public OffsetDateTime maintenanceExecutionEndTime() { - return this.innerModel().maintenanceExecutionEndTime(); - } - - public OffsetDateTime maintenanceAvailableScheduleMinTime() { - return this.innerModel().maintenanceAvailableScheduleMinTime(); - } - - public OffsetDateTime maintenanceAvailableScheduleMaxTime() { - return this.innerModel().maintenanceAvailableScheduleMaxTime(); - } - - public String maintenanceTitle() { - return this.innerModel().maintenanceTitle(); - } - - public String maintenanceDescription() { - return this.innerModel().maintenanceDescription(); - } - - public MaintenanceProvisioningState provisioningState() { - return this.innerModel().provisioningState(); - } - - public MaintenanceInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/MaintenancesClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/MaintenancesClientImpl.java deleted file mode 100644 index d3b8bc2c917d9..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/MaintenancesClientImpl.java +++ /dev/null @@ -1,721 +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.mysqlflexibleserver.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -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.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.mysqlflexibleserver.fluent.MaintenancesClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.MaintenanceInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceListResult; -import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceUpdate; -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 MaintenancesClient. - */ -public final class MaintenancesClientImpl implements MaintenancesClient { - /** - * The proxy service used to perform REST calls. - */ - private final MaintenancesService service; - - /** - * The service client containing this operation class. - */ - private final MySqlManagementClientImpl client; - - /** - * Initializes an instance of MaintenancesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - MaintenancesClientImpl(MySqlManagementClientImpl client) { - this.service - = RestProxy.create(MaintenancesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MySqlManagementClientMaintenances to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MySqlManagementClien") - public interface MaintenancesService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/maintenances/{maintenanceName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> read(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, - @PathParam("maintenanceName") String maintenanceName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/maintenances/{maintenanceName}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, - @PathParam("maintenanceName") String maintenanceName, - @BodyParam("application/json") MaintenanceUpdate parameters, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/maintenances") - @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("serverName") String serverName, - @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); - } - - /** - * Read maintenance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param maintenanceName The name of the maintenance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a maintenance along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> readWithResponseAsync(String resourceGroupName, String serverName, - String maintenanceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - if (maintenanceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter maintenanceName is required and cannot be null.")); - } - final String apiVersion = "2023-10-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.read(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, serverName, maintenanceName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Read maintenance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param maintenanceName The name of the maintenance. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a maintenance along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> readWithResponseAsync(String resourceGroupName, String serverName, - String maintenanceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - if (maintenanceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter maintenanceName is required and cannot be null.")); - } - final String apiVersion = "2023-10-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.read(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - serverName, maintenanceName, accept, context); - } - - /** - * Read maintenance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param maintenanceName The name of the maintenance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a maintenance on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono readAsync(String resourceGroupName, String serverName, String maintenanceName) { - return readWithResponseAsync(resourceGroupName, serverName, maintenanceName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Read maintenance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param maintenanceName The name of the maintenance. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a maintenance along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response readWithResponse(String resourceGroupName, String serverName, - String maintenanceName, Context context) { - return readWithResponseAsync(resourceGroupName, serverName, maintenanceName, context).block(); - } - - /** - * Read maintenance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param maintenanceName The name of the maintenance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a maintenance. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MaintenanceInner read(String resourceGroupName, String serverName, String maintenanceName) { - return readWithResponse(resourceGroupName, serverName, maintenanceName, Context.NONE).getValue(); - } - - /** - * Update maintenances. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param maintenanceName The name of the maintenance. - * @param parameters The required parameters for update maintenance on a server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a maintenance along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, String serverName, - String maintenanceName, MaintenanceUpdate parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - if (maintenanceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter maintenanceName is required and cannot be null.")); - } - if (parameters != null) { - parameters.validate(); - } - final String apiVersion = "2023-10-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, serverName, maintenanceName, parameters, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update maintenances. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param maintenanceName The name of the maintenance. - * @param parameters The required parameters for update maintenance on a server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a maintenance along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, String serverName, - String maintenanceName, MaintenanceUpdate parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - if (maintenanceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter maintenanceName is required and cannot be null.")); - } - if (parameters != null) { - parameters.validate(); - } - final String apiVersion = "2023-10-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - serverName, maintenanceName, parameters, accept, context); - } - - /** - * Update maintenances. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param maintenanceName The name of the maintenance. - * @param parameters The required parameters for update maintenance on a server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of represents a maintenance. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, MaintenanceInner> beginUpdateAsync(String resourceGroupName, - String serverName, String maintenanceName, MaintenanceUpdate parameters) { - Mono>> mono - = updateWithResponseAsync(resourceGroupName, serverName, maintenanceName, parameters); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - MaintenanceInner.class, MaintenanceInner.class, this.client.getContext()); - } - - /** - * Update maintenances. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param maintenanceName The name of the maintenance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of represents a maintenance. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, MaintenanceInner> beginUpdateAsync(String resourceGroupName, - String serverName, String maintenanceName) { - final MaintenanceUpdate parameters = null; - Mono>> mono - = updateWithResponseAsync(resourceGroupName, serverName, maintenanceName, parameters); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - MaintenanceInner.class, MaintenanceInner.class, this.client.getContext()); - } - - /** - * Update maintenances. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param maintenanceName The name of the maintenance. - * @param parameters The required parameters for update maintenance on a server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of represents a maintenance. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, MaintenanceInner> beginUpdateAsync(String resourceGroupName, - String serverName, String maintenanceName, MaintenanceUpdate parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = updateWithResponseAsync(resourceGroupName, serverName, maintenanceName, parameters, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - MaintenanceInner.class, MaintenanceInner.class, context); - } - - /** - * Update maintenances. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param maintenanceName The name of the maintenance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of represents a maintenance. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, MaintenanceInner> beginUpdate(String resourceGroupName, - String serverName, String maintenanceName) { - final MaintenanceUpdate parameters = null; - return this.beginUpdateAsync(resourceGroupName, serverName, maintenanceName, parameters).getSyncPoller(); - } - - /** - * Update maintenances. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param maintenanceName The name of the maintenance. - * @param parameters The required parameters for update maintenance on a server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of represents a maintenance. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, MaintenanceInner> beginUpdate(String resourceGroupName, - String serverName, String maintenanceName, MaintenanceUpdate parameters, Context context) { - return this.beginUpdateAsync(resourceGroupName, serverName, maintenanceName, parameters, context) - .getSyncPoller(); - } - - /** - * Update maintenances. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param maintenanceName The name of the maintenance. - * @param parameters The required parameters for update maintenance on a server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a maintenance on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String serverName, String maintenanceName, - MaintenanceUpdate parameters) { - return beginUpdateAsync(resourceGroupName, serverName, maintenanceName, parameters).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update maintenances. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param maintenanceName The name of the maintenance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a maintenance on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String serverName, String maintenanceName) { - final MaintenanceUpdate parameters = null; - return beginUpdateAsync(resourceGroupName, serverName, maintenanceName, parameters).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update maintenances. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param maintenanceName The name of the maintenance. - * @param parameters The required parameters for update maintenance on a server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a maintenance on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String serverName, String maintenanceName, - MaintenanceUpdate parameters, Context context) { - return beginUpdateAsync(resourceGroupName, serverName, maintenanceName, parameters, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update maintenances. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param maintenanceName The name of the maintenance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a maintenance. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MaintenanceInner update(String resourceGroupName, String serverName, String maintenanceName) { - final MaintenanceUpdate parameters = null; - return updateAsync(resourceGroupName, serverName, maintenanceName, parameters).block(); - } - - /** - * Update maintenances. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param maintenanceName The name of the maintenance. - * @param parameters The required parameters for update maintenance on a server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a maintenance. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MaintenanceInner update(String resourceGroupName, String serverName, String maintenanceName, - MaintenanceUpdate parameters, Context context) { - return updateAsync(resourceGroupName, serverName, maintenanceName, parameters, context).block(); - } - - /** - * List maintenances. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 maintenances along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String serverName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - final String apiVersion = "2023-10-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, serverName, accept, context)) - .>map(res -> new 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 maintenances. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 maintenances along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String serverName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - final String apiVersion = "2023-10-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, serverName, - accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List maintenances. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 maintenances as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String serverName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, serverName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List maintenances. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 maintenances as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String serverName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, serverName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * List maintenances. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 maintenances as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String serverName) { - return new PagedIterable<>(listAsync(resourceGroupName, serverName)); - } - - /** - * List maintenances. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 maintenances as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String serverName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, serverName, 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 maintenances 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 maintenances 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/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/MaintenancesImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/MaintenancesImpl.java deleted file mode 100644 index b37e390b02fe1..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/MaintenancesImpl.java +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.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.mysqlflexibleserver.fluent.MaintenancesClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.MaintenanceInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.Maintenance; -import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceUpdate; -import com.azure.resourcemanager.mysqlflexibleserver.models.Maintenances; - -public final class MaintenancesImpl implements Maintenances { - private static final ClientLogger LOGGER = new ClientLogger(MaintenancesImpl.class); - - private final MaintenancesClient innerClient; - - private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; - - public MaintenancesImpl(MaintenancesClient innerClient, - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response readWithResponse(String resourceGroupName, String serverName, String maintenanceName, - Context context) { - Response inner - = this.serviceClient().readWithResponse(resourceGroupName, serverName, maintenanceName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new MaintenanceImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public Maintenance read(String resourceGroupName, String serverName, String maintenanceName) { - MaintenanceInner inner = this.serviceClient().read(resourceGroupName, serverName, maintenanceName); - if (inner != null) { - return new MaintenanceImpl(inner, this.manager()); - } else { - return null; - } - } - - public Maintenance update(String resourceGroupName, String serverName, String maintenanceName) { - MaintenanceInner inner = this.serviceClient().update(resourceGroupName, serverName, maintenanceName); - if (inner != null) { - return new MaintenanceImpl(inner, this.manager()); - } else { - return null; - } - } - - public Maintenance update(String resourceGroupName, String serverName, String maintenanceName, - MaintenanceUpdate parameters, Context context) { - MaintenanceInner inner - = this.serviceClient().update(resourceGroupName, serverName, maintenanceName, parameters, context); - if (inner != null) { - return new MaintenanceImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable list(String resourceGroupName, String serverName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, serverName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new MaintenanceImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String serverName, Context context) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, serverName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new MaintenanceImpl(inner1, this.manager())); - } - - private MaintenancesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/MySqlManagementClientBuilder.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/MySqlManagementClientBuilder.java index ddfb0fbdc088d..b9b230a8ac638 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/MySqlManagementClientBuilder.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/MySqlManagementClientBuilder.java @@ -20,12 +20,12 @@ @ServiceClientBuilder(serviceClients = { MySqlManagementClientImpl.class }) public final class MySqlManagementClientBuilder { /* - * The ID of the target subscription. The value must be an UUID. + * The ID of the target subscription. */ private String subscriptionId; /** - * Sets The ID of the target subscription. The value must be an UUID. + * Sets The ID of the target subscription. * * @param subscriptionId the subscriptionId value. * @return the MySqlManagementClientBuilder. diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/MySqlManagementClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/MySqlManagementClientImpl.java index bb2dc176c9377..b02b285661f5e 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/MySqlManagementClientImpl.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/MySqlManagementClientImpl.java @@ -23,9 +23,6 @@ import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.serializer.SerializerAdapter; import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.AdvancedThreatProtectionSettingsClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.AzureADAdministratorsClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.BackupAndExportsClient; import com.azure.resourcemanager.mysqlflexibleserver.fluent.BackupsClient; import com.azure.resourcemanager.mysqlflexibleserver.fluent.CheckNameAvailabilitiesClient; import com.azure.resourcemanager.mysqlflexibleserver.fluent.CheckNameAvailabilityWithoutLocationsClient; @@ -35,18 +32,10 @@ import com.azure.resourcemanager.mysqlflexibleserver.fluent.FirewallRulesClient; import com.azure.resourcemanager.mysqlflexibleserver.fluent.GetPrivateDnsZoneSuffixesClient; import com.azure.resourcemanager.mysqlflexibleserver.fluent.LocationBasedCapabilitiesClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.LocationBasedCapabilitySetsClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.LogFilesClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.LongRunningBackupsClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.LongRunningBackupsOperationsClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.MaintenancesClient; import com.azure.resourcemanager.mysqlflexibleserver.fluent.MySqlManagementClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.OperationProgressClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.OperationResultsClient; import com.azure.resourcemanager.mysqlflexibleserver.fluent.OperationsClient; import com.azure.resourcemanager.mysqlflexibleserver.fluent.ReplicasClient; import com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersMigrationsClient; import java.io.IOException; import java.lang.reflect.Type; import java.nio.ByteBuffer; @@ -62,12 +51,12 @@ @ServiceClient(builder = MySqlManagementClientBuilder.class) public final class MySqlManagementClientImpl implements MySqlManagementClient { /** - * The ID of the target subscription. The value must be an UUID. + * The ID of the target subscription. */ private final String subscriptionId; /** - * Gets The ID of the target subscription. The value must be an UUID. + * Gets The ID of the target subscription. * * @return the subscriptionId value. */ @@ -89,6 +78,20 @@ public String getEndpoint() { return this.endpoint; } + /** + * Api Version. + */ + private final String apiVersion; + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + /** * The HTTP pipeline to send requests through. */ @@ -131,118 +134,6 @@ public Duration getDefaultPollInterval() { return this.defaultPollInterval; } - /** - * The AzureADAdministratorsClient object to access its operations. - */ - private final AzureADAdministratorsClient azureADAdministrators; - - /** - * Gets the AzureADAdministratorsClient object to access its operations. - * - * @return the AzureADAdministratorsClient object. - */ - public AzureADAdministratorsClient getAzureADAdministrators() { - return this.azureADAdministrators; - } - - /** - * The BackupsClient object to access its operations. - */ - private final BackupsClient backups; - - /** - * Gets the BackupsClient object to access its operations. - * - * @return the BackupsClient object. - */ - public BackupsClient getBackups() { - return this.backups; - } - - /** - * The BackupAndExportsClient object to access its operations. - */ - private final BackupAndExportsClient backupAndExports; - - /** - * Gets the BackupAndExportsClient object to access its operations. - * - * @return the BackupAndExportsClient object. - */ - public BackupAndExportsClient getBackupAndExports() { - return this.backupAndExports; - } - - /** - * The LongRunningBackupsClient object to access its operations. - */ - private final LongRunningBackupsClient longRunningBackups; - - /** - * Gets the LongRunningBackupsClient object to access its operations. - * - * @return the LongRunningBackupsClient object. - */ - public LongRunningBackupsClient getLongRunningBackups() { - return this.longRunningBackups; - } - - /** - * The LongRunningBackupsOperationsClient object to access its operations. - */ - private final LongRunningBackupsOperationsClient longRunningBackupsOperations; - - /** - * Gets the LongRunningBackupsOperationsClient object to access its operations. - * - * @return the LongRunningBackupsOperationsClient object. - */ - public LongRunningBackupsOperationsClient getLongRunningBackupsOperations() { - return this.longRunningBackupsOperations; - } - - /** - * The ConfigurationsClient object to access its operations. - */ - private final ConfigurationsClient configurations; - - /** - * Gets the ConfigurationsClient object to access its operations. - * - * @return the ConfigurationsClient object. - */ - public ConfigurationsClient getConfigurations() { - return this.configurations; - } - - /** - * The DatabasesClient object to access its operations. - */ - private final DatabasesClient databases; - - /** - * Gets the DatabasesClient object to access its operations. - * - * @return the DatabasesClient object. - */ - public DatabasesClient getDatabases() { - return this.databases; - } - - /** - * The FirewallRulesClient object to access its operations. - */ - private final FirewallRulesClient firewallRules; - - /** - * Gets the FirewallRulesClient object to access its operations. - * - * @return the FirewallRulesClient object. - */ - public FirewallRulesClient getFirewallRules() { - return this.firewallRules; - } - /** * The ServersClient object to access its operations. */ @@ -272,73 +163,73 @@ public ReplicasClient getReplicas() { } /** - * The ServersMigrationsClient object to access its operations. + * The BackupsClient object to access its operations. */ - private final ServersMigrationsClient serversMigrations; + private final BackupsClient backups; /** - * Gets the ServersMigrationsClient object to access its operations. + * Gets the BackupsClient object to access its operations. * - * @return the ServersMigrationsClient object. + * @return the BackupsClient object. */ - public ServersMigrationsClient getServersMigrations() { - return this.serversMigrations; + public BackupsClient getBackups() { + return this.backups; } /** - * The AdvancedThreatProtectionSettingsClient object to access its operations. + * The FirewallRulesClient object to access its operations. */ - private final AdvancedThreatProtectionSettingsClient advancedThreatProtectionSettings; + private final FirewallRulesClient firewallRules; /** - * Gets the AdvancedThreatProtectionSettingsClient object to access its operations. + * Gets the FirewallRulesClient object to access its operations. * - * @return the AdvancedThreatProtectionSettingsClient object. + * @return the FirewallRulesClient object. */ - public AdvancedThreatProtectionSettingsClient getAdvancedThreatProtectionSettings() { - return this.advancedThreatProtectionSettings; + public FirewallRulesClient getFirewallRules() { + return this.firewallRules; } /** - * The LogFilesClient object to access its operations. + * The DatabasesClient object to access its operations. */ - private final LogFilesClient logFiles; + private final DatabasesClient databases; /** - * Gets the LogFilesClient object to access its operations. + * Gets the DatabasesClient object to access its operations. * - * @return the LogFilesClient object. + * @return the DatabasesClient object. */ - public LogFilesClient getLogFiles() { - return this.logFiles; + public DatabasesClient getDatabases() { + return this.databases; } /** - * The LocationBasedCapabilitiesClient object to access its operations. + * The ConfigurationsClient object to access its operations. */ - private final LocationBasedCapabilitiesClient locationBasedCapabilities; + private final ConfigurationsClient configurations; /** - * Gets the LocationBasedCapabilitiesClient object to access its operations. + * Gets the ConfigurationsClient object to access its operations. * - * @return the LocationBasedCapabilitiesClient object. + * @return the ConfigurationsClient object. */ - public LocationBasedCapabilitiesClient getLocationBasedCapabilities() { - return this.locationBasedCapabilities; + public ConfigurationsClient getConfigurations() { + return this.configurations; } /** - * The LocationBasedCapabilitySetsClient object to access its operations. + * The LocationBasedCapabilitiesClient object to access its operations. */ - private final LocationBasedCapabilitySetsClient locationBasedCapabilitySets; + private final LocationBasedCapabilitiesClient locationBasedCapabilities; /** - * Gets the LocationBasedCapabilitySetsClient object to access its operations. + * Gets the LocationBasedCapabilitiesClient object to access its operations. * - * @return the LocationBasedCapabilitySetsClient object. + * @return the LocationBasedCapabilitiesClient object. */ - public LocationBasedCapabilitySetsClient getLocationBasedCapabilitySets() { - return this.locationBasedCapabilitySets; + public LocationBasedCapabilitiesClient getLocationBasedCapabilities() { + return this.locationBasedCapabilities; } /** @@ -383,34 +274,6 @@ public CheckNameAvailabilityWithoutLocationsClient getCheckNameAvailabilityWitho return this.checkNameAvailabilityWithoutLocations; } - /** - * The OperationResultsClient object to access its operations. - */ - private final OperationResultsClient operationResults; - - /** - * Gets the OperationResultsClient object to access its operations. - * - * @return the OperationResultsClient object. - */ - public OperationResultsClient getOperationResults() { - return this.operationResults; - } - - /** - * The OperationProgressClient object to access its operations. - */ - private final OperationProgressClient operationProgress; - - /** - * Gets the OperationProgressClient object to access its operations. - * - * @return the OperationProgressClient object. - */ - public OperationProgressClient getOperationProgress() { - return this.operationProgress; - } - /** * The GetPrivateDnsZoneSuffixesClient object to access its operations. */ @@ -439,20 +302,6 @@ public OperationsClient getOperations() { return this.operations; } - /** - * The MaintenancesClient object to access its operations. - */ - private final MaintenancesClient maintenances; - - /** - * Gets the MaintenancesClient object to access its operations. - * - * @return the MaintenancesClient object. - */ - public MaintenancesClient getMaintenances() { - return this.maintenances; - } - /** * Initializes an instance of MySqlManagementClient client. * @@ -460,7 +309,7 @@ public MaintenancesClient getMaintenances() { * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. * @param environment The Azure environment. - * @param subscriptionId The ID of the target subscription. The value must be an UUID. + * @param subscriptionId The ID of the target subscription. * @param endpoint server parameter. */ MySqlManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, @@ -470,29 +319,19 @@ public MaintenancesClient getMaintenances() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.azureADAdministrators = new AzureADAdministratorsClientImpl(this); - this.backups = new BackupsClientImpl(this); - this.backupAndExports = new BackupAndExportsClientImpl(this); - this.longRunningBackups = new LongRunningBackupsClientImpl(this); - this.longRunningBackupsOperations = new LongRunningBackupsOperationsClientImpl(this); - this.configurations = new ConfigurationsClientImpl(this); - this.databases = new DatabasesClientImpl(this); - this.firewallRules = new FirewallRulesClientImpl(this); + this.apiVersion = "2021-05-01"; this.servers = new ServersClientImpl(this); this.replicas = new ReplicasClientImpl(this); - this.serversMigrations = new ServersMigrationsClientImpl(this); - this.advancedThreatProtectionSettings = new AdvancedThreatProtectionSettingsClientImpl(this); - this.logFiles = new LogFilesClientImpl(this); + this.backups = new BackupsClientImpl(this); + this.firewallRules = new FirewallRulesClientImpl(this); + this.databases = new DatabasesClientImpl(this); + this.configurations = new ConfigurationsClientImpl(this); this.locationBasedCapabilities = new LocationBasedCapabilitiesClientImpl(this); - this.locationBasedCapabilitySets = new LocationBasedCapabilitySetsClientImpl(this); this.checkVirtualNetworkSubnetUsages = new CheckVirtualNetworkSubnetUsagesClientImpl(this); this.checkNameAvailabilities = new CheckNameAvailabilitiesClientImpl(this); this.checkNameAvailabilityWithoutLocations = new CheckNameAvailabilityWithoutLocationsClientImpl(this); - this.operationResults = new OperationResultsClientImpl(this); - this.operationProgress = new OperationProgressClientImpl(this); this.getPrivateDnsZoneSuffixes = new GetPrivateDnsZoneSuffixesClientImpl(this); this.operations = new OperationsClientImpl(this); - this.maintenances = new MaintenancesClientImpl(this); } /** diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationProgressClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationProgressClientImpl.java deleted file mode 100644 index 734b1b53f5339..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationProgressClientImpl.java +++ /dev/null @@ -1,187 +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.mysqlflexibleserver.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.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.mysqlflexibleserver.fluent.OperationProgressClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.OperationProgressResultInner; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in OperationProgressClient. - */ -public final class OperationProgressClientImpl implements OperationProgressClient { - /** - * The proxy service used to perform REST calls. - */ - private final OperationProgressService service; - - /** - * The service client containing this operation class. - */ - private final MySqlManagementClientImpl client; - - /** - * Initializes an instance of OperationProgressClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - OperationProgressClientImpl(MySqlManagementClientImpl client) { - this.service - = RestProxy.create(OperationProgressService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MySqlManagementClientOperationProgress to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MySqlManagementClien") - public interface OperationProgressService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/locations/{locationName}/operationProgress/{operationId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @PathParam("locationName") String locationName, @PathParam("operationId") String operationId, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Get the operation result for a long running operation. - * - * @param locationName The name of the location. - * @param operationId The ID of an ongoing async operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the operation result for a long running operation along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String locationName, String operationId) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (locationName == null) { - return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); - } - if (operationId == null) { - return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); - } - final String apiVersion = "2023-12-30"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, - locationName, operationId, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the operation result for a long running operation. - * - * @param locationName The name of the location. - * @param operationId The ID of an ongoing async operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the operation result for a long running operation along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String locationName, String operationId, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (locationName == null) { - return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); - } - if (operationId == null) { - return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); - } - final String apiVersion = "2023-12-30"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, locationName, - operationId, accept, context); - } - - /** - * Get the operation result for a long running operation. - * - * @param locationName The name of the location. - * @param operationId The ID of an ongoing async operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the operation result for a long running operation on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String locationName, String operationId) { - return getWithResponseAsync(locationName, operationId).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get the operation result for a long running operation. - * - * @param locationName The name of the location. - * @param operationId The ID of an ongoing async operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the operation result for a long running operation along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String locationName, String operationId, - Context context) { - return getWithResponseAsync(locationName, operationId, context).block(); - } - - /** - * Get the operation result for a long running operation. - * - * @param locationName The name of the location. - * @param operationId The ID of an ongoing async operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the operation result for a long running operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public OperationProgressResultInner get(String locationName, String operationId) { - return getWithResponse(locationName, operationId, Context.NONE).getValue(); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationProgressImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationProgressImpl.java deleted file mode 100644 index c1a98930348a1..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationProgressImpl.java +++ /dev/null @@ -1,56 +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.mysqlflexibleserver.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.mysqlflexibleserver.fluent.OperationProgressClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.OperationProgressResultInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.OperationProgress; -import com.azure.resourcemanager.mysqlflexibleserver.models.OperationProgressResult; - -public final class OperationProgressImpl implements OperationProgress { - private static final ClientLogger LOGGER = new ClientLogger(OperationProgressImpl.class); - - private final OperationProgressClient innerClient; - - private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; - - public OperationProgressImpl(OperationProgressClient innerClient, - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String locationName, String operationId, Context context) { - Response inner - = this.serviceClient().getWithResponse(locationName, operationId, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new OperationProgressResultImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public OperationProgressResult get(String locationName, String operationId) { - OperationProgressResultInner inner = this.serviceClient().get(locationName, operationId); - if (inner != null) { - return new OperationProgressResultImpl(inner, this.manager()); - } else { - return null; - } - } - - private OperationProgressClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationProgressResultImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationProgressResultImpl.java deleted file mode 100644 index 3b1dd848a679e..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationProgressResultImpl.java +++ /dev/null @@ -1,79 +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.mysqlflexibleserver.implementation; - -import com.azure.core.management.exception.ManagementError; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.OperationProgressResultInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.OperationProgressResponseType; -import com.azure.resourcemanager.mysqlflexibleserver.models.OperationProgressResult; -import com.azure.resourcemanager.mysqlflexibleserver.models.OperationStatusResult; -import java.time.OffsetDateTime; -import java.util.Collections; -import java.util.List; - -public final class OperationProgressResultImpl implements OperationProgressResult { - private OperationProgressResultInner innerObject; - - private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; - - OperationProgressResultImpl(OperationProgressResultInner innerObject, - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String resourceId() { - return this.innerModel().resourceId(); - } - - public String name() { - return this.innerModel().name(); - } - - public String status() { - return this.innerModel().status(); - } - - public Float percentComplete() { - return this.innerModel().percentComplete(); - } - - public OffsetDateTime startTime() { - return this.innerModel().startTime(); - } - - public OffsetDateTime endTime() { - return this.innerModel().endTime(); - } - - public List operations() { - List inner = this.innerModel().operations(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public ManagementError error() { - return this.innerModel().error(); - } - - public OperationProgressResponseType properties() { - return this.innerModel().properties(); - } - - public OperationProgressResultInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationResultsClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationResultsClientImpl.java deleted file mode 100644 index e33b9a0b3cd2f..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationResultsClientImpl.java +++ /dev/null @@ -1,188 +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.mysqlflexibleserver.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.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.mysqlflexibleserver.fluent.OperationResultsClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.OperationStatusExtendedResultInner; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in OperationResultsClient. - */ -public final class OperationResultsClientImpl implements OperationResultsClient { - /** - * The proxy service used to perform REST calls. - */ - private final OperationResultsService service; - - /** - * The service client containing this operation class. - */ - private final MySqlManagementClientImpl client; - - /** - * Initializes an instance of OperationResultsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - OperationResultsClientImpl(MySqlManagementClientImpl client) { - this.service - = RestProxy.create(OperationResultsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MySqlManagementClientOperationResults to be used by the proxy service - * to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MySqlManagementClien") - public interface OperationResultsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/locations/{locationName}/operationResults/{operationId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @PathParam("locationName") String locationName, @PathParam("operationId") String operationId, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Get the operation result for a long running operation. - * - * @param locationName The name of the location. - * @param operationId The operation Id. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the operation result for a long running operation along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String locationName, - String operationId) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (locationName == null) { - return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); - } - if (operationId == null) { - return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); - } - final String apiVersion = "2023-12-30"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, - locationName, operationId, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the operation result for a long running operation. - * - * @param locationName The name of the location. - * @param operationId The operation Id. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the operation result for a long running operation along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String locationName, - String operationId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (locationName == null) { - return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); - } - if (operationId == null) { - return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); - } - final String apiVersion = "2023-12-30"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, locationName, - operationId, accept, context); - } - - /** - * Get the operation result for a long running operation. - * - * @param locationName The name of the location. - * @param operationId The operation Id. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the operation result for a long running operation on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String locationName, String operationId) { - return getWithResponseAsync(locationName, operationId).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get the operation result for a long running operation. - * - * @param locationName The name of the location. - * @param operationId The operation Id. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the operation result for a long running operation along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String locationName, String operationId, - Context context) { - return getWithResponseAsync(locationName, operationId, context).block(); - } - - /** - * Get the operation result for a long running operation. - * - * @param locationName The name of the location. - * @param operationId The operation Id. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the operation result for a long running operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public OperationStatusExtendedResultInner get(String locationName, String operationId) { - return getWithResponse(locationName, operationId, Context.NONE).getValue(); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationResultsImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationResultsImpl.java deleted file mode 100644 index 24864ffbdf717..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationResultsImpl.java +++ /dev/null @@ -1,57 +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.mysqlflexibleserver.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.mysqlflexibleserver.fluent.OperationResultsClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.OperationStatusExtendedResultInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.OperationResults; -import com.azure.resourcemanager.mysqlflexibleserver.models.OperationStatusExtendedResult; - -public final class OperationResultsImpl implements OperationResults { - private static final ClientLogger LOGGER = new ClientLogger(OperationResultsImpl.class); - - private final OperationResultsClient innerClient; - - private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; - - public OperationResultsImpl(OperationResultsClient innerClient, - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String locationName, String operationId, - Context context) { - Response inner - = this.serviceClient().getWithResponse(locationName, operationId, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new OperationStatusExtendedResultImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public OperationStatusExtendedResult get(String locationName, String operationId) { - OperationStatusExtendedResultInner inner = this.serviceClient().get(locationName, operationId); - if (inner != null) { - return new OperationStatusExtendedResultImpl(inner, this.manager()); - } else { - return null; - } - } - - private OperationResultsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationStatusExtendedResultImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationStatusExtendedResultImpl.java deleted file mode 100644 index 04f5f577984bd..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationStatusExtendedResultImpl.java +++ /dev/null @@ -1,84 +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.mysqlflexibleserver.implementation; - -import com.azure.core.management.exception.ManagementError; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.OperationStatusExtendedResultInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.OperationStatusExtendedResult; -import com.azure.resourcemanager.mysqlflexibleserver.models.OperationStatusResult; -import java.time.OffsetDateTime; -import java.util.Collections; -import java.util.List; -import java.util.Map; - -public final class OperationStatusExtendedResultImpl implements OperationStatusExtendedResult { - private OperationStatusExtendedResultInner innerObject; - - private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; - - OperationStatusExtendedResultImpl(OperationStatusExtendedResultInner innerObject, - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String resourceId() { - return this.innerModel().resourceId(); - } - - public String name() { - return this.innerModel().name(); - } - - public String status() { - return this.innerModel().status(); - } - - public Float percentComplete() { - return this.innerModel().percentComplete(); - } - - public OffsetDateTime startTime() { - return this.innerModel().startTime(); - } - - public OffsetDateTime endTime() { - return this.innerModel().endTime(); - } - - public List operations() { - List inner = this.innerModel().operations(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public ManagementError error() { - return this.innerModel().error(); - } - - public Map properties() { - Map inner = this.innerModel().properties(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public OperationStatusExtendedResultInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationsClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationsClientImpl.java index dc6c989cea754..75f050fdcb9f9 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationsClientImpl.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/OperationsClientImpl.java @@ -91,9 +91,10 @@ private Mono> listSinglePageAsync() { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - final String apiVersion = "2023-12-30"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.list(this.client.getEndpoint(), apiVersion, accept, context)) + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -115,10 +116,9 @@ private Mono> listSinglePageAsync(Context context) return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - final String apiVersion = "2023-12-30"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, accept, context) + return service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ReplicasClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ReplicasClientImpl.java index 1f56b4c468d8e..ec468bda9bbed 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ReplicasClientImpl.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ReplicasClientImpl.java @@ -106,10 +106,9 @@ private Mono> listByServerSinglePageAsync(String reso if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } - final String apiVersion = "2023-12-30"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByServer(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.listByServer(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, serverName, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) @@ -145,12 +144,11 @@ private Mono> listByServerSinglePageAsync(String reso if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } - final String apiVersion = "2023-12-30"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByServer(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - serverName, accept, context) + .listByServer(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, serverName, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServerBackupV2Impl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServerBackupV2Impl.java deleted file mode 100644 index 47c3ca6d0404c..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServerBackupV2Impl.java +++ /dev/null @@ -1,121 +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.mysqlflexibleserver.implementation; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerBackupV2Inner; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupType; -import com.azure.resourcemanager.mysqlflexibleserver.models.ProvisioningState; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerBackupV2; -import java.time.OffsetDateTime; - -public final class ServerBackupV2Impl implements ServerBackupV2, ServerBackupV2.Definition { - private ServerBackupV2Inner innerObject; - - private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; - - ServerBackupV2Impl(ServerBackupV2Inner innerObject, - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager 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 backupNameV2() { - return this.innerModel().backupNameV2(); - } - - public BackupType backupType() { - return this.innerModel().backupType(); - } - - public OffsetDateTime completedTime() { - return this.innerModel().completedTime(); - } - - public String source() { - return this.innerModel().source(); - } - - public ProvisioningState provisioningState() { - return this.innerModel().provisioningState(); - } - - public ServerBackupV2Inner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String serverName; - - private String backupName; - - public ServerBackupV2Impl withExistingFlexibleServer(String resourceGroupName, String serverName) { - this.resourceGroupName = resourceGroupName; - this.serverName = serverName; - return this; - } - - public ServerBackupV2 create() { - this.innerObject = serviceManager.serviceClient() - .getLongRunningBackups() - .create(resourceGroupName, serverName, backupName, this.innerModel(), Context.NONE); - return this; - } - - public ServerBackupV2 create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getLongRunningBackups() - .create(resourceGroupName, serverName, backupName, this.innerModel(), context); - return this; - } - - ServerBackupV2Impl(String name, com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { - this.innerObject = new ServerBackupV2Inner(); - this.serviceManager = serviceManager; - this.backupName = name; - } - - public ServerBackupV2Impl withBackupNameV2(String backupNameV2) { - this.innerModel().withBackupNameV2(backupNameV2); - return this; - } - - public ServerBackupV2Impl withBackupType(BackupType backupType) { - this.innerModel().withBackupType(backupType); - return this; - } - - public ServerBackupV2Impl withCompletedTime(OffsetDateTime completedTime) { - this.innerModel().withCompletedTime(completedTime); - return this; - } - - public ServerBackupV2Impl withSource(String source) { - this.innerModel().withSource(source); - return this; - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServerImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServerImpl.java index 601ad76ad9063..ca044f5d8bf52 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServerImpl.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServerImpl.java @@ -4,34 +4,27 @@ package com.azure.resourcemanager.mysqlflexibleserver.implementation; -import com.azure.core.http.rest.Response; import com.azure.core.management.Region; import com.azure.core.management.SystemData; import com.azure.core.util.Context; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.HighAvailabilityValidationEstimationInner; import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerInner; import com.azure.resourcemanager.mysqlflexibleserver.models.Backup; import com.azure.resourcemanager.mysqlflexibleserver.models.CreateMode; import com.azure.resourcemanager.mysqlflexibleserver.models.DataEncryption; import com.azure.resourcemanager.mysqlflexibleserver.models.HighAvailability; -import com.azure.resourcemanager.mysqlflexibleserver.models.HighAvailabilityValidationEstimation; -import com.azure.resourcemanager.mysqlflexibleserver.models.ImportSourceProperties; +import com.azure.resourcemanager.mysqlflexibleserver.models.Identity; import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceWindow; -import com.azure.resourcemanager.mysqlflexibleserver.models.MySqlServerIdentity; -import com.azure.resourcemanager.mysqlflexibleserver.models.MySqlServerSku; import com.azure.resourcemanager.mysqlflexibleserver.models.Network; -import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpointConnection; import com.azure.resourcemanager.mysqlflexibleserver.models.ReplicationRole; import com.azure.resourcemanager.mysqlflexibleserver.models.Server; import com.azure.resourcemanager.mysqlflexibleserver.models.ServerForUpdate; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerGtidSetParameter; import com.azure.resourcemanager.mysqlflexibleserver.models.ServerRestartParameter; import com.azure.resourcemanager.mysqlflexibleserver.models.ServerState; import com.azure.resourcemanager.mysqlflexibleserver.models.ServerVersion; +import com.azure.resourcemanager.mysqlflexibleserver.models.Sku; import com.azure.resourcemanager.mysqlflexibleserver.models.Storage; import java.time.OffsetDateTime; import java.util.Collections; -import java.util.List; import java.util.Map; public final class ServerImpl implements Server, Server.Definition, Server.Update { @@ -64,11 +57,11 @@ public Map tags() { } } - public MySqlServerIdentity identity() { + public Identity identity() { return this.innerModel().identity(); } - public MySqlServerSku sku() { + public Sku sku() { return this.innerModel().sku(); } @@ -140,23 +133,10 @@ public Network network() { return this.innerModel().network(); } - public List privateEndpointConnections() { - List inner = this.innerModel().privateEndpointConnections(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - public MaintenanceWindow maintenanceWindow() { return this.innerModel().maintenanceWindow(); } - public ImportSourceProperties importSourceProperties() { - return this.innerModel().importSourceProperties(); - } - public Region region() { return Region.fromName(this.regionName()); } @@ -258,17 +238,6 @@ public void failover(Context context) { serviceManager.servers().failover(resourceGroupName, serverName, context); } - public Response validateEstimateHighAvailabilityWithResponse( - HighAvailabilityValidationEstimationInner parameters, Context context) { - return serviceManager.servers() - .validateEstimateHighAvailabilityWithResponse(resourceGroupName, serverName, parameters, context); - } - - public HighAvailabilityValidationEstimation - validateEstimateHighAvailability(HighAvailabilityValidationEstimationInner parameters) { - return serviceManager.servers().validateEstimateHighAvailability(resourceGroupName, serverName, parameters); - } - public void restart(ServerRestartParameter parameters) { serviceManager.servers().restart(resourceGroupName, serverName, parameters); } @@ -293,14 +262,6 @@ public void stop(Context context) { serviceManager.servers().stop(resourceGroupName, serverName, context); } - public void resetGtid(ServerGtidSetParameter parameters) { - serviceManager.servers().resetGtid(resourceGroupName, serverName, parameters); - } - - public void resetGtid(ServerGtidSetParameter parameters, Context context) { - serviceManager.servers().resetGtid(resourceGroupName, serverName, parameters, context); - } - public ServerImpl withRegion(Region location) { this.innerModel().withLocation(location.toString()); return this; @@ -321,7 +282,7 @@ public ServerImpl withTags(Map tags) { } } - public ServerImpl withIdentity(MySqlServerIdentity identity) { + public ServerImpl withIdentity(Identity identity) { if (isInCreateMode()) { this.innerModel().withIdentity(identity); return this; @@ -331,7 +292,7 @@ public ServerImpl withIdentity(MySqlServerIdentity identity) { } } - public ServerImpl withSku(MySqlServerSku sku) { + public ServerImpl withSku(Sku sku) { if (isInCreateMode()) { this.innerModel().withSku(sku); return this; @@ -357,13 +318,8 @@ public ServerImpl withAdministratorLoginPassword(String administratorLoginPasswo } public ServerImpl withVersion(ServerVersion version) { - if (isInCreateMode()) { - this.innerModel().withVersion(version); - return this; - } else { - this.updateParameters.withVersion(version); - return this; - } + this.innerModel().withVersion(version); + return this; } public ServerImpl withAvailabilityZone(String availabilityZone) { @@ -437,17 +393,7 @@ public ServerImpl withHighAvailability(HighAvailability highAvailability) { } public ServerImpl withNetwork(Network network) { - if (isInCreateMode()) { - this.innerModel().withNetwork(network); - return this; - } else { - this.updateParameters.withNetwork(network); - return this; - } - } - - public ServerImpl withImportSourceProperties(ImportSourceProperties importSourceProperties) { - this.innerModel().withImportSourceProperties(importSourceProperties); + this.innerModel().withNetwork(network); return this; } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServersClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServersClientImpl.java index 90f4c558bc584..885a4c053a4b1 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServersClientImpl.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServersClientImpl.java @@ -34,10 +34,8 @@ import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.HighAvailabilityValidationEstimationInner; import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerInner; import com.azure.resourcemanager.mysqlflexibleserver.models.ServerForUpdate; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerGtidSetParameter; import com.azure.resourcemanager.mysqlflexibleserver.models.ServerListResult; import com.azure.resourcemanager.mysqlflexibleserver.models.ServerRestartParameter; import java.nio.ByteBuffer; @@ -139,17 +137,6 @@ Mono>> failover(@HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/validateEstimateHighAvailability") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> validateEstimateHighAvailability( - @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, - @BodyParam("application/json") HighAvailabilityValidationEstimationInner parameters, - @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/restart") @ExpectedResponses({ 200, 202 }) @@ -178,16 +165,6 @@ Mono>> stop(@HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/resetGtid") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> resetGtid(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, - @BodyParam("application/json") ServerGtidSetParameter parameters, @HeaderParam("Accept") String accept, - Context context); - @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -238,10 +215,9 @@ private Mono>> createWithResponseAsync(String resource } else { parameters.validate(); } - final String apiVersion = "2023-12-30"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.create(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, serverName, parameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -281,11 +257,10 @@ private Mono>> createWithResponseAsync(String resource } else { parameters.validate(); } - final String apiVersion = "2023-12-30"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.create(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - serverName, parameters, accept, context); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, serverName, parameters, accept, context); } /** @@ -468,10 +443,9 @@ private Mono>> updateWithResponseAsync(String resource } else { parameters.validate(); } - final String apiVersion = "2023-12-30"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, serverName, parameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -512,11 +486,10 @@ private Mono>> updateWithResponseAsync(String resource } else { parameters.validate(); } - final String apiVersion = "2023-12-30"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - serverName, parameters, accept, context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, serverName, parameters, accept, context); } /** @@ -700,10 +673,9 @@ private Mono>> deleteWithResponseAsync(String resource if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } - final String apiVersion = "2023-12-30"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, serverName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -737,11 +709,10 @@ private Mono>> deleteWithResponseAsync(String resource if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } - final String apiVersion = "2023-12-30"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - serverName, accept, context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, serverName, accept, context); } /** @@ -902,10 +873,9 @@ private Mono> getByResourceGroupWithResponseAsync(String r if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } - final String apiVersion = "2023-12-30"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, serverName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -939,11 +909,10 @@ private Mono> getByResourceGroupWithResponseAsync(String r if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } - final String apiVersion = "2023-12-30"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getByResourceGroup(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, serverName, accept, context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, accept, context); } /** @@ -1017,10 +986,9 @@ private Mono> listByResourceGroupSinglePageAsync(Stri return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - final String apiVersion = "2023-12-30"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) @@ -1052,12 +1020,11 @@ private Mono> listByResourceGroupSinglePageAsync(Stri return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - final String apiVersion = "2023-12-30"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByResourceGroup(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, accept, context) + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -1139,11 +1106,10 @@ private Mono> listSinglePageAsync() { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2023-12-30"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -1168,10 +1134,11 @@ private Mono> listSinglePageAsync(Context context) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2023-12-30"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -1256,10 +1223,9 @@ private Mono>> failoverWithResponseAsync(String resour if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } - final String apiVersion = "2023-12-30"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.failover(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.failover(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, serverName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1293,10 +1259,9 @@ private Mono>> failoverWithResponseAsync(String resour if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } - final String apiVersion = "2023-12-30"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.failover(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + return service.failover(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, serverName, accept, context); } @@ -1430,149 +1395,6 @@ public void failover(String resourceGroupName, String serverName, Context contex failoverAsync(resourceGroupName, serverName, context).block(); } - /** - * Validate a deployment of high availability. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for validation of high availability deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return high availability validation properties of a server along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> validateEstimateHighAvailabilityWithResponseAsync( - String resourceGroupName, String serverName, HighAvailabilityValidationEstimationInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2023-12-30"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.validateEstimateHighAvailability(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, serverName, parameters, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Validate a deployment of high availability. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for validation of high availability deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return high availability validation properties of a server along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> validateEstimateHighAvailabilityWithResponseAsync( - String resourceGroupName, String serverName, HighAvailabilityValidationEstimationInner parameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2023-12-30"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.validateEstimateHighAvailability(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, serverName, parameters, accept, context); - } - - /** - * Validate a deployment of high availability. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for validation of high availability deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return high availability validation properties of a server on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono validateEstimateHighAvailabilityAsync( - String resourceGroupName, String serverName, HighAvailabilityValidationEstimationInner parameters) { - return validateEstimateHighAvailabilityWithResponseAsync(resourceGroupName, serverName, parameters) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Validate a deployment of high availability. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for validation of high availability deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return high availability validation properties of a server along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response validateEstimateHighAvailabilityWithResponse( - String resourceGroupName, String serverName, HighAvailabilityValidationEstimationInner parameters, - Context context) { - return validateEstimateHighAvailabilityWithResponseAsync(resourceGroupName, serverName, parameters, context) - .block(); - } - - /** - * Validate a deployment of high availability. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for validation of high availability deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return high availability validation properties of a server. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public HighAvailabilityValidationEstimationInner validateEstimateHighAvailability(String resourceGroupName, - String serverName, HighAvailabilityValidationEstimationInner parameters) { - return validateEstimateHighAvailabilityWithResponse(resourceGroupName, serverName, parameters, Context.NONE) - .getValue(); - } - /** * Restarts a server. * @@ -1607,10 +1429,9 @@ private Mono>> restartWithResponseAsync(String resourc } else { parameters.validate(); } - final String apiVersion = "2023-12-30"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.restart(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.restart(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, serverName, parameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1650,10 +1471,9 @@ private Mono>> restartWithResponseAsync(String resourc } else { parameters.validate(); } - final String apiVersion = "2023-12-30"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.restart(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + return service.restart(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, serverName, parameters, accept, context); } @@ -1828,10 +1648,9 @@ private Mono>> startWithResponseAsync(String resourceG if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } - final String apiVersion = "2023-12-30"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.start(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.start(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, serverName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1865,11 +1684,10 @@ private Mono>> startWithResponseAsync(String resourceG if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } - final String apiVersion = "2023-12-30"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.start(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - serverName, accept, context); + return service.start(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, serverName, accept, context); } /** @@ -2028,11 +1846,10 @@ private Mono>> stopWithResponseAsync(String resourceGr if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } - final String apiVersion = "2023-12-30"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.stop(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, serverName, accept, context)) + .withContext(context -> service.stop(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serverName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -2065,11 +1882,10 @@ private Mono>> stopWithResponseAsync(String resourceGr if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } - final String apiVersion = "2023-12-30"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.stop(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - serverName, accept, context); + return service.stop(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, serverName, accept, context); } /** @@ -2201,234 +2017,6 @@ public void stop(String resourceGroupName, String serverName, Context context) { stopAsync(resourceGroupName, serverName, context).block(); } - /** - * Resets GTID on a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for resetting GTID on a server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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>> resetGtidWithResponseAsync(String resourceGroupName, String serverName, - ServerGtidSetParameter parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2023-12-30"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.resetGtid(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, serverName, parameters, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Resets GTID on a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for resetting GTID on a server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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>> resetGtidWithResponseAsync(String resourceGroupName, String serverName, - ServerGtidSetParameter parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2023-12-30"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.resetGtid(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, serverName, parameters, accept, context); - } - - /** - * Resets GTID on a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for resetting GTID on a server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is 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> beginResetGtidAsync(String resourceGroupName, String serverName, - ServerGtidSetParameter parameters) { - Mono>> mono = resetGtidWithResponseAsync(resourceGroupName, serverName, parameters); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Resets GTID on a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for resetting GTID on a server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is 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> beginResetGtidAsync(String resourceGroupName, String serverName, - ServerGtidSetParameter parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = resetGtidWithResponseAsync(resourceGroupName, serverName, parameters, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); - } - - /** - * Resets GTID on a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for resetting GTID on a server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked 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> beginResetGtid(String resourceGroupName, String serverName, - ServerGtidSetParameter parameters) { - return this.beginResetGtidAsync(resourceGroupName, serverName, parameters).getSyncPoller(); - } - - /** - * Resets GTID on a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for resetting GTID on a server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked 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> beginResetGtid(String resourceGroupName, String serverName, - ServerGtidSetParameter parameters, Context context) { - return this.beginResetGtidAsync(resourceGroupName, serverName, parameters, context).getSyncPoller(); - } - - /** - * Resets GTID on a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for resetting GTID on a server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 resetGtidAsync(String resourceGroupName, String serverName, ServerGtidSetParameter parameters) { - return beginResetGtidAsync(resourceGroupName, serverName, parameters).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Resets GTID on a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for resetting GTID on a server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 resetGtidAsync(String resourceGroupName, String serverName, ServerGtidSetParameter parameters, - Context context) { - return beginResetGtidAsync(resourceGroupName, serverName, parameters, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Resets GTID on a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for resetting GTID on a server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 resetGtid(String resourceGroupName, String serverName, ServerGtidSetParameter parameters) { - resetGtidAsync(resourceGroupName, serverName, parameters).block(); - } - - /** - * Resets GTID on a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for resetting GTID on a server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 resetGtid(String resourceGroupName, String serverName, ServerGtidSetParameter parameters, - Context context) { - resetGtidAsync(resourceGroupName, serverName, parameters, context).block(); - } - /** * Get the next page of items. * diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServersImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServersImpl.java index 191412501e483..bbfc5770775ab 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServersImpl.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServersImpl.java @@ -10,11 +10,8 @@ import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.HighAvailabilityValidationEstimationInner; import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.HighAvailabilityValidationEstimation; import com.azure.resourcemanager.mysqlflexibleserver.models.Server; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerGtidSetParameter; import com.azure.resourcemanager.mysqlflexibleserver.models.ServerRestartParameter; import com.azure.resourcemanager.mysqlflexibleserver.models.Servers; @@ -88,30 +85,6 @@ public void failover(String resourceGroupName, String serverName, Context contex this.serviceClient().failover(resourceGroupName, serverName, context); } - public Response validateEstimateHighAvailabilityWithResponse( - String resourceGroupName, String serverName, HighAvailabilityValidationEstimationInner parameters, - Context context) { - Response inner = this.serviceClient() - .validateEstimateHighAvailabilityWithResponse(resourceGroupName, serverName, parameters, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new HighAvailabilityValidationEstimationImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public HighAvailabilityValidationEstimation validateEstimateHighAvailability(String resourceGroupName, - String serverName, HighAvailabilityValidationEstimationInner parameters) { - HighAvailabilityValidationEstimationInner inner - = this.serviceClient().validateEstimateHighAvailability(resourceGroupName, serverName, parameters); - if (inner != null) { - return new HighAvailabilityValidationEstimationImpl(inner, this.manager()); - } else { - return null; - } - } - public void restart(String resourceGroupName, String serverName, ServerRestartParameter parameters) { this.serviceClient().restart(resourceGroupName, serverName, parameters); } @@ -137,15 +110,6 @@ public void stop(String resourceGroupName, String serverName, Context context) { this.serviceClient().stop(resourceGroupName, serverName, context); } - public void resetGtid(String resourceGroupName, String serverName, ServerGtidSetParameter parameters) { - this.serviceClient().resetGtid(resourceGroupName, serverName, parameters); - } - - public void resetGtid(String resourceGroupName, String serverName, ServerGtidSetParameter parameters, - Context context) { - this.serviceClient().resetGtid(resourceGroupName, serverName, parameters, context); - } - public Server getById(String id) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServersMigrationsClientImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServersMigrationsClientImpl.java deleted file mode 100644 index 6d8755649aeaf..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServersMigrationsClientImpl.java +++ /dev/null @@ -1,282 +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.mysqlflexibleserver.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.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.mysqlflexibleserver.fluent.ServersMigrationsClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerInner; -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 ServersMigrationsClient. - */ -public final class ServersMigrationsClientImpl implements ServersMigrationsClient { - /** - * The proxy service used to perform REST calls. - */ - private final ServersMigrationsService service; - - /** - * The service client containing this operation class. - */ - private final MySqlManagementClientImpl client; - - /** - * Initializes an instance of ServersMigrationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ServersMigrationsClientImpl(MySqlManagementClientImpl client) { - this.service - = RestProxy.create(ServersMigrationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MySqlManagementClientServersMigrations to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MySqlManagementClien") - public interface ServersMigrationsService { - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/cutoverMigration") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> cutoverMigration(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Cutover migration for MySQL import, it will switch source elastic server DNS to flexible server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a server along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> cutoverMigrationWithResponseAsync(String resourceGroupName, - String serverName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - final String apiVersion = "2023-12-30"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.cutoverMigration(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, serverName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Cutover migration for MySQL import, it will switch source elastic server DNS to flexible server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a server along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> cutoverMigrationWithResponseAsync(String resourceGroupName, - String serverName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - final String apiVersion = "2023-12-30"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.cutoverMigration(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, serverName, accept, context); - } - - /** - * Cutover migration for MySQL import, it will switch source elastic server DNS to flexible server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of represents a server. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ServerInner> beginCutoverMigrationAsync(String resourceGroupName, - String serverName) { - Mono>> mono = cutoverMigrationWithResponseAsync(resourceGroupName, serverName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ServerInner.class, ServerInner.class, this.client.getContext()); - } - - /** - * Cutover migration for MySQL import, it will switch source elastic server DNS to flexible server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of represents a server. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ServerInner> beginCutoverMigrationAsync(String resourceGroupName, - String serverName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = cutoverMigrationWithResponseAsync(resourceGroupName, serverName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ServerInner.class, ServerInner.class, context); - } - - /** - * Cutover migration for MySQL import, it will switch source elastic server DNS to flexible server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of represents a server. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ServerInner> beginCutoverMigration(String resourceGroupName, - String serverName) { - return this.beginCutoverMigrationAsync(resourceGroupName, serverName).getSyncPoller(); - } - - /** - * Cutover migration for MySQL import, it will switch source elastic server DNS to flexible server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of represents a server. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ServerInner> beginCutoverMigration(String resourceGroupName, - String serverName, Context context) { - return this.beginCutoverMigrationAsync(resourceGroupName, serverName, context).getSyncPoller(); - } - - /** - * Cutover migration for MySQL import, it will switch source elastic server DNS to flexible server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a server on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono cutoverMigrationAsync(String resourceGroupName, String serverName) { - return beginCutoverMigrationAsync(resourceGroupName, serverName).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Cutover migration for MySQL import, it will switch source elastic server DNS to flexible server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a server on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono cutoverMigrationAsync(String resourceGroupName, String serverName, Context context) { - return beginCutoverMigrationAsync(resourceGroupName, serverName, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Cutover migration for MySQL import, it will switch source elastic server DNS to flexible server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a server. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ServerInner cutoverMigration(String resourceGroupName, String serverName) { - return cutoverMigrationAsync(resourceGroupName, serverName).block(); - } - - /** - * Cutover migration for MySQL import, it will switch source elastic server DNS to flexible server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a server. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ServerInner cutoverMigration(String resourceGroupName, String serverName, Context context) { - return cutoverMigrationAsync(resourceGroupName, serverName, context).block(); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServersMigrationsImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServersMigrationsImpl.java deleted file mode 100644 index 448b2b695bde4..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ServersMigrationsImpl.java +++ /dev/null @@ -1,52 +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.mysqlflexibleserver.implementation; - -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.ServersMigrationsClient; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.Server; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServersMigrations; - -public final class ServersMigrationsImpl implements ServersMigrations { - private static final ClientLogger LOGGER = new ClientLogger(ServersMigrationsImpl.class); - - private final ServersMigrationsClient innerClient; - - private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; - - public ServersMigrationsImpl(ServersMigrationsClient innerClient, - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Server cutoverMigration(String resourceGroupName, String serverName) { - ServerInner inner = this.serviceClient().cutoverMigration(resourceGroupName, serverName); - if (inner != null) { - return new ServerImpl(inner, this.manager()); - } else { - return null; - } - } - - public Server cutoverMigration(String resourceGroupName, String serverName, Context context) { - ServerInner inner = this.serviceClient().cutoverMigration(resourceGroupName, serverName, context); - if (inner != null) { - return new ServerImpl(inner, this.manager()); - } else { - return null; - } - } - - private ServersMigrationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ValidateBackupResponseImpl.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ValidateBackupResponseImpl.java deleted file mode 100644 index a197d52ae8ddc..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/implementation/ValidateBackupResponseImpl.java +++ /dev/null @@ -1,32 +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.mysqlflexibleserver.implementation; - -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ValidateBackupResponseInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.ValidateBackupResponse; - -public final class ValidateBackupResponseImpl implements ValidateBackupResponse { - private ValidateBackupResponseInner innerObject; - - private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager; - - ValidateBackupResponseImpl(ValidateBackupResponseInner innerObject, - com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public Integer numberOfContainers() { - return this.innerModel().numberOfContainers(); - } - - public ValidateBackupResponseInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdministratorListResult.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdministratorListResult.java deleted file mode 100644 index b2683fa051f60..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdministratorListResult.java +++ /dev/null @@ -1,128 +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.mysqlflexibleserver.models; - -import com.azure.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.mysqlflexibleserver.fluent.models.AzureADAdministratorInner; -import java.io.IOException; -import java.util.List; - -/** - * A List of azure ad administrators. - */ -@Fluent -public final class AdministratorListResult implements JsonSerializable { - /* - * The list of azure ad administrator of a server - */ - private List value; - - /* - * The link used to get the next page of operations. - */ - private String nextLink; - - /** - * Creates an instance of AdministratorListResult class. - */ - public AdministratorListResult() { - } - - /** - * Get the value property: The list of azure ad administrator of a server. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of azure ad administrator of a server. - * - * @param value the value value to set. - * @return the AdministratorListResult object itself. - */ - public AdministratorListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The link used to get the next page of operations. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The link used to get the next page of operations. - * - * @param nextLink the nextLink value to set. - * @return the AdministratorListResult object itself. - */ - public AdministratorListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - - /** - * {@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 AdministratorListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AdministratorListResult if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IOException If an error occurs while reading the AdministratorListResult. - */ - public static AdministratorListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AdministratorListResult deserializedAdministratorListResult = new AdministratorListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> AzureADAdministratorInner.fromJson(reader1)); - deserializedAdministratorListResult.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedAdministratorListResult.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAdministratorListResult; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdministratorName.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdministratorName.java deleted file mode 100644 index dc950d24168ed..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdministratorName.java +++ /dev/null @@ -1,46 +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.mysqlflexibleserver.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Defines values for AdministratorName. - */ -public final class AdministratorName extends ExpandableStringEnum { - /** - * Static value ActiveDirectory for AdministratorName. - */ - public static final AdministratorName ACTIVE_DIRECTORY = fromString("ActiveDirectory"); - - /** - * Creates a new instance of AdministratorName value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AdministratorName() { - } - - /** - * Creates or finds a AdministratorName from its string representation. - * - * @param name a name to look for. - * @return the corresponding AdministratorName. - */ - public static AdministratorName fromString(String name) { - return fromString(name, AdministratorName.class); - } - - /** - * Gets known AdministratorName values. - * - * @return known AdministratorName values. - */ - public static Collection values() { - return values(AdministratorName.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdministratorType.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdministratorType.java deleted file mode 100644 index 07fd8e249c574..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdministratorType.java +++ /dev/null @@ -1,46 +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.mysqlflexibleserver.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Type of the sever administrator. - */ -public final class AdministratorType extends ExpandableStringEnum { - /** - * Static value ActiveDirectory for AdministratorType. - */ - public static final AdministratorType ACTIVE_DIRECTORY = fromString("ActiveDirectory"); - - /** - * Creates a new instance of AdministratorType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AdministratorType() { - } - - /** - * Creates or finds a AdministratorType from its string representation. - * - * @param name a name to look for. - * @return the corresponding AdministratorType. - */ - public static AdministratorType fromString(String name) { - return fromString(name, AdministratorType.class); - } - - /** - * Gets known AdministratorType values. - * - * @return known AdministratorType values. - */ - public static Collection values() { - return values(AdministratorType.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtection.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtection.java deleted file mode 100644 index f4415f7a71008..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtection.java +++ /dev/null @@ -1,71 +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.mysqlflexibleserver.models; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AdvancedThreatProtectionInner; -import java.time.OffsetDateTime; - -/** - * An immutable client-side representation of AdvancedThreatProtection. - */ -public interface AdvancedThreatProtection { - /** - * 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 creationTime property: Specifies the UTC creation time of the policy. - * - * @return the creationTime value. - */ - OffsetDateTime creationTime(); - - /** - * Gets the state property: Specifies the state of the Advanced Threat Protection, whether it is enabled or disabled - * or a state has not been applied yet on the specific database or server. - * - * @return the state value. - */ - AdvancedThreatProtectionState state(); - - /** - * Gets the provisioningState property: Provisioning state of the Threat Protection. - * - * @return the provisioningState value. - */ - AdvancedThreatProtectionProvisioningState provisioningState(); - - /** - * Gets the inner com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AdvancedThreatProtectionInner object. - * - * @return the inner object. - */ - AdvancedThreatProtectionInner innerModel(); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionForUpdate.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionForUpdate.java deleted file mode 100644 index b106214a27f85..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionForUpdate.java +++ /dev/null @@ -1,113 +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.mysqlflexibleserver.models; - -import com.azure.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.mysqlflexibleserver.fluent.models.AdvancedThreatProtectionUpdateProperties; -import java.io.IOException; - -/** - * Parameters allowed to update advanced threat protection for a server. - */ -@Fluent -public final class AdvancedThreatProtectionForUpdate implements JsonSerializable { - /* - * Resource update properties. - */ - private AdvancedThreatProtectionUpdateProperties innerProperties; - - /** - * Creates an instance of AdvancedThreatProtectionForUpdate class. - */ - public AdvancedThreatProtectionForUpdate() { - } - - /** - * Get the innerProperties property: Resource update properties. - * - * @return the innerProperties value. - */ - private AdvancedThreatProtectionUpdateProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the state property: Specifies the state of the Advanced Threat Protection, whether it is enabled or disabled - * or a state has not been applied yet on the specific database or server. - * - * @return the state value. - */ - public AdvancedThreatProtectionState state() { - return this.innerProperties() == null ? null : this.innerProperties().state(); - } - - /** - * Set the state property: Specifies the state of the Advanced Threat Protection, whether it is enabled or disabled - * or a state has not been applied yet on the specific database or server. - * - * @param state the state value to set. - * @return the AdvancedThreatProtectionForUpdate object itself. - */ - public AdvancedThreatProtectionForUpdate withState(AdvancedThreatProtectionState state) { - if (this.innerProperties() == null) { - this.innerProperties = new AdvancedThreatProtectionUpdateProperties(); - } - this.innerProperties().withState(state); - 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 AdvancedThreatProtectionForUpdate from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AdvancedThreatProtectionForUpdate if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the AdvancedThreatProtectionForUpdate. - */ - public static AdvancedThreatProtectionForUpdate fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AdvancedThreatProtectionForUpdate deserializedAdvancedThreatProtectionForUpdate - = new AdvancedThreatProtectionForUpdate(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("properties".equals(fieldName)) { - deserializedAdvancedThreatProtectionForUpdate.innerProperties - = AdvancedThreatProtectionUpdateProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAdvancedThreatProtectionForUpdate; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionListResult.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionListResult.java deleted file mode 100644 index 92cf11d8f4d5b..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionListResult.java +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.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.mysqlflexibleserver.fluent.models.AdvancedThreatProtectionInner; -import java.io.IOException; -import java.util.List; - -/** - * A list of the server's Advanced Threat Protection configurations. - */ -@Immutable -public final class AdvancedThreatProtectionListResult implements JsonSerializable { - /* - * Array of results. - */ - private List value; - - /* - * Link to retrieve next page of results. - */ - private String nextLink; - - /** - * Creates an instance of AdvancedThreatProtectionListResult class. - */ - public AdvancedThreatProtectionListResult() { - } - - /** - * Get the value property: Array of results. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: Link to retrieve next page of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AdvancedThreatProtectionListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AdvancedThreatProtectionListResult if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the AdvancedThreatProtectionListResult. - */ - public static AdvancedThreatProtectionListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AdvancedThreatProtectionListResult deserializedAdvancedThreatProtectionListResult - = new AdvancedThreatProtectionListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> AdvancedThreatProtectionInner.fromJson(reader1)); - deserializedAdvancedThreatProtectionListResult.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedAdvancedThreatProtectionListResult.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAdvancedThreatProtectionListResult; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionName.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionName.java deleted file mode 100644 index 023d0d7c35fd6..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionName.java +++ /dev/null @@ -1,46 +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.mysqlflexibleserver.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Defines values for AdvancedThreatProtectionName. - */ -public final class AdvancedThreatProtectionName extends ExpandableStringEnum { - /** - * Static value Default for AdvancedThreatProtectionName. - */ - public static final AdvancedThreatProtectionName DEFAULT = fromString("Default"); - - /** - * Creates a new instance of AdvancedThreatProtectionName value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AdvancedThreatProtectionName() { - } - - /** - * Creates or finds a AdvancedThreatProtectionName from its string representation. - * - * @param name a name to look for. - * @return the corresponding AdvancedThreatProtectionName. - */ - public static AdvancedThreatProtectionName fromString(String name) { - return fromString(name, AdvancedThreatProtectionName.class); - } - - /** - * Gets known AdvancedThreatProtectionName values. - * - * @return known AdvancedThreatProtectionName values. - */ - public static Collection values() { - return values(AdvancedThreatProtectionName.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionProvisioningState.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionProvisioningState.java deleted file mode 100644 index bbad474bf05fa..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionProvisioningState.java +++ /dev/null @@ -1,62 +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.mysqlflexibleserver.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The current provisioning state. - */ -public final class AdvancedThreatProtectionProvisioningState - extends ExpandableStringEnum { - /** - * Static value Succeeded for AdvancedThreatProtectionProvisioningState. - */ - public static final AdvancedThreatProtectionProvisioningState SUCCEEDED = fromString("Succeeded"); - - /** - * Static value Updating for AdvancedThreatProtectionProvisioningState. - */ - public static final AdvancedThreatProtectionProvisioningState UPDATING = fromString("Updating"); - - /** - * Static value Canceled for AdvancedThreatProtectionProvisioningState. - */ - public static final AdvancedThreatProtectionProvisioningState CANCELED = fromString("Canceled"); - - /** - * Static value Failed for AdvancedThreatProtectionProvisioningState. - */ - public static final AdvancedThreatProtectionProvisioningState FAILED = fromString("Failed"); - - /** - * Creates a new instance of AdvancedThreatProtectionProvisioningState value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AdvancedThreatProtectionProvisioningState() { - } - - /** - * Creates or finds a AdvancedThreatProtectionProvisioningState from its string representation. - * - * @param name a name to look for. - * @return the corresponding AdvancedThreatProtectionProvisioningState. - */ - public static AdvancedThreatProtectionProvisioningState fromString(String name) { - return fromString(name, AdvancedThreatProtectionProvisioningState.class); - } - - /** - * Gets known AdvancedThreatProtectionProvisioningState values. - * - * @return known AdvancedThreatProtectionProvisioningState values. - */ - public static Collection values() { - return values(AdvancedThreatProtectionProvisioningState.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionSettings.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionSettings.java deleted file mode 100644 index 638dbf4a1e8c6..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionSettings.java +++ /dev/null @@ -1,133 +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.mysqlflexibleserver.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AdvancedThreatProtectionInner; - -/** - * Resource collection API of AdvancedThreatProtectionSettings. - */ -public interface AdvancedThreatProtectionSettings { - /** - * Get a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a server's Advanced Threat Protection state along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String serverName, - AdvancedThreatProtectionName advancedThreatProtectionName, Context context); - - /** - * Get a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a server's Advanced Threat Protection state. - */ - AdvancedThreatProtection get(String resourceGroupName, String serverName, - AdvancedThreatProtectionName advancedThreatProtectionName); - - /** - * Updates a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param parameters The server's Advanced Threat Protection body to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a server's Advanced Threat Protection. - */ - AdvancedThreatProtection update(String resourceGroupName, String serverName, - AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionForUpdate parameters); - - /** - * Updates a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param parameters The server's Advanced Threat Protection body to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a server's Advanced Threat Protection. - */ - AdvancedThreatProtection update(String resourceGroupName, String serverName, - AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionForUpdate parameters, - Context context); - - /** - * Updates a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param parameters The server's Advanced Threat Protection body to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a server's Advanced Threat Protection. - */ - AdvancedThreatProtection updatePut(String resourceGroupName, String serverName, - AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionInner parameters); - - /** - * Updates a server's Advanced Threat Protection state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param advancedThreatProtectionName The name of the Advanced Threat Protection state. - * @param parameters The server's Advanced Threat Protection body to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a server's Advanced Threat Protection. - */ - AdvancedThreatProtection updatePut(String resourceGroupName, String serverName, - AdvancedThreatProtectionName advancedThreatProtectionName, AdvancedThreatProtectionInner parameters, - Context context); - - /** - * Gets a list of server's Advanced Threat Protection states. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 server's Advanced Threat Protection states as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String serverName); - - /** - * Gets a list of server's Advanced Threat Protection states. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 server's Advanced Threat Protection states as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String serverName, Context context); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionState.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionState.java deleted file mode 100644 index d8d4b6586bf4d..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AdvancedThreatProtectionState.java +++ /dev/null @@ -1,51 +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.mysqlflexibleserver.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Specifies the state of the Advanced Threat Protection, whether it is enabled or disabled on the server. - */ -public final class AdvancedThreatProtectionState extends ExpandableStringEnum { - /** - * Static value Enabled for AdvancedThreatProtectionState. - */ - public static final AdvancedThreatProtectionState ENABLED = fromString("Enabled"); - - /** - * Static value Disabled for AdvancedThreatProtectionState. - */ - public static final AdvancedThreatProtectionState DISABLED = fromString("Disabled"); - - /** - * Creates a new instance of AdvancedThreatProtectionState value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AdvancedThreatProtectionState() { - } - - /** - * Creates or finds a AdvancedThreatProtectionState from its string representation. - * - * @param name a name to look for. - * @return the corresponding AdvancedThreatProtectionState. - */ - public static AdvancedThreatProtectionState fromString(String name) { - return fromString(name, AdvancedThreatProtectionState.class); - } - - /** - * Gets known AdvancedThreatProtectionState values. - * - * @return known AdvancedThreatProtectionState values. - */ - public static Collection values() { - return values(AdvancedThreatProtectionState.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AzureADAdministrator.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AzureADAdministrator.java deleted file mode 100644 index 09121a32fbf32..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AzureADAdministrator.java +++ /dev/null @@ -1,323 +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.mysqlflexibleserver.models; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AzureADAdministratorInner; - -/** - * An immutable client-side representation of AzureADAdministrator. - */ -public interface AzureADAdministrator { - /** - * 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 administratorType property: Type of the sever administrator. - * - * @return the administratorType value. - */ - AdministratorType administratorType(); - - /** - * Gets the login property: Login name of the server administrator. - * - * @return the login value. - */ - String login(); - - /** - * Gets the sid property: SID (object ID) of the server administrator. - * - * @return the sid value. - */ - String sid(); - - /** - * Gets the tenantId property: Tenant ID of the administrator. - * - * @return the tenantId value. - */ - String tenantId(); - - /** - * Gets the identityResourceId property: The resource id of the identity used for AAD Authentication. - * - * @return the identityResourceId value. - */ - String identityResourceId(); - - /** - * Gets the name of the resource group. - * - * @return the name of the resource group. - */ - String resourceGroupName(); - - /** - * Gets the inner com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AzureADAdministratorInner object. - * - * @return the inner object. - */ - AzureADAdministratorInner innerModel(); - - /** - * The entirety of the AzureADAdministrator definition. - */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { - } - - /** - * The AzureADAdministrator definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the AzureADAdministrator definition. - */ - interface Blank extends WithParentResource { - } - - /** - * The stage of the AzureADAdministrator definition allowing to specify parent resource. - */ - interface WithParentResource { - /** - * Specifies resourceGroupName, serverName. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @return the next definition stage. - */ - WithCreate withExistingFlexibleServer(String resourceGroupName, String serverName); - } - - /** - * The stage of the AzureADAdministrator 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.WithAdministratorType, DefinitionStages.WithLogin, - DefinitionStages.WithSid, DefinitionStages.WithTenantId, DefinitionStages.WithIdentityResourceId { - /** - * Executes the create request. - * - * @return the created resource. - */ - AzureADAdministrator create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - AzureADAdministrator create(Context context); - } - - /** - * The stage of the AzureADAdministrator definition allowing to specify administratorType. - */ - interface WithAdministratorType { - /** - * Specifies the administratorType property: Type of the sever administrator.. - * - * @param administratorType Type of the sever administrator. - * @return the next definition stage. - */ - WithCreate withAdministratorType(AdministratorType administratorType); - } - - /** - * The stage of the AzureADAdministrator definition allowing to specify login. - */ - interface WithLogin { - /** - * Specifies the login property: Login name of the server administrator.. - * - * @param login Login name of the server administrator. - * @return the next definition stage. - */ - WithCreate withLogin(String login); - } - - /** - * The stage of the AzureADAdministrator definition allowing to specify sid. - */ - interface WithSid { - /** - * Specifies the sid property: SID (object ID) of the server administrator.. - * - * @param sid SID (object ID) of the server administrator. - * @return the next definition stage. - */ - WithCreate withSid(String sid); - } - - /** - * The stage of the AzureADAdministrator definition allowing to specify tenantId. - */ - interface WithTenantId { - /** - * Specifies the tenantId property: Tenant ID of the administrator.. - * - * @param tenantId Tenant ID of the administrator. - * @return the next definition stage. - */ - WithCreate withTenantId(String tenantId); - } - - /** - * The stage of the AzureADAdministrator definition allowing to specify identityResourceId. - */ - interface WithIdentityResourceId { - /** - * Specifies the identityResourceId property: The resource id of the identity used for AAD Authentication.. - * - * @param identityResourceId The resource id of the identity used for AAD Authentication. - * @return the next definition stage. - */ - WithCreate withIdentityResourceId(String identityResourceId); - } - } - - /** - * Begins update for the AzureADAdministrator resource. - * - * @return the stage of resource update. - */ - AzureADAdministrator.Update update(); - - /** - * The template for AzureADAdministrator update. - */ - interface Update extends UpdateStages.WithAdministratorType, UpdateStages.WithLogin, UpdateStages.WithSid, - UpdateStages.WithTenantId, UpdateStages.WithIdentityResourceId { - /** - * Executes the update request. - * - * @return the updated resource. - */ - AzureADAdministrator apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - AzureADAdministrator apply(Context context); - } - - /** - * The AzureADAdministrator update stages. - */ - interface UpdateStages { - /** - * The stage of the AzureADAdministrator update allowing to specify administratorType. - */ - interface WithAdministratorType { - /** - * Specifies the administratorType property: Type of the sever administrator.. - * - * @param administratorType Type of the sever administrator. - * @return the next definition stage. - */ - Update withAdministratorType(AdministratorType administratorType); - } - - /** - * The stage of the AzureADAdministrator update allowing to specify login. - */ - interface WithLogin { - /** - * Specifies the login property: Login name of the server administrator.. - * - * @param login Login name of the server administrator. - * @return the next definition stage. - */ - Update withLogin(String login); - } - - /** - * The stage of the AzureADAdministrator update allowing to specify sid. - */ - interface WithSid { - /** - * Specifies the sid property: SID (object ID) of the server administrator.. - * - * @param sid SID (object ID) of the server administrator. - * @return the next definition stage. - */ - Update withSid(String sid); - } - - /** - * The stage of the AzureADAdministrator update allowing to specify tenantId. - */ - interface WithTenantId { - /** - * Specifies the tenantId property: Tenant ID of the administrator.. - * - * @param tenantId Tenant ID of the administrator. - * @return the next definition stage. - */ - Update withTenantId(String tenantId); - } - - /** - * The stage of the AzureADAdministrator update allowing to specify identityResourceId. - */ - interface WithIdentityResourceId { - /** - * Specifies the identityResourceId property: The resource id of the identity used for AAD Authentication.. - * - * @param identityResourceId The resource id of the identity used for AAD Authentication. - * @return the next definition stage. - */ - Update withIdentityResourceId(String identityResourceId); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - AzureADAdministrator refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - AzureADAdministrator refresh(Context context); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AzureADAdministrators.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AzureADAdministrators.java deleted file mode 100644 index d4f1d6c81043e..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/AzureADAdministrators.java +++ /dev/null @@ -1,144 +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.mysqlflexibleserver.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 AzureADAdministrators. - */ -public interface AzureADAdministrators { - /** - * Deletes an Azure AD Administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 serverName, AdministratorName administratorName); - - /** - * Deletes an Azure AD Administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 serverName, AdministratorName administratorName, Context context); - - /** - * Gets information about an azure ad administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about an azure ad administrator along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String serverName, - AdministratorName administratorName, Context context); - - /** - * Gets information about an azure ad administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param administratorName The name of the Azure AD Administrator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about an azure ad administrator. - */ - AzureADAdministrator get(String resourceGroupName, String serverName, AdministratorName administratorName); - - /** - * List all the AAD administrators in a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 azure ad administrators as paginated response with {@link PagedIterable}. - */ - PagedIterable listByServer(String resourceGroupName, String serverName); - - /** - * List all the AAD administrators in a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 azure ad administrators as paginated response with {@link PagedIterable}. - */ - PagedIterable listByServer(String resourceGroupName, String serverName, Context context); - - /** - * Gets information about an azure ad administrator. - * - * @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 information about an azure ad administrator along with {@link Response}. - */ - AzureADAdministrator getById(String id); - - /** - * Gets information about an azure ad administrator. - * - * @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 information about an azure ad administrator along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Deletes an Azure AD Administrator. - * - * @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); - - /** - * Deletes an Azure AD Administrator. - * - * @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 AzureADAdministrator resource. - * - * @param name resource name. - * @return the first stage of the new AzureADAdministrator definition. - */ - AzureADAdministrator.DefinitionStages.Blank define(AdministratorName name); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Backup.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Backup.java index 59689fe7b872c..236dec961dcd4 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Backup.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Backup.java @@ -23,11 +23,6 @@ public final class Backup implements JsonSerializable { */ private Integer backupRetentionDays; - /* - * Backup interval hours for the server. - */ - private Integer backupIntervalHours; - /* * Whether or not geo redundant backup is enabled. */ @@ -64,26 +59,6 @@ public Backup withBackupRetentionDays(Integer backupRetentionDays) { return this; } - /** - * Get the backupIntervalHours property: Backup interval hours for the server. - * - * @return the backupIntervalHours value. - */ - public Integer backupIntervalHours() { - return this.backupIntervalHours; - } - - /** - * Set the backupIntervalHours property: Backup interval hours for the server. - * - * @param backupIntervalHours the backupIntervalHours value to set. - * @return the Backup object itself. - */ - public Backup withBackupIntervalHours(Integer backupIntervalHours) { - this.backupIntervalHours = backupIntervalHours; - return this; - } - /** * Get the geoRedundantBackup property: Whether or not geo redundant backup is enabled. * @@ -128,7 +103,6 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeNumberField("backupRetentionDays", this.backupRetentionDays); - jsonWriter.writeNumberField("backupIntervalHours", this.backupIntervalHours); jsonWriter.writeStringField("geoRedundantBackup", this.geoRedundantBackup == null ? null : this.geoRedundantBackup.toString()); return jsonWriter.writeEndObject(); @@ -151,8 +125,6 @@ public static Backup fromJson(JsonReader jsonReader) throws IOException { if ("backupRetentionDays".equals(fieldName)) { deserializedBackup.backupRetentionDays = reader.getNullable(JsonReader::getInt); - } else if ("backupIntervalHours".equals(fieldName)) { - deserializedBackup.backupIntervalHours = reader.getNullable(JsonReader::getInt); } else if ("geoRedundantBackup".equals(fieldName)) { deserializedBackup.geoRedundantBackup = EnableStatusEnum.fromString(reader.getString()); } else if ("earliestRestoreDate".equals(fieldName)) { diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupAndExportRequest.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupAndExportRequest.java deleted file mode 100644 index ac921396d9333..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupAndExportRequest.java +++ /dev/null @@ -1,123 +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.mysqlflexibleserver.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * BackupAndExport API Request. - */ -@Fluent -public final class BackupAndExportRequest extends BackupRequestBase { - /* - * Backup Target Store Details - */ - private BackupStoreDetails targetDetails; - - /** - * Creates an instance of BackupAndExportRequest class. - */ - public BackupAndExportRequest() { - } - - /** - * Get the targetDetails property: Backup Target Store Details. - * - * @return the targetDetails value. - */ - public BackupStoreDetails targetDetails() { - return this.targetDetails; - } - - /** - * Set the targetDetails property: Backup Target Store Details. - * - * @param targetDetails the targetDetails value to set. - * @return the BackupAndExportRequest object itself. - */ - public BackupAndExportRequest withTargetDetails(BackupStoreDetails targetDetails) { - this.targetDetails = targetDetails; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public BackupAndExportRequest withBackupSettings(BackupSettings backupSettings) { - super.withBackupSettings(backupSettings); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (targetDetails() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property targetDetails in model BackupAndExportRequest")); - } else { - targetDetails().validate(); - } - if (backupSettings() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property backupSettings in model BackupAndExportRequest")); - } else { - backupSettings().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(BackupAndExportRequest.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("backupSettings", backupSettings()); - jsonWriter.writeJsonField("targetDetails", this.targetDetails); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of BackupAndExportRequest from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of BackupAndExportRequest if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the BackupAndExportRequest. - */ - public static BackupAndExportRequest fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - BackupAndExportRequest deserializedBackupAndExportRequest = new BackupAndExportRequest(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("backupSettings".equals(fieldName)) { - deserializedBackupAndExportRequest.withBackupSettings(BackupSettings.fromJson(reader)); - } else if ("targetDetails".equals(fieldName)) { - deserializedBackupAndExportRequest.targetDetails = BackupStoreDetails.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedBackupAndExportRequest; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupAndExportResponse.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupAndExportResponse.java deleted file mode 100644 index 199b0c5422b97..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupAndExportResponse.java +++ /dev/null @@ -1,107 +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.mysqlflexibleserver.models; - -import com.azure.core.management.SystemData; -import com.azure.core.management.exception.ManagementError; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.BackupAndExportResponseInner; -import java.time.OffsetDateTime; - -/** - * An immutable client-side representation of BackupAndExportResponse. - */ -public interface BackupAndExportResponse { - /** - * 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 status property: The operation status. - * - * @return the status value. - */ - OperationStatus status(); - - /** - * Gets the startTime property: Start time. - * - * @return the startTime value. - */ - OffsetDateTime startTime(); - - /** - * Gets the endTime property: End time. - * - * @return the endTime value. - */ - OffsetDateTime endTime(); - - /** - * Gets the percentComplete property: Operation progress (0-100). - * - * @return the percentComplete value. - */ - Double percentComplete(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the error property: The error object. - * - * @return the error value. - */ - ManagementError error(); - - /** - * Gets the datasourceSizeInBytes property: Size of datasource in bytes. - * - * @return the datasourceSizeInBytes value. - */ - Long datasourceSizeInBytes(); - - /** - * Gets the dataTransferredInBytes property: Data transferred in bytes. - * - * @return the dataTransferredInBytes value. - */ - Long dataTransferredInBytes(); - - /** - * Gets the backupMetadata property: Metadata related to backup to be stored for restoring resource in key-value - * pairs. - * - * @return the backupMetadata value. - */ - String backupMetadata(); - - /** - * Gets the inner com.azure.resourcemanager.mysqlflexibleserver.fluent.models.BackupAndExportResponseInner object. - * - * @return the inner object. - */ - BackupAndExportResponseInner innerModel(); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupAndExportResponseType.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupAndExportResponseType.java deleted file mode 100644 index 47534c95a6f19..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupAndExportResponseType.java +++ /dev/null @@ -1,171 +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.mysqlflexibleserver.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; - -/** - * BackupAndExport Response Properties. - */ -@Fluent -public final class BackupAndExportResponseType extends OperationProgressResponseType { - /* - * Identifies the type of source operation - */ - private ObjectType objectType = ObjectType.BACKUP_AND_EXPORT_RESPONSE; - - /* - * Size of datasource in bytes - */ - private Long datasourceSizeInBytes; - - /* - * Data transferred in bytes - */ - private Long dataTransferredInBytes; - - /* - * Metadata related to backup to be stored for restoring resource in key-value pairs. - */ - private String backupMetadata; - - /** - * Creates an instance of BackupAndExportResponseType class. - */ - public BackupAndExportResponseType() { - } - - /** - * Get the objectType property: Identifies the type of source operation. - * - * @return the objectType value. - */ - @Override - public ObjectType objectType() { - return this.objectType; - } - - /** - * Get the datasourceSizeInBytes property: Size of datasource in bytes. - * - * @return the datasourceSizeInBytes value. - */ - public Long datasourceSizeInBytes() { - return this.datasourceSizeInBytes; - } - - /** - * Set the datasourceSizeInBytes property: Size of datasource in bytes. - * - * @param datasourceSizeInBytes the datasourceSizeInBytes value to set. - * @return the BackupAndExportResponseType object itself. - */ - public BackupAndExportResponseType withDatasourceSizeInBytes(Long datasourceSizeInBytes) { - this.datasourceSizeInBytes = datasourceSizeInBytes; - return this; - } - - /** - * Get the dataTransferredInBytes property: Data transferred in bytes. - * - * @return the dataTransferredInBytes value. - */ - public Long dataTransferredInBytes() { - return this.dataTransferredInBytes; - } - - /** - * Set the dataTransferredInBytes property: Data transferred in bytes. - * - * @param dataTransferredInBytes the dataTransferredInBytes value to set. - * @return the BackupAndExportResponseType object itself. - */ - public BackupAndExportResponseType withDataTransferredInBytes(Long dataTransferredInBytes) { - this.dataTransferredInBytes = dataTransferredInBytes; - return this; - } - - /** - * Get the backupMetadata property: Metadata related to backup to be stored for restoring resource in key-value - * pairs. - * - * @return the backupMetadata value. - */ - public String backupMetadata() { - return this.backupMetadata; - } - - /** - * Set the backupMetadata property: Metadata related to backup to be stored for restoring resource in key-value - * pairs. - * - * @param backupMetadata the backupMetadata value to set. - * @return the BackupAndExportResponseType object itself. - */ - public BackupAndExportResponseType withBackupMetadata(String backupMetadata) { - this.backupMetadata = backupMetadata; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("objectType", this.objectType == null ? null : this.objectType.toString()); - jsonWriter.writeNumberField("datasourceSizeInBytes", this.datasourceSizeInBytes); - jsonWriter.writeNumberField("dataTransferredInBytes", this.dataTransferredInBytes); - jsonWriter.writeStringField("backupMetadata", this.backupMetadata); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of BackupAndExportResponseType from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of BackupAndExportResponseType if the JsonReader was pointing to an instance of it, or null - * if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the BackupAndExportResponseType. - */ - public static BackupAndExportResponseType fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - BackupAndExportResponseType deserializedBackupAndExportResponseType = new BackupAndExportResponseType(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("objectType".equals(fieldName)) { - deserializedBackupAndExportResponseType.objectType = ObjectType.fromString(reader.getString()); - } else if ("datasourceSizeInBytes".equals(fieldName)) { - deserializedBackupAndExportResponseType.datasourceSizeInBytes - = reader.getNullable(JsonReader::getLong); - } else if ("dataTransferredInBytes".equals(fieldName)) { - deserializedBackupAndExportResponseType.dataTransferredInBytes - = reader.getNullable(JsonReader::getLong); - } else if ("backupMetadata".equals(fieldName)) { - deserializedBackupAndExportResponseType.backupMetadata = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedBackupAndExportResponseType; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupAndExports.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupAndExports.java deleted file mode 100644 index d1244651847ce..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupAndExports.java +++ /dev/null @@ -1,67 +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.mysqlflexibleserver.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of BackupAndExports. - */ -public interface BackupAndExports { - /** - * Exports the backup of the given server by creating a backup if not existing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for creating and exporting backup of the given server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents BackupAndExport API Response. - */ - BackupAndExportResponse create(String resourceGroupName, String serverName, BackupAndExportRequest parameters); - - /** - * Exports the backup of the given server by creating a backup if not existing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for creating and exporting backup of the given server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents BackupAndExport API Response. - */ - BackupAndExportResponse create(String resourceGroupName, String serverName, BackupAndExportRequest parameters, - Context context); - - /** - * Validates if backup can be performed for given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents ValidateBackup API Response along with {@link Response}. - */ - Response validateBackupWithResponse(String resourceGroupName, String serverName, - Context context); - - /** - * Validates if backup can be performed for given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents ValidateBackup API Response. - */ - ValidateBackupResponse validateBackup(String resourceGroupName, String serverName); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupFormat.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupFormat.java deleted file mode 100644 index 74a26620dc094..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupFormat.java +++ /dev/null @@ -1,51 +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.mysqlflexibleserver.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Backup Format for the current backup. (CollatedFormat is INTERNAL – DO NOT USE). - */ -public final class BackupFormat extends ExpandableStringEnum { - /** - * Static value CollatedFormat for BackupFormat. - */ - public static final BackupFormat COLLATED_FORMAT = fromString("CollatedFormat"); - - /** - * Static value Raw for BackupFormat. - */ - public static final BackupFormat RAW = fromString("Raw"); - - /** - * Creates a new instance of BackupFormat value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public BackupFormat() { - } - - /** - * Creates or finds a BackupFormat from its string representation. - * - * @param name a name to look for. - * @return the corresponding BackupFormat. - */ - public static BackupFormat fromString(String name) { - return fromString(name, BackupFormat.class); - } - - /** - * Gets known BackupFormat values. - * - * @return known BackupFormat values. - */ - public static Collection values() { - return values(BackupFormat.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupRequestBase.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupRequestBase.java deleted file mode 100644 index 2fababa3850c1..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupRequestBase.java +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.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; - -/** - * BackupRequestBase is the base for all backup request. - */ -@Fluent -public class BackupRequestBase implements JsonSerializable { - /* - * Backup Settings - */ - private BackupSettings backupSettings; - - /** - * Creates an instance of BackupRequestBase class. - */ - public BackupRequestBase() { - } - - /** - * Get the backupSettings property: Backup Settings. - * - * @return the backupSettings value. - */ - public BackupSettings backupSettings() { - return this.backupSettings; - } - - /** - * Set the backupSettings property: Backup Settings. - * - * @param backupSettings the backupSettings value to set. - * @return the BackupRequestBase object itself. - */ - public BackupRequestBase withBackupSettings(BackupSettings backupSettings) { - this.backupSettings = backupSettings; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (backupSettings() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property backupSettings in model BackupRequestBase")); - } else { - backupSettings().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(BackupRequestBase.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("backupSettings", this.backupSettings); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of BackupRequestBase from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of BackupRequestBase if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the BackupRequestBase. - */ - public static BackupRequestBase fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - BackupRequestBase deserializedBackupRequestBase = new BackupRequestBase(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("backupSettings".equals(fieldName)) { - deserializedBackupRequestBase.backupSettings = BackupSettings.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedBackupRequestBase; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupSettings.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupSettings.java deleted file mode 100644 index 7660a3e76f57a..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupSettings.java +++ /dev/null @@ -1,129 +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.mysqlflexibleserver.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; - -/** - * Backup Settings. - */ -@Fluent -public final class BackupSettings implements JsonSerializable { - /* - * The name of the backup. - */ - private String backupName; - - /* - * Backup Format for the current backup. (CollatedFormat is INTERNAL – DO NOT USE) - */ - private BackupFormat backupFormat; - - /** - * Creates an instance of BackupSettings class. - */ - public BackupSettings() { - } - - /** - * Get the backupName property: The name of the backup. - * - * @return the backupName value. - */ - public String backupName() { - return this.backupName; - } - - /** - * Set the backupName property: The name of the backup. - * - * @param backupName the backupName value to set. - * @return the BackupSettings object itself. - */ - public BackupSettings withBackupName(String backupName) { - this.backupName = backupName; - return this; - } - - /** - * Get the backupFormat property: Backup Format for the current backup. (CollatedFormat is INTERNAL – DO NOT USE). - * - * @return the backupFormat value. - */ - public BackupFormat backupFormat() { - return this.backupFormat; - } - - /** - * Set the backupFormat property: Backup Format for the current backup. (CollatedFormat is INTERNAL – DO NOT USE). - * - * @param backupFormat the backupFormat value to set. - * @return the BackupSettings object itself. - */ - public BackupSettings withBackupFormat(BackupFormat backupFormat) { - this.backupFormat = backupFormat; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (backupName() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property backupName in model BackupSettings")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(BackupSettings.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("backupName", this.backupName); - jsonWriter.writeStringField("backupFormat", this.backupFormat == null ? null : this.backupFormat.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of BackupSettings from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of BackupSettings if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the BackupSettings. - */ - public static BackupSettings fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - BackupSettings deserializedBackupSettings = new BackupSettings(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("backupName".equals(fieldName)) { - deserializedBackupSettings.backupName = reader.getString(); - } else if ("backupFormat".equals(fieldName)) { - deserializedBackupSettings.backupFormat = BackupFormat.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedBackupSettings; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupStoreDetails.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupStoreDetails.java deleted file mode 100644 index d03ce96d022f1..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupStoreDetails.java +++ /dev/null @@ -1,107 +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.mysqlflexibleserver.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; - -/** - * Details about the target where the backup content will be stored. - */ -@Immutable -public class BackupStoreDetails implements JsonSerializable { - /* - * Type of the specific object - used for deserializing - */ - private String objectType = "BackupStoreDetails"; - - /** - * Creates an instance of BackupStoreDetails class. - */ - public BackupStoreDetails() { - } - - /** - * Get the objectType property: Type of the specific object - used for deserializing. - * - * @return the objectType value. - */ - public String objectType() { - return this.objectType; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("objectType", this.objectType); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of BackupStoreDetails from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of BackupStoreDetails if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the BackupStoreDetails. - */ - public static BackupStoreDetails 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 ("objectType".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("FullBackupStoreDetails".equals(discriminatorValue)) { - return FullBackupStoreDetails.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static BackupStoreDetails fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - BackupStoreDetails deserializedBackupStoreDetails = new BackupStoreDetails(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("objectType".equals(fieldName)) { - deserializedBackupStoreDetails.objectType = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedBackupStoreDetails; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupType.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupType.java deleted file mode 100644 index 262cd8fd319e8..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/BackupType.java +++ /dev/null @@ -1,46 +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.mysqlflexibleserver.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Defines values for BackupType. - */ -public final class BackupType extends ExpandableStringEnum { - /** - * Static value FULL for BackupType. - */ - public static final BackupType FULL = fromString("FULL"); - - /** - * Creates a new instance of BackupType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public BackupType() { - } - - /** - * Creates or finds a BackupType from its string representation. - * - * @param name a name to look for. - * @return the corresponding BackupType. - */ - public static BackupType fromString(String name) { - return fromString(name, BackupType.class); - } - - /** - * Gets known BackupType values. - * - * @return known BackupType values. - */ - public static Collection values() { - return values(BackupType.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Backups.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Backups.java index 0009b2c7b3bba..45ff69d4c2ab9 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Backups.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Backups.java @@ -12,34 +12,6 @@ * Resource collection API of Backups. */ public interface Backups { - /** - * Create backup for a given server with specified backup name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param backupName The name of the backup. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return server backup properties along with {@link Response}. - */ - Response putWithResponse(String resourceGroupName, String serverName, String backupName, - Context context); - - /** - * Create backup for a given server with specified backup name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param backupName The name of the backup. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return server backup properties. - */ - ServerBackup put(String resourceGroupName, String serverName, String backupName); - /** * List all the backups for a given server. * diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Capability.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Capability.java deleted file mode 100644 index 51ea78ecbaf99..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Capability.java +++ /dev/null @@ -1,70 +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.mysqlflexibleserver.models; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.CapabilityInner; -import java.util.List; - -/** - * An immutable client-side representation of Capability. - */ -public interface Capability { - /** - * 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 supportedGeoBackupRegions property: supported geo backup regions. - * - * @return the supportedGeoBackupRegions value. - */ - List supportedGeoBackupRegions(); - - /** - * Gets the supportedFlexibleServerEditions property: A list of supported flexible server editions. - * - * @return the supportedFlexibleServerEditions value. - */ - List supportedFlexibleServerEditions(); - - /** - * Gets the supportedServerVersions property: A list of supported server versions. - * - * @return the supportedServerVersions value. - */ - List supportedServerVersions(); - - /** - * Gets the inner com.azure.resourcemanager.mysqlflexibleserver.fluent.models.CapabilityInner object. - * - * @return the inner object. - */ - CapabilityInner innerModel(); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/CapabilitySetsList.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/CapabilitySetsList.java deleted file mode 100644 index ba7148299164c..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/CapabilitySetsList.java +++ /dev/null @@ -1,103 +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.mysqlflexibleserver.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.mysqlflexibleserver.fluent.models.CapabilityInner; -import java.io.IOException; -import java.util.List; - -/** - * location capability set. - */ -@Immutable -public final class CapabilitySetsList implements JsonSerializable { - /* - * A list of supported capability sets. - */ - private List value; - - /* - * Link to retrieve next page of results. - */ - private String nextLink; - - /** - * Creates an instance of CapabilitySetsList class. - */ - public CapabilitySetsList() { - } - - /** - * Get the value property: A list of supported capability sets. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: Link to retrieve next page of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CapabilitySetsList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CapabilitySetsList if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the CapabilitySetsList. - */ - public static CapabilitySetsList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CapabilitySetsList deserializedCapabilitySetsList = new CapabilitySetsList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> CapabilityInner.fromJson(reader1)); - deserializedCapabilitySetsList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedCapabilitySetsList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedCapabilitySetsList; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Configuration.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Configuration.java index bbd0927deed50..037b36f883c15 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Configuration.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Configuration.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.mysqlflexibleserver.models; import com.azure.core.management.SystemData; -import com.azure.core.util.Context; import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ConfigurationInner; /** @@ -34,7 +33,7 @@ public interface Configuration { String type(); /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * Gets the systemData property: The system metadata relating to this resource. * * @return the systemData value. */ @@ -47,13 +46,6 @@ public interface Configuration { */ String value(); - /** - * Gets the currentValue property: Current value of the configuration. - * - * @return the currentValue value. - */ - String currentValue(); - /** * Gets the description property: Description of the configuration. * @@ -61,13 +53,6 @@ public interface Configuration { */ String description(); - /** - * Gets the documentationLink property: The link used to get the document from community or Azure site. - * - * @return the documentationLink value. - */ - String documentationLink(); - /** * Gets the defaultValue property: Default value of the configuration. * @@ -117,196 +102,10 @@ public interface Configuration { */ IsDynamicConfig isDynamicConfig(); - /** - * Gets the name of the resource group. - * - * @return the name of the resource group. - */ - String resourceGroupName(); - /** * Gets the inner com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ConfigurationInner object. * * @return the inner object. */ ConfigurationInner innerModel(); - - /** - * The entirety of the Configuration definition. - */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { - } - - /** - * The Configuration definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the Configuration definition. - */ - interface Blank extends WithParentResource { - } - - /** - * The stage of the Configuration definition allowing to specify parent resource. - */ - interface WithParentResource { - /** - * Specifies resourceGroupName, serverName. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @return the next definition stage. - */ - WithCreate withExistingFlexibleServer(String resourceGroupName, String serverName); - } - - /** - * The stage of the Configuration 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.WithValue, DefinitionStages.WithCurrentValue, DefinitionStages.WithSource { - /** - * Executes the create request. - * - * @return the created resource. - */ - Configuration create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - Configuration create(Context context); - } - - /** - * The stage of the Configuration definition allowing to specify value. - */ - interface WithValue { - /** - * Specifies the value property: Value of the configuration.. - * - * @param value Value of the configuration. - * @return the next definition stage. - */ - WithCreate withValue(String value); - } - - /** - * The stage of the Configuration definition allowing to specify currentValue. - */ - interface WithCurrentValue { - /** - * Specifies the currentValue property: Current value of the configuration.. - * - * @param currentValue Current value of the configuration. - * @return the next definition stage. - */ - WithCreate withCurrentValue(String currentValue); - } - - /** - * The stage of the Configuration definition allowing to specify source. - */ - interface WithSource { - /** - * Specifies the source property: Source of the configuration.. - * - * @param source Source of the configuration. - * @return the next definition stage. - */ - WithCreate withSource(ConfigurationSource source); - } - } - - /** - * Begins update for the Configuration resource. - * - * @return the stage of resource update. - */ - Configuration.Update update(); - - /** - * The template for Configuration update. - */ - interface Update extends UpdateStages.WithValue, UpdateStages.WithCurrentValue, UpdateStages.WithSource { - /** - * Executes the update request. - * - * @return the updated resource. - */ - Configuration apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - Configuration apply(Context context); - } - - /** - * The Configuration update stages. - */ - interface UpdateStages { - /** - * The stage of the Configuration update allowing to specify value. - */ - interface WithValue { - /** - * Specifies the value property: Value of the configuration.. - * - * @param value Value of the configuration. - * @return the next definition stage. - */ - Update withValue(String value); - } - - /** - * The stage of the Configuration update allowing to specify currentValue. - */ - interface WithCurrentValue { - /** - * Specifies the currentValue property: Current value of the configuration.. - * - * @param currentValue Current value of the configuration. - * @return the next definition stage. - */ - Update withCurrentValue(String currentValue); - } - - /** - * The stage of the Configuration update allowing to specify source. - */ - interface WithSource { - /** - * Specifies the source property: Source of the configuration.. - * - * @param source Source of the configuration. - * @return the next definition stage. - */ - Update withSource(ConfigurationSource source); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - Configuration refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - Configuration refresh(Context context); } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ConfigurationListForBatchUpdate.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ConfigurationListForBatchUpdate.java index 5ffaff7ff86be..054b7f696f035 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ConfigurationListForBatchUpdate.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ConfigurationListForBatchUpdate.java @@ -22,11 +22,6 @@ public final class ConfigurationListForBatchUpdate implements JsonSerializable value; - /* - * Whether to reset all server parameters to default. - */ - private ResetAllToDefault resetAllToDefault; - /** * Creates an instance of ConfigurationListForBatchUpdate class. */ @@ -53,26 +48,6 @@ public ConfigurationListForBatchUpdate withValue(List writer.writeJson(element)); - jsonWriter.writeStringField("resetAllToDefault", - this.resetAllToDefault == null ? null : this.resetAllToDefault.toString()); return jsonWriter.writeEndObject(); } @@ -116,9 +89,6 @@ public static ConfigurationListForBatchUpdate fromJson(JsonReader jsonReader) th List value = reader.readArray(reader1 -> ConfigurationForBatchUpdate.fromJson(reader1)); deserializedConfigurationListForBatchUpdate.value = value; - } else if ("resetAllToDefault".equals(fieldName)) { - deserializedConfigurationListForBatchUpdate.resetAllToDefault - = ResetAllToDefault.fromString(reader.getString()); } else { reader.skipChildren(); } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Configurations.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Configurations.java index 8ce828341e093..51959fa6fc4f5 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Configurations.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Configurations.java @@ -7,11 +7,43 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ConfigurationInner; /** * Resource collection API of Configurations. */ public interface Configurations { + /** + * Updates a configuration of a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param configurationName The name of the server configuration. + * @param parameters The required parameters for updating a server configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Configuration. + */ + Configuration update(String resourceGroupName, String serverName, String configurationName, + ConfigurationInner parameters); + + /** + * Updates a configuration of a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param configurationName The name of the server configuration. + * @param parameters The required parameters for updating a server configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Configuration. + */ + Configuration update(String resourceGroupName, String serverName, String configurationName, + ConfigurationInner parameters, Context context); + /** * Gets information about a configuration of server. * @@ -86,47 +118,11 @@ ConfigurationListResult batchUpdate(String resourceGroupName, String serverName, * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. - * @param tags The tags of the server configuration. - * @param keyword The keyword of the server configuration. - * @param page The page of the server configuration. - * @param pageSize The pageSize of the server configuration. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 server configurations as paginated response with {@link PagedIterable}. */ - PagedIterable listByServer(String resourceGroupName, String serverName, String tags, String keyword, - Integer page, Integer pageSize, Context context); - - /** - * Gets information about a configuration of server. - * - * @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 information about a configuration of server along with {@link Response}. - */ - Configuration getById(String id); - - /** - * Gets information about a configuration of server. - * - * @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 information about a configuration of server along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new Configuration resource. - * - * @param name resource name. - * @return the first stage of the new Configuration definition. - */ - Configuration.DefinitionStages.Blank define(String name); + PagedIterable listByServer(String resourceGroupName, String serverName, Context context); } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Database.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Database.java index 41d3de0098b62..d65974e460490 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Database.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Database.java @@ -34,7 +34,7 @@ public interface Database { String type(); /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * Gets the systemData property: The system metadata relating to this resource. * * @return the systemData value. */ diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/FirewallRule.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/FirewallRule.java index 1f1ccf8f82afb..06e69bb6c5056 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/FirewallRule.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/FirewallRule.java @@ -34,7 +34,7 @@ public interface FirewallRule { String type(); /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * Gets the systemData property: The system metadata relating to this resource. * * @return the systemData value. */ diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/FullBackupStoreDetails.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/FullBackupStoreDetails.java deleted file mode 100644 index d9403b050fb34..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/FullBackupStoreDetails.java +++ /dev/null @@ -1,122 +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.mysqlflexibleserver.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * FullBackupStoreDetails is used for scenarios where backup data is streamed/copied over to a storage destination. - */ -@Fluent -public final class FullBackupStoreDetails extends BackupStoreDetails { - /* - * Type of the specific object - used for deserializing - */ - private String objectType = "FullBackupStoreDetails"; - - /* - * SASUriList of storage containers where backup data is to be streamed/copied. - */ - private List sasUriList; - - /** - * Creates an instance of FullBackupStoreDetails class. - */ - public FullBackupStoreDetails() { - } - - /** - * Get the objectType property: Type of the specific object - used for deserializing. - * - * @return the objectType value. - */ - @Override - public String objectType() { - return this.objectType; - } - - /** - * Get the sasUriList property: SASUriList of storage containers where backup data is to be streamed/copied. - * - * @return the sasUriList value. - */ - public List sasUriList() { - return this.sasUriList; - } - - /** - * Set the sasUriList property: SASUriList of storage containers where backup data is to be streamed/copied. - * - * @param sasUriList the sasUriList value to set. - * @return the FullBackupStoreDetails object itself. - */ - public FullBackupStoreDetails withSasUriList(List sasUriList) { - this.sasUriList = sasUriList; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (sasUriList() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property sasUriList in model FullBackupStoreDetails")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(FullBackupStoreDetails.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("sasUriList", this.sasUriList, (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("objectType", this.objectType); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of FullBackupStoreDetails from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of FullBackupStoreDetails if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the FullBackupStoreDetails. - */ - public static FullBackupStoreDetails fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - FullBackupStoreDetails deserializedFullBackupStoreDetails = new FullBackupStoreDetails(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("sasUriList".equals(fieldName)) { - List sasUriList = reader.readArray(reader1 -> reader1.getString()); - deserializedFullBackupStoreDetails.sasUriList = sasUriList; - } else if ("objectType".equals(fieldName)) { - deserializedFullBackupStoreDetails.objectType = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedFullBackupStoreDetails; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/HighAvailability.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/HighAvailability.java index 24696521a61e9..647d477795ff0 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/HighAvailability.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/HighAvailability.java @@ -12,7 +12,7 @@ import java.io.IOException; /** - * High availability properties of a server. + * Network related properties of a server. */ @Fluent public final class HighAvailability implements JsonSerializable { diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/HighAvailabilityValidationEstimation.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/HighAvailabilityValidationEstimation.java deleted file mode 100644 index 0dc4f5d2491cd..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/HighAvailabilityValidationEstimation.java +++ /dev/null @@ -1,41 +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.mysqlflexibleserver.models; - -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.HighAvailabilityValidationEstimationInner; - -/** - * An immutable client-side representation of HighAvailabilityValidationEstimation. - */ -public interface HighAvailabilityValidationEstimation { - /** - * Gets the estimatedDowntime property: Estimated seconds of downtime for the deployment. - * - * @return the estimatedDowntime value. - */ - Integer estimatedDowntime(); - - /** - * Gets the scheduledStandbyAvailabilityZone property: Scheduled Availability zone of the standby server. - * - * @return the scheduledStandbyAvailabilityZone value. - */ - String scheduledStandbyAvailabilityZone(); - - /** - * Gets the expectedStandbyAvailabilityZone property: Expected Availability zone of the standby server. - * - * @return the expectedStandbyAvailabilityZone value. - */ - String expectedStandbyAvailabilityZone(); - - /** - * Gets the inner - * com.azure.resourcemanager.mysqlflexibleserver.fluent.models.HighAvailabilityValidationEstimationInner object. - * - * @return the inner object. - */ - HighAvailabilityValidationEstimationInner innerModel(); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MySqlServerIdentity.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Identity.java similarity index 73% rename from sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MySqlServerIdentity.java rename to sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Identity.java index 297d9df04291d..a799f2769e57f 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MySqlServerIdentity.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Identity.java @@ -16,7 +16,7 @@ * Properties to configure Identity for Bring your Own Keys. */ @Fluent -public final class MySqlServerIdentity implements JsonSerializable { +public final class Identity implements JsonSerializable { /* * ObjectId from the KeyVault */ @@ -38,9 +38,9 @@ public final class MySqlServerIdentity implements JsonSerializable userAssignedIdentities; /** - * Creates an instance of MySqlServerIdentity class. + * Creates an instance of Identity class. */ - public MySqlServerIdentity() { + public Identity() { } /** @@ -74,9 +74,9 @@ public ManagedServiceIdentityType type() { * Set the type property: Type of managed service identity. * * @param type the type value to set. - * @return the MySqlServerIdentity object itself. + * @return the Identity object itself. */ - public MySqlServerIdentity withType(ManagedServiceIdentityType type) { + public Identity withType(ManagedServiceIdentityType type) { this.type = type; return this; } @@ -94,9 +94,9 @@ public Map userAssignedIdentities() { * Set the userAssignedIdentities property: Metadata of user assigned identity. * * @param userAssignedIdentities the userAssignedIdentities value to set. - * @return the MySqlServerIdentity object itself. + * @return the Identity object itself. */ - public MySqlServerIdentity withUserAssignedIdentities(Map userAssignedIdentities) { + public Identity withUserAssignedIdentities(Map userAssignedIdentities) { this.userAssignedIdentities = userAssignedIdentities; return this; } @@ -122,35 +122,35 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of MySqlServerIdentity from the JsonReader. + * Reads an instance of Identity from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of MySqlServerIdentity if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the MySqlServerIdentity. + * @return An instance of Identity if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the Identity. */ - public static MySqlServerIdentity fromJson(JsonReader jsonReader) throws IOException { + public static Identity fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - MySqlServerIdentity deserializedMySqlServerIdentity = new MySqlServerIdentity(); + Identity deserializedIdentity = new Identity(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("principalId".equals(fieldName)) { - deserializedMySqlServerIdentity.principalId = reader.getString(); + deserializedIdentity.principalId = reader.getString(); } else if ("tenantId".equals(fieldName)) { - deserializedMySqlServerIdentity.tenantId = reader.getString(); + deserializedIdentity.tenantId = reader.getString(); } else if ("type".equals(fieldName)) { - deserializedMySqlServerIdentity.type = ManagedServiceIdentityType.fromString(reader.getString()); + deserializedIdentity.type = ManagedServiceIdentityType.fromString(reader.getString()); } else if ("userAssignedIdentities".equals(fieldName)) { Map userAssignedIdentities = reader.readMap(reader1 -> reader1.readUntyped()); - deserializedMySqlServerIdentity.userAssignedIdentities = userAssignedIdentities; + deserializedIdentity.userAssignedIdentities = userAssignedIdentities; } else { reader.skipChildren(); } } - return deserializedMySqlServerIdentity; + return deserializedIdentity; }); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ImportFromStorageResponseType.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ImportFromStorageResponseType.java deleted file mode 100644 index 577ae901827a1..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ImportFromStorageResponseType.java +++ /dev/null @@ -1,119 +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.mysqlflexibleserver.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -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.time.format.DateTimeFormatter; - -/** - * ImportFromStorage Response Properties. - */ -@Fluent -public final class ImportFromStorageResponseType extends OperationProgressResponseType { - /* - * Identifies the type of source operation - */ - private ObjectType objectType = ObjectType.IMPORT_FROM_STORAGE_RESPONSE; - - /* - * The estimated time of operation completion. - */ - private OffsetDateTime estimatedCompletionTime; - - /** - * Creates an instance of ImportFromStorageResponseType class. - */ - public ImportFromStorageResponseType() { - } - - /** - * Get the objectType property: Identifies the type of source operation. - * - * @return the objectType value. - */ - @Override - public ObjectType objectType() { - return this.objectType; - } - - /** - * Get the estimatedCompletionTime property: The estimated time of operation completion. - * - * @return the estimatedCompletionTime value. - */ - public OffsetDateTime estimatedCompletionTime() { - return this.estimatedCompletionTime; - } - - /** - * Set the estimatedCompletionTime property: The estimated time of operation completion. - * - * @param estimatedCompletionTime the estimatedCompletionTime value to set. - * @return the ImportFromStorageResponseType object itself. - */ - public ImportFromStorageResponseType withEstimatedCompletionTime(OffsetDateTime estimatedCompletionTime) { - this.estimatedCompletionTime = estimatedCompletionTime; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("objectType", this.objectType == null ? null : this.objectType.toString()); - jsonWriter.writeStringField("estimatedCompletionTime", - this.estimatedCompletionTime == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.estimatedCompletionTime)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ImportFromStorageResponseType from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ImportFromStorageResponseType if the JsonReader was pointing to an instance of it, or null - * if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the ImportFromStorageResponseType. - */ - public static ImportFromStorageResponseType fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ImportFromStorageResponseType deserializedImportFromStorageResponseType - = new ImportFromStorageResponseType(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("objectType".equals(fieldName)) { - deserializedImportFromStorageResponseType.objectType = ObjectType.fromString(reader.getString()); - } else if ("estimatedCompletionTime".equals(fieldName)) { - deserializedImportFromStorageResponseType.estimatedCompletionTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else { - reader.skipChildren(); - } - } - - return deserializedImportFromStorageResponseType; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ImportSourceProperties.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ImportSourceProperties.java deleted file mode 100644 index 3f9cfe6ade35d..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ImportSourceProperties.java +++ /dev/null @@ -1,180 +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.mysqlflexibleserver.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Import source related properties. - */ -@Fluent -public final class ImportSourceProperties implements JsonSerializable { - /* - * Storage type of import source. - */ - private ImportSourceStorageType storageType; - - /* - * Uri of the import source storage. - */ - private String storageUrl; - - /* - * Sas token for accessing source storage. Read and list permissions are required for sas token. - */ - private String sasToken; - - /* - * Relative path of data directory in storage. - */ - private String dataDirPath; - - /** - * Creates an instance of ImportSourceProperties class. - */ - public ImportSourceProperties() { - } - - /** - * Get the storageType property: Storage type of import source. - * - * @return the storageType value. - */ - public ImportSourceStorageType storageType() { - return this.storageType; - } - - /** - * Set the storageType property: Storage type of import source. - * - * @param storageType the storageType value to set. - * @return the ImportSourceProperties object itself. - */ - public ImportSourceProperties withStorageType(ImportSourceStorageType storageType) { - this.storageType = storageType; - return this; - } - - /** - * Get the storageUrl property: Uri of the import source storage. - * - * @return the storageUrl value. - */ - public String storageUrl() { - return this.storageUrl; - } - - /** - * Set the storageUrl property: Uri of the import source storage. - * - * @param storageUrl the storageUrl value to set. - * @return the ImportSourceProperties object itself. - */ - public ImportSourceProperties withStorageUrl(String storageUrl) { - this.storageUrl = storageUrl; - return this; - } - - /** - * Get the sasToken property: Sas token for accessing source storage. Read and list permissions are required for sas - * token. - * - * @return the sasToken value. - */ - public String sasToken() { - return this.sasToken; - } - - /** - * Set the sasToken property: Sas token for accessing source storage. Read and list permissions are required for sas - * token. - * - * @param sasToken the sasToken value to set. - * @return the ImportSourceProperties object itself. - */ - public ImportSourceProperties withSasToken(String sasToken) { - this.sasToken = sasToken; - return this; - } - - /** - * Get the dataDirPath property: Relative path of data directory in storage. - * - * @return the dataDirPath value. - */ - public String dataDirPath() { - return this.dataDirPath; - } - - /** - * Set the dataDirPath property: Relative path of data directory in storage. - * - * @param dataDirPath the dataDirPath value to set. - * @return the ImportSourceProperties object itself. - */ - public ImportSourceProperties withDataDirPath(String dataDirPath) { - this.dataDirPath = dataDirPath; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("storageType", this.storageType == null ? null : this.storageType.toString()); - jsonWriter.writeStringField("storageUrl", this.storageUrl); - jsonWriter.writeStringField("sasToken", this.sasToken); - jsonWriter.writeStringField("dataDirPath", this.dataDirPath); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ImportSourceProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ImportSourceProperties if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IOException If an error occurs while reading the ImportSourceProperties. - */ - public static ImportSourceProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ImportSourceProperties deserializedImportSourceProperties = new ImportSourceProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("storageType".equals(fieldName)) { - deserializedImportSourceProperties.storageType - = ImportSourceStorageType.fromString(reader.getString()); - } else if ("storageUrl".equals(fieldName)) { - deserializedImportSourceProperties.storageUrl = reader.getString(); - } else if ("sasToken".equals(fieldName)) { - deserializedImportSourceProperties.sasToken = reader.getString(); - } else if ("dataDirPath".equals(fieldName)) { - deserializedImportSourceProperties.dataDirPath = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedImportSourceProperties; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ImportSourceStorageType.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ImportSourceStorageType.java deleted file mode 100644 index 5fb618c0a57b2..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ImportSourceStorageType.java +++ /dev/null @@ -1,46 +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.mysqlflexibleserver.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Storage type of import source. - */ -public final class ImportSourceStorageType extends ExpandableStringEnum { - /** - * Static value AzureBlob for ImportSourceStorageType. - */ - public static final ImportSourceStorageType AZURE_BLOB = fromString("AzureBlob"); - - /** - * Creates a new instance of ImportSourceStorageType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ImportSourceStorageType() { - } - - /** - * Creates or finds a ImportSourceStorageType from its string representation. - * - * @param name a name to look for. - * @return the corresponding ImportSourceStorageType. - */ - public static ImportSourceStorageType fromString(String name) { - return fromString(name, ImportSourceStorageType.class); - } - - /** - * Gets known ImportSourceStorageType values. - * - * @return known ImportSourceStorageType values. - */ - public static Collection values() { - return values(ImportSourceStorageType.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/LocationBasedCapabilitySets.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/LocationBasedCapabilitySets.java deleted file mode 100644 index 23081bfc935cf..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/LocationBasedCapabilitySets.java +++ /dev/null @@ -1,64 +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.mysqlflexibleserver.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 LocationBasedCapabilitySets. - */ -public interface LocationBasedCapabilitySets { - /** - * Get capabilities at specified location in a given subscription. - * - * @param locationName The name of the location. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return capabilities at specified location in a given subscription as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(String locationName); - - /** - * Get capabilities at specified location in a given subscription. - * - * @param locationName The name of the location. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return capabilities at specified location in a given subscription as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(String locationName, Context context); - - /** - * Get capabilities at specified location in a given subscription. - * - * @param locationName The name of the location. - * @param capabilitySetName Name of capability set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return capabilities at specified location in a given subscription along with {@link Response}. - */ - Response getWithResponse(String locationName, String capabilitySetName, Context context); - - /** - * Get capabilities at specified location in a given subscription. - * - * @param locationName The name of the location. - * @param capabilitySetName Name of capability set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return capabilities at specified location in a given subscription. - */ - Capability get(String locationName, String capabilitySetName); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/LogFile.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/LogFile.java deleted file mode 100644 index f90b425bda874..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/LogFile.java +++ /dev/null @@ -1,84 +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.mysqlflexibleserver.models; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.LogFileInner; -import java.time.OffsetDateTime; - -/** - * An immutable client-side representation of LogFile. - */ -public interface LogFile { - /** - * 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 sizeInKB property: The size in kb of the logFile. - * - * @return the sizeInKB value. - */ - Long sizeInKB(); - - /** - * Gets the createdTime property: Creation timestamp of the log file. - * - * @return the createdTime value. - */ - OffsetDateTime createdTime(); - - /** - * Gets the typePropertiesType property: Type of the log file. - * - * @return the typePropertiesType value. - */ - String typePropertiesType(); - - /** - * Gets the lastModifiedTime property: Last modified timestamp of the log file. - * - * @return the lastModifiedTime value. - */ - OffsetDateTime lastModifiedTime(); - - /** - * Gets the url property: The url to download the log file from. - * - * @return the url value. - */ - String url(); - - /** - * Gets the inner com.azure.resourcemanager.mysqlflexibleserver.fluent.models.LogFileInner object. - * - * @return the inner object. - */ - LogFileInner innerModel(); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/LogFileListResult.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/LogFileListResult.java deleted file mode 100644 index d068e01b0f1b1..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/LogFileListResult.java +++ /dev/null @@ -1,127 +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.mysqlflexibleserver.models; - -import com.azure.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.mysqlflexibleserver.fluent.models.LogFileInner; -import java.io.IOException; -import java.util.List; - -/** - * A List of logFiles. - */ -@Fluent -public final class LogFileListResult implements JsonSerializable { - /* - * The list of logFiles in a server - */ - private List value; - - /* - * The link used to get the next page of operations. - */ - private String nextLink; - - /** - * Creates an instance of LogFileListResult class. - */ - public LogFileListResult() { - } - - /** - * Get the value property: The list of logFiles in a server. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of logFiles in a server. - * - * @param value the value value to set. - * @return the LogFileListResult object itself. - */ - public LogFileListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The link used to get the next page of operations. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The link used to get the next page of operations. - * - * @param nextLink the nextLink value to set. - * @return the LogFileListResult object itself. - */ - public LogFileListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - - /** - * {@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 LogFileListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of LogFileListResult if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the LogFileListResult. - */ - public static LogFileListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - LogFileListResult deserializedLogFileListResult = new LogFileListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> LogFileInner.fromJson(reader1)); - deserializedLogFileListResult.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedLogFileListResult.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedLogFileListResult; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/LogFiles.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/LogFiles.java deleted file mode 100644 index 229713f99fbb2..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/LogFiles.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; - -/** - * Resource collection API of LogFiles. - */ -public interface LogFiles { - /** - * List all the server log files in a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 logFiles as paginated response with {@link PagedIterable}. - */ - PagedIterable listByServer(String resourceGroupName, String serverName); - - /** - * List all the server log files in a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 logFiles as paginated response with {@link PagedIterable}. - */ - PagedIterable listByServer(String resourceGroupName, String serverName, Context context); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/LongRunningBackups.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/LongRunningBackups.java deleted file mode 100644 index a0f6a670ca44f..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/LongRunningBackups.java +++ /dev/null @@ -1,18 +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.mysqlflexibleserver.models; - -/** - * Resource collection API of LongRunningBackups. - */ -public interface LongRunningBackups { - /** - * Begins definition for a new ServerBackupV2 resource. - * - * @param name resource name. - * @return the first stage of the new ServerBackupV2 definition. - */ - ServerBackupV2.DefinitionStages.Blank define(String name); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/LongRunningBackupsOperations.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/LongRunningBackupsOperations.java deleted file mode 100644 index f1e76a4a00eab..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/LongRunningBackupsOperations.java +++ /dev/null @@ -1,67 +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.mysqlflexibleserver.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 LongRunningBackupsOperations. - */ -public interface LongRunningBackupsOperations { - /** - * Get backup for a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param backupName The name of the backup. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup for a given server along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String serverName, String backupName, - Context context); - - /** - * Get backup for a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param backupName The name of the backup. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup for a given server. - */ - ServerBackupV2 get(String resourceGroupName, String serverName, String backupName); - - /** - * List all the backups for a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 server backups as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String serverName); - - /** - * List all the backups for a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 server backups as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String serverName, Context context); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Maintenance.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Maintenance.java deleted file mode 100644 index 17a5aa3296061..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Maintenance.java +++ /dev/null @@ -1,126 +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.mysqlflexibleserver.models; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.MaintenanceInner; -import java.time.OffsetDateTime; - -/** - * An immutable client-side representation of Maintenance. - */ -public interface Maintenance { - /** - * 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 maintenanceType property: A string defines maintenance type. - * - * @return the maintenanceType value. - */ - MaintenanceType maintenanceType(); - - /** - * Gets the maintenanceState property: A string describes the maintenance status. - * - * @return the maintenanceState value. - */ - MaintenanceState maintenanceState(); - - /** - * Gets the maintenanceStartTime property: The start time for a maintenance. - * - * @return the maintenanceStartTime value. - */ - OffsetDateTime maintenanceStartTime(); - - /** - * Gets the maintenanceEndTime property: The end time for a maintenance. - * - * @return the maintenanceEndTime value. - */ - OffsetDateTime maintenanceEndTime(); - - /** - * Gets the maintenanceExecutionStartTime property: The start time for a maintenance execution. - * - * @return the maintenanceExecutionStartTime value. - */ - OffsetDateTime maintenanceExecutionStartTime(); - - /** - * Gets the maintenanceExecutionEndTime property: The end time for a maintenance execution. - * - * @return the maintenanceExecutionEndTime value. - */ - OffsetDateTime maintenanceExecutionEndTime(); - - /** - * Gets the maintenanceAvailableScheduleMinTime property: The min time the maintenance can be rescheduled. - * - * @return the maintenanceAvailableScheduleMinTime value. - */ - OffsetDateTime maintenanceAvailableScheduleMinTime(); - - /** - * Gets the maintenanceAvailableScheduleMaxTime property: The max time the maintenance can be rescheduled. - * - * @return the maintenanceAvailableScheduleMaxTime value. - */ - OffsetDateTime maintenanceAvailableScheduleMaxTime(); - - /** - * Gets the maintenanceTitle property: The maintenance title. - * - * @return the maintenanceTitle value. - */ - String maintenanceTitle(); - - /** - * Gets the maintenanceDescription property: The maintenance description. - * - * @return the maintenanceDescription value. - */ - String maintenanceDescription(); - - /** - * Gets the provisioningState property: Provisioning state of the Maintenance. - * - * @return the provisioningState value. - */ - MaintenanceProvisioningState provisioningState(); - - /** - * Gets the inner com.azure.resourcemanager.mysqlflexibleserver.fluent.models.MaintenanceInner object. - * - * @return the inner object. - */ - MaintenanceInner innerModel(); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MaintenanceListResult.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MaintenanceListResult.java deleted file mode 100644 index 751ee47dc7c26..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MaintenanceListResult.java +++ /dev/null @@ -1,127 +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.mysqlflexibleserver.models; - -import com.azure.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.mysqlflexibleserver.fluent.models.MaintenanceInner; -import java.io.IOException; -import java.util.List; - -/** - * A list of maintenances. - */ -@Fluent -public final class MaintenanceListResult implements JsonSerializable { - /* - * The list of maintenances in a server. - */ - private List value; - - /* - * The link used to get the next page of operations. - */ - private String nextLink; - - /** - * Creates an instance of MaintenanceListResult class. - */ - public MaintenanceListResult() { - } - - /** - * Get the value property: The list of maintenances in a server. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of maintenances in a server. - * - * @param value the value value to set. - * @return the MaintenanceListResult object itself. - */ - public MaintenanceListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The link used to get the next page of operations. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The link used to get the next page of operations. - * - * @param nextLink the nextLink value to set. - * @return the MaintenanceListResult object itself. - */ - public MaintenanceListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - - /** - * {@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 MaintenanceListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of MaintenanceListResult if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IOException If an error occurs while reading the MaintenanceListResult. - */ - public static MaintenanceListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - MaintenanceListResult deserializedMaintenanceListResult = new MaintenanceListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> MaintenanceInner.fromJson(reader1)); - deserializedMaintenanceListResult.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedMaintenanceListResult.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedMaintenanceListResult; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MaintenanceProvisioningState.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MaintenanceProvisioningState.java deleted file mode 100644 index 9587149cc9f7a..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MaintenanceProvisioningState.java +++ /dev/null @@ -1,61 +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.mysqlflexibleserver.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The current provisioning state. - */ -public final class MaintenanceProvisioningState extends ExpandableStringEnum { - /** - * Static value Succeeded for MaintenanceProvisioningState. - */ - public static final MaintenanceProvisioningState SUCCEEDED = fromString("Succeeded"); - - /** - * Static value Creating for MaintenanceProvisioningState. - */ - public static final MaintenanceProvisioningState CREATING = fromString("Creating"); - - /** - * Static value Deleting for MaintenanceProvisioningState. - */ - public static final MaintenanceProvisioningState DELETING = fromString("Deleting"); - - /** - * Static value Failed for MaintenanceProvisioningState. - */ - public static final MaintenanceProvisioningState FAILED = fromString("Failed"); - - /** - * Creates a new instance of MaintenanceProvisioningState value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public MaintenanceProvisioningState() { - } - - /** - * Creates or finds a MaintenanceProvisioningState from its string representation. - * - * @param name a name to look for. - * @return the corresponding MaintenanceProvisioningState. - */ - public static MaintenanceProvisioningState fromString(String name) { - return fromString(name, MaintenanceProvisioningState.class); - } - - /** - * Gets known MaintenanceProvisioningState values. - * - * @return known MaintenanceProvisioningState values. - */ - public static Collection values() { - return values(MaintenanceProvisioningState.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MaintenanceState.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MaintenanceState.java deleted file mode 100644 index 0b5b29d9ec77a..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MaintenanceState.java +++ /dev/null @@ -1,71 +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.mysqlflexibleserver.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The current status of this maintenance. - */ -public final class MaintenanceState extends ExpandableStringEnum { - /** - * Static value Scheduled for MaintenanceState. - */ - public static final MaintenanceState SCHEDULED = fromString("Scheduled"); - - /** - * Static value ReScheduled for MaintenanceState. - */ - public static final MaintenanceState RE_SCHEDULED = fromString("ReScheduled"); - - /** - * Static value InPreparation for MaintenanceState. - */ - public static final MaintenanceState IN_PREPARATION = fromString("InPreparation"); - - /** - * Static value Processing for MaintenanceState. - */ - public static final MaintenanceState PROCESSING = fromString("Processing"); - - /** - * Static value Completed for MaintenanceState. - */ - public static final MaintenanceState COMPLETED = fromString("Completed"); - - /** - * Static value Canceled for MaintenanceState. - */ - public static final MaintenanceState CANCELED = fromString("Canceled"); - - /** - * Creates a new instance of MaintenanceState value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public MaintenanceState() { - } - - /** - * Creates or finds a MaintenanceState from its string representation. - * - * @param name a name to look for. - * @return the corresponding MaintenanceState. - */ - public static MaintenanceState fromString(String name) { - return fromString(name, MaintenanceState.class); - } - - /** - * Gets known MaintenanceState values. - * - * @return known MaintenanceState values. - */ - public static Collection values() { - return values(MaintenanceState.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MaintenanceType.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MaintenanceType.java deleted file mode 100644 index 9aebe824a79a9..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MaintenanceType.java +++ /dev/null @@ -1,61 +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.mysqlflexibleserver.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The type of this maintenance. - */ -public final class MaintenanceType extends ExpandableStringEnum { - /** - * Static value RoutineMaintenance for MaintenanceType. - */ - public static final MaintenanceType ROUTINE_MAINTENANCE = fromString("RoutineMaintenance"); - - /** - * Static value MinorVersionUpgrade for MaintenanceType. - */ - public static final MaintenanceType MINOR_VERSION_UPGRADE = fromString("MinorVersionUpgrade"); - - /** - * Static value SecurityPatches for MaintenanceType. - */ - public static final MaintenanceType SECURITY_PATCHES = fromString("SecurityPatches"); - - /** - * Static value HotFixes for MaintenanceType. - */ - public static final MaintenanceType HOT_FIXES = fromString("HotFixes"); - - /** - * Creates a new instance of MaintenanceType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public MaintenanceType() { - } - - /** - * Creates or finds a MaintenanceType from its string representation. - * - * @param name a name to look for. - * @return the corresponding MaintenanceType. - */ - public static MaintenanceType fromString(String name) { - return fromString(name, MaintenanceType.class); - } - - /** - * Gets known MaintenanceType values. - * - * @return known MaintenanceType values. - */ - public static Collection values() { - return values(MaintenanceType.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MaintenanceUpdate.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MaintenanceUpdate.java deleted file mode 100644 index 034361626b30a..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MaintenanceUpdate.java +++ /dev/null @@ -1,110 +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.mysqlflexibleserver.models; - -import com.azure.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.mysqlflexibleserver.fluent.models.MaintenancePropertiesForUpdate; -import java.io.IOException; -import java.time.OffsetDateTime; - -/** - * Represents a maintenance update parameter. - */ -@Fluent -public final class MaintenanceUpdate implements JsonSerializable { - /* - * The properties of a maintenance update parameter - */ - private MaintenancePropertiesForUpdate innerProperties; - - /** - * Creates an instance of MaintenanceUpdate class. - */ - public MaintenanceUpdate() { - } - - /** - * Get the innerProperties property: The properties of a maintenance update parameter. - * - * @return the innerProperties value. - */ - private MaintenancePropertiesForUpdate innerProperties() { - return this.innerProperties; - } - - /** - * Get the maintenanceStartTime property: The start time for a maintenance. - * - * @return the maintenanceStartTime value. - */ - public OffsetDateTime maintenanceStartTime() { - return this.innerProperties() == null ? null : this.innerProperties().maintenanceStartTime(); - } - - /** - * Set the maintenanceStartTime property: The start time for a maintenance. - * - * @param maintenanceStartTime the maintenanceStartTime value to set. - * @return the MaintenanceUpdate object itself. - */ - public MaintenanceUpdate withMaintenanceStartTime(OffsetDateTime maintenanceStartTime) { - if (this.innerProperties() == null) { - this.innerProperties = new MaintenancePropertiesForUpdate(); - } - this.innerProperties().withMaintenanceStartTime(maintenanceStartTime); - 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 MaintenanceUpdate from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of MaintenanceUpdate if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the MaintenanceUpdate. - */ - public static MaintenanceUpdate fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - MaintenanceUpdate deserializedMaintenanceUpdate = new MaintenanceUpdate(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("properties".equals(fieldName)) { - deserializedMaintenanceUpdate.innerProperties = MaintenancePropertiesForUpdate.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedMaintenanceUpdate; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Maintenances.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Maintenances.java deleted file mode 100644 index 06b751edf5721..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Maintenances.java +++ /dev/null @@ -1,96 +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.mysqlflexibleserver.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 Maintenances. - */ -public interface Maintenances { - /** - * Read maintenance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param maintenanceName The name of the maintenance. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a maintenance along with {@link Response}. - */ - Response readWithResponse(String resourceGroupName, String serverName, String maintenanceName, - Context context); - - /** - * Read maintenance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param maintenanceName The name of the maintenance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a maintenance. - */ - Maintenance read(String resourceGroupName, String serverName, String maintenanceName); - - /** - * Update maintenances. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param maintenanceName The name of the maintenance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a maintenance. - */ - Maintenance update(String resourceGroupName, String serverName, String maintenanceName); - - /** - * Update maintenances. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param maintenanceName The name of the maintenance. - * @param parameters The required parameters for update maintenance on a server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a maintenance. - */ - Maintenance update(String resourceGroupName, String serverName, String maintenanceName, - MaintenanceUpdate parameters, Context context); - - /** - * List maintenances. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 maintenances as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String serverName); - - /** - * List maintenances. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 maintenances as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String serverName, Context context); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ManagedServiceIdentityType.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ManagedServiceIdentityType.java index 9024c3c927325..7927e7b8aa176 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ManagedServiceIdentityType.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ManagedServiceIdentityType.java @@ -4,43 +4,48 @@ package com.azure.resourcemanager.mysqlflexibleserver.models; -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - /** * Type of managed service identity. */ -public final class ManagedServiceIdentityType extends ExpandableStringEnum { +public enum ManagedServiceIdentityType { /** - * Static value UserAssigned for ManagedServiceIdentityType. + * Enum value UserAssigned. */ - public static final ManagedServiceIdentityType USER_ASSIGNED = fromString("UserAssigned"); + USER_ASSIGNED("UserAssigned"); /** - * Creates a new instance of ManagedServiceIdentityType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. + * The actual serialized value for a ManagedServiceIdentityType instance. */ - @Deprecated - public ManagedServiceIdentityType() { + private final String value; + + ManagedServiceIdentityType(String value) { + this.value = value; } /** - * Creates or finds a ManagedServiceIdentityType from its string representation. + * Parses a serialized value to a ManagedServiceIdentityType instance. * - * @param name a name to look for. - * @return the corresponding ManagedServiceIdentityType. + * @param value the serialized value to parse. + * @return the parsed ManagedServiceIdentityType object, or null if unable to parse. */ - public static ManagedServiceIdentityType fromString(String name) { - return fromString(name, ManagedServiceIdentityType.class); + public static ManagedServiceIdentityType fromString(String value) { + if (value == null) { + return null; + } + ManagedServiceIdentityType[] items = ManagedServiceIdentityType.values(); + for (ManagedServiceIdentityType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; } /** - * Gets known ManagedServiceIdentityType values. - * - * @return known ManagedServiceIdentityType values. + * {@inheritDoc} */ - public static Collection values() { - return values(ManagedServiceIdentityType.class); + @Override + public String toString() { + return this.value; } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Network.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Network.java index 620d53b165b43..e6e09b09f5d64 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Network.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Network.java @@ -48,18 +48,6 @@ public EnableStatusEnum publicNetworkAccess() { return this.publicNetworkAccess; } - /** - * Set the publicNetworkAccess property: Whether or not public network access is allowed for this server. Value is - * 'Disabled' when server has VNet integration. - * - * @param publicNetworkAccess the publicNetworkAccess value to set. - * @return the Network object itself. - */ - public Network withPublicNetworkAccess(EnableStatusEnum publicNetworkAccess) { - this.publicNetworkAccess = publicNetworkAccess; - return this; - } - /** * Get the delegatedSubnetResourceId property: Delegated subnet resource id used to setup vnet for a server. * @@ -114,8 +102,6 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("publicNetworkAccess", - this.publicNetworkAccess == null ? null : this.publicNetworkAccess.toString()); jsonWriter.writeStringField("delegatedSubnetResourceId", this.delegatedSubnetResourceId); jsonWriter.writeStringField("privateDnsZoneResourceId", this.privateDnsZoneResourceId); return jsonWriter.writeEndObject(); diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ObjectType.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ObjectType.java deleted file mode 100644 index 6666ac84b7ee1..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ObjectType.java +++ /dev/null @@ -1,51 +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.mysqlflexibleserver.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Identifies the type of source operation. - */ -public final class ObjectType extends ExpandableStringEnum { - /** - * Static value BackupAndExportResponse for ObjectType. - */ - public static final ObjectType BACKUP_AND_EXPORT_RESPONSE = fromString("BackupAndExportResponse"); - - /** - * Static value ImportFromStorageResponse for ObjectType. - */ - public static final ObjectType IMPORT_FROM_STORAGE_RESPONSE = fromString("ImportFromStorageResponse"); - - /** - * Creates a new instance of ObjectType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ObjectType() { - } - - /** - * Creates or finds a ObjectType from its string representation. - * - * @param name a name to look for. - * @return the corresponding ObjectType. - */ - public static ObjectType fromString(String name) { - return fromString(name, ObjectType.class); - } - - /** - * Gets known ObjectType values. - * - * @return known ObjectType values. - */ - public static Collection values() { - return values(ObjectType.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationProgress.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationProgress.java deleted file mode 100644 index c051196d8f84d..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationProgress.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of OperationProgress. - */ -public interface OperationProgress { - /** - * Get the operation result for a long running operation. - * - * @param locationName The name of the location. - * @param operationId The ID of an ongoing async operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the operation result for a long running operation along with {@link Response}. - */ - Response getWithResponse(String locationName, String operationId, Context context); - - /** - * Get the operation result for a long running operation. - * - * @param locationName The name of the location. - * @param operationId The ID of an ongoing async operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the operation result for a long running operation. - */ - OperationProgressResult get(String locationName, String operationId); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationProgressResponseType.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationProgressResponseType.java deleted file mode 100644 index 8adcd780a718e..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationProgressResponseType.java +++ /dev/null @@ -1,110 +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.mysqlflexibleserver.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; - -/** - * Represents the response properties specific to the operation. - */ -@Immutable -public class OperationProgressResponseType implements JsonSerializable { - /* - * Identifies the type of source operation - */ - private ObjectType objectType = ObjectType.fromString("OperationProgressResponseType"); - - /** - * Creates an instance of OperationProgressResponseType class. - */ - public OperationProgressResponseType() { - } - - /** - * Get the objectType property: Identifies the type of source operation. - * - * @return the objectType value. - */ - public ObjectType objectType() { - return this.objectType; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("objectType", this.objectType == null ? null : this.objectType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of OperationProgressResponseType from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of OperationProgressResponseType if the JsonReader was pointing to an instance of it, or null - * if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the OperationProgressResponseType. - */ - public static OperationProgressResponseType 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 ("objectType".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("BackupAndExportResponse".equals(discriminatorValue)) { - return BackupAndExportResponseType.fromJson(readerToUse.reset()); - } else if ("ImportFromStorageResponse".equals(discriminatorValue)) { - return ImportFromStorageResponseType.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static OperationProgressResponseType fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - OperationProgressResponseType deserializedOperationProgressResponseType - = new OperationProgressResponseType(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("objectType".equals(fieldName)) { - deserializedOperationProgressResponseType.objectType = ObjectType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedOperationProgressResponseType; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationProgressResult.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationProgressResult.java deleted file mode 100644 index bf5f81edffa4f..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationProgressResult.java +++ /dev/null @@ -1,93 +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.mysqlflexibleserver.models; - -import com.azure.core.management.exception.ManagementError; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.OperationProgressResultInner; -import java.time.OffsetDateTime; -import java.util.List; - -/** - * An immutable client-side representation of OperationProgressResult. - */ -public interface OperationProgressResult { - /** - * Gets the id property: Fully qualified ID for the async operation. - * - * @return the id value. - */ - String id(); - - /** - * Gets the resourceId property: Fully qualified ID of the resource against which the original async operation was - * started. - * - * @return the resourceId value. - */ - String resourceId(); - - /** - * Gets the name property: Name of the async operation. - * - * @return the name value. - */ - String name(); - - /** - * Gets the status property: Operation status. - * - * @return the status value. - */ - String status(); - - /** - * Gets the percentComplete property: Percent of the operation that is complete. - * - * @return the percentComplete value. - */ - Float percentComplete(); - - /** - * Gets the startTime property: The start time of the operation. - * - * @return the startTime value. - */ - OffsetDateTime startTime(); - - /** - * Gets the endTime property: The end time of the operation. - * - * @return the endTime value. - */ - OffsetDateTime endTime(); - - /** - * Gets the operations property: The operations list. - * - * @return the operations value. - */ - List operations(); - - /** - * Gets the error property: If present, details of the operation error. - * - * @return the error value. - */ - ManagementError error(); - - /** - * Gets the properties property: The response properties specific to the operation. - * - * @return the properties value. - */ - OperationProgressResponseType properties(); - - /** - * Gets the inner com.azure.resourcemanager.mysqlflexibleserver.fluent.models.OperationProgressResultInner object. - * - * @return the inner object. - */ - OperationProgressResultInner innerModel(); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationResults.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationResults.java deleted file mode 100644 index 752a49c855516..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationResults.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of OperationResults. - */ -public interface OperationResults { - /** - * Get the operation result for a long running operation. - * - * @param locationName The name of the location. - * @param operationId The operation Id. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the operation result for a long running operation along with {@link Response}. - */ - Response getWithResponse(String locationName, String operationId, Context context); - - /** - * Get the operation result for a long running operation. - * - * @param locationName The name of the location. - * @param operationId The operation Id. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the operation result for a long running operation. - */ - OperationStatusExtendedResult get(String locationName, String operationId); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationStatus.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationStatus.java deleted file mode 100644 index b24ed1ca33f0e..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationStatus.java +++ /dev/null @@ -1,76 +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.mysqlflexibleserver.models; - -/** - * The operation status. - */ -public enum OperationStatus { - /** - * Enum value Pending. - */ - PENDING("Pending"), - - /** - * Enum value InProgress. - */ - IN_PROGRESS("InProgress"), - - /** - * Enum value Succeeded. - */ - SUCCEEDED("Succeeded"), - - /** - * Enum value Failed. - */ - FAILED("Failed"), - - /** - * Enum value CancelInProgress. - */ - CANCEL_IN_PROGRESS("CancelInProgress"), - - /** - * Enum value Canceled. - */ - CANCELED("Canceled"); - - /** - * The actual serialized value for a OperationStatus instance. - */ - private final String value; - - OperationStatus(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a OperationStatus instance. - * - * @param value the serialized value to parse. - * @return the parsed OperationStatus object, or null if unable to parse. - */ - public static OperationStatus fromString(String value) { - if (value == null) { - return null; - } - OperationStatus[] items = OperationStatus.values(); - for (OperationStatus item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationStatusExtendedResult.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationStatusExtendedResult.java deleted file mode 100644 index 42b2268332376..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationStatusExtendedResult.java +++ /dev/null @@ -1,95 +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.mysqlflexibleserver.models; - -import com.azure.core.management.exception.ManagementError; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.OperationStatusExtendedResultInner; -import java.time.OffsetDateTime; -import java.util.List; -import java.util.Map; - -/** - * An immutable client-side representation of OperationStatusExtendedResult. - */ -public interface OperationStatusExtendedResult { - /** - * Gets the id property: Fully qualified ID for the async operation. - * - * @return the id value. - */ - String id(); - - /** - * Gets the resourceId property: Fully qualified ID of the resource against which the original async operation was - * started. - * - * @return the resourceId value. - */ - String resourceId(); - - /** - * Gets the name property: Name of the async operation. - * - * @return the name value. - */ - String name(); - - /** - * Gets the status property: Operation status. - * - * @return the status value. - */ - String status(); - - /** - * Gets the percentComplete property: Percent of the operation that is complete. - * - * @return the percentComplete value. - */ - Float percentComplete(); - - /** - * Gets the startTime property: The start time of the operation. - * - * @return the startTime value. - */ - OffsetDateTime startTime(); - - /** - * Gets the endTime property: The end time of the operation. - * - * @return the endTime value. - */ - OffsetDateTime endTime(); - - /** - * Gets the operations property: The operations list. - * - * @return the operations value. - */ - List operations(); - - /** - * Gets the error property: If present, details of the operation error. - * - * @return the error value. - */ - ManagementError error(); - - /** - * Gets the properties property: The extended properties of Operation Results. - * - * @return the properties value. - */ - Map properties(); - - /** - * Gets the inner com.azure.resourcemanager.mysqlflexibleserver.fluent.models.OperationStatusExtendedResultInner - * object. - * - * @return the inner object. - */ - OperationStatusExtendedResultInner innerModel(); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationStatusResult.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationStatusResult.java deleted file mode 100644 index c659b48da448a..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/OperationStatusResult.java +++ /dev/null @@ -1,340 +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.mysqlflexibleserver.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.exception.ManagementError; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.logging.ClientLogger; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.List; - -/** - * The current status of an async operation. - */ -@Fluent -public class OperationStatusResult implements JsonSerializable { - /* - * Fully qualified ID for the async operation. - */ - private String id; - - /* - * Fully qualified ID of the resource against which the original async operation was started. - */ - private String resourceId; - - /* - * Name of the async operation. - */ - private String name; - - /* - * Operation status. - */ - private String status; - - /* - * Percent of the operation that is complete. - */ - private Float percentComplete; - - /* - * The start time of the operation. - */ - private OffsetDateTime startTime; - - /* - * The end time of the operation. - */ - private OffsetDateTime endTime; - - /* - * The operations list. - */ - private List operations; - - /* - * If present, details of the operation error. - */ - private ManagementError error; - - /** - * Creates an instance of OperationStatusResult class. - */ - public OperationStatusResult() { - } - - /** - * Get the id property: Fully qualified ID for the async operation. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Fully qualified ID for the async operation. - * - * @param id the id value to set. - * @return the OperationStatusResult object itself. - */ - public OperationStatusResult withId(String id) { - this.id = id; - return this; - } - - /** - * Get the resourceId property: Fully qualified ID of the resource against which the original async operation was - * started. - * - * @return the resourceId value. - */ - public String resourceId() { - return this.resourceId; - } - - /** - * Set the resourceId property: Fully qualified ID of the resource against which the original async operation was - * started. - * - * @param resourceId the resourceId value to set. - * @return the OperationStatusResult object itself. - */ - OperationStatusResult withResourceId(String resourceId) { - this.resourceId = resourceId; - return this; - } - - /** - * Get the name property: Name of the async operation. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of the async operation. - * - * @param name the name value to set. - * @return the OperationStatusResult object itself. - */ - public OperationStatusResult withName(String name) { - this.name = name; - return this; - } - - /** - * Get the status property: Operation status. - * - * @return the status value. - */ - public String status() { - return this.status; - } - - /** - * Set the status property: Operation status. - * - * @param status the status value to set. - * @return the OperationStatusResult object itself. - */ - public OperationStatusResult withStatus(String status) { - this.status = status; - return this; - } - - /** - * Get the percentComplete property: Percent of the operation that is complete. - * - * @return the percentComplete value. - */ - public Float percentComplete() { - return this.percentComplete; - } - - /** - * Set the percentComplete property: Percent of the operation that is complete. - * - * @param percentComplete the percentComplete value to set. - * @return the OperationStatusResult object itself. - */ - public OperationStatusResult withPercentComplete(Float percentComplete) { - this.percentComplete = percentComplete; - return this; - } - - /** - * Get the startTime property: The start time of the operation. - * - * @return the startTime value. - */ - public OffsetDateTime startTime() { - return this.startTime; - } - - /** - * Set the startTime property: The start time of the operation. - * - * @param startTime the startTime value to set. - * @return the OperationStatusResult object itself. - */ - public OperationStatusResult withStartTime(OffsetDateTime startTime) { - this.startTime = startTime; - return this; - } - - /** - * Get the endTime property: The end time of the operation. - * - * @return the endTime value. - */ - public OffsetDateTime endTime() { - return this.endTime; - } - - /** - * Set the endTime property: The end time of the operation. - * - * @param endTime the endTime value to set. - * @return the OperationStatusResult object itself. - */ - public OperationStatusResult withEndTime(OffsetDateTime endTime) { - this.endTime = endTime; - return this; - } - - /** - * Get the operations property: The operations list. - * - * @return the operations value. - */ - public List operations() { - return this.operations; - } - - /** - * Set the operations property: The operations list. - * - * @param operations the operations value to set. - * @return the OperationStatusResult object itself. - */ - public OperationStatusResult withOperations(List operations) { - this.operations = operations; - return this; - } - - /** - * Get the error property: If present, details of the operation error. - * - * @return the error value. - */ - public ManagementError error() { - return this.error; - } - - /** - * Set the error property: If present, details of the operation error. - * - * @param error the error value to set. - * @return the OperationStatusResult object itself. - */ - public OperationStatusResult withError(ManagementError error) { - this.error = error; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (status() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property status in model OperationStatusResult")); - } - if (operations() != null) { - operations().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(OperationStatusResult.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("status", this.status); - jsonWriter.writeStringField("id", this.id); - jsonWriter.writeStringField("name", this.name); - jsonWriter.writeNumberField("percentComplete", this.percentComplete); - jsonWriter.writeStringField("startTime", - this.startTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startTime)); - jsonWriter.writeStringField("endTime", - this.endTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.endTime)); - jsonWriter.writeArrayField("operations", this.operations, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeJsonField("error", this.error); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of OperationStatusResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of OperationStatusResult if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the OperationStatusResult. - */ - public static OperationStatusResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - OperationStatusResult deserializedOperationStatusResult = new OperationStatusResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("status".equals(fieldName)) { - deserializedOperationStatusResult.status = reader.getString(); - } else if ("id".equals(fieldName)) { - deserializedOperationStatusResult.id = reader.getString(); - } else if ("resourceId".equals(fieldName)) { - deserializedOperationStatusResult.resourceId = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedOperationStatusResult.name = reader.getString(); - } else if ("percentComplete".equals(fieldName)) { - deserializedOperationStatusResult.percentComplete = reader.getNullable(JsonReader::getFloat); - } else if ("startTime".equals(fieldName)) { - deserializedOperationStatusResult.startTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("endTime".equals(fieldName)) { - deserializedOperationStatusResult.endTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("operations".equals(fieldName)) { - List operations - = reader.readArray(reader1 -> OperationStatusResult.fromJson(reader1)); - deserializedOperationStatusResult.operations = operations; - } else if ("error".equals(fieldName)) { - deserializedOperationStatusResult.error = ManagementError.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedOperationStatusResult; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateEndpoint.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateEndpoint.java deleted file mode 100644 index 23d367370b5c6..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateEndpoint.java +++ /dev/null @@ -1,81 +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.mysqlflexibleserver.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/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateEndpointConnection.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateEndpointConnection.java deleted file mode 100644 index 3715aff0bfca5..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateEndpointConnection.java +++ /dev/null @@ -1,224 +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.mysqlflexibleserver.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.mysqlflexibleserver.fluent.models.PrivateEndpointConnectionProperties; -import java.io.IOException; -import java.util.List; - -/** - * The private endpoint connection resource. - */ -@Fluent -public final class PrivateEndpointConnection extends ProxyResource { - /* - * Resource properties. - */ - private PrivateEndpointConnectionProperties innerProperties; - - /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - */ - private SystemData systemData; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of PrivateEndpointConnection class. - */ - public PrivateEndpointConnection() { - } - - /** - * 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 type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * 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 private endpoint resource. - * - * @return the privateEndpoint value. - */ - public PrivateEndpoint privateEndpoint() { - return this.innerProperties() == null ? null : this.innerProperties().privateEndpoint(); - } - - /** - * Set the privateEndpoint property: The private endpoint resource. - * - * @param privateEndpoint the privateEndpoint value to set. - * @return the PrivateEndpointConnection object itself. - */ - public PrivateEndpointConnection 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 PrivateEndpointConnection object itself. - */ - public PrivateEndpointConnection - 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 PrivateEndpointConnection from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of PrivateEndpointConnection if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the PrivateEndpointConnection. - */ - public static PrivateEndpointConnection fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - PrivateEndpointConnection deserializedPrivateEndpointConnection = new PrivateEndpointConnection(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedPrivateEndpointConnection.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedPrivateEndpointConnection.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedPrivateEndpointConnection.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedPrivateEndpointConnection.innerProperties - = PrivateEndpointConnectionProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedPrivateEndpointConnection.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedPrivateEndpointConnection; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateEndpointConnectionProvisioningState.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateEndpointConnectionProvisioningState.java deleted file mode 100644 index 00098615295ff..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateEndpointConnectionProvisioningState.java +++ /dev/null @@ -1,62 +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.mysqlflexibleserver.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 Creating for PrivateEndpointConnectionProvisioningState. - */ - public static final PrivateEndpointConnectionProvisioningState CREATING = fromString("Creating"); - - /** - * Static value Deleting for PrivateEndpointConnectionProvisioningState. - */ - public static final PrivateEndpointConnectionProvisioningState DELETING = fromString("Deleting"); - - /** - * Static value Failed for PrivateEndpointConnectionProvisioningState. - */ - public static final PrivateEndpointConnectionProvisioningState FAILED = fromString("Failed"); - - /** - * 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/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateEndpointServiceConnectionStatus.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateEndpointServiceConnectionStatus.java deleted file mode 100644 index 80b8dfda09c1f..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateEndpointServiceConnectionStatus.java +++ /dev/null @@ -1,57 +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.mysqlflexibleserver.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"); - - /** - * 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/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateLinkServiceConnectionState.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateLinkServiceConnectionState.java deleted file mode 100644 index 894ae26d3ddf2..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/PrivateLinkServiceConnectionState.java +++ /dev/null @@ -1,155 +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.mysqlflexibleserver.models; - -import com.azure.core.annotation.Fluent; -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/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ProvisioningState.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ProvisioningState.java deleted file mode 100644 index d31862117e0b0..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ProvisioningState.java +++ /dev/null @@ -1,66 +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.mysqlflexibleserver.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The current provisioning state. - */ -public final class ProvisioningState extends ExpandableStringEnum { - /** - * Static value Succeeded for ProvisioningState. - */ - public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); - - /** - * Static value Creating for ProvisioningState. - */ - public static final ProvisioningState CREATING = fromString("Creating"); - - /** - * Static value Deleting for ProvisioningState. - */ - public static final ProvisioningState DELETING = fromString("Deleting"); - - /** - * Static value Failed for ProvisioningState. - */ - public static final ProvisioningState FAILED = fromString("Failed"); - - /** - * Static value Canceled for ProvisioningState. - */ - public static final ProvisioningState CANCELED = fromString("Canceled"); - - /** - * Creates a new instance of ProvisioningState value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ProvisioningState() { - } - - /** - * Creates or finds a ProvisioningState from its string representation. - * - * @param name a name to look for. - * @return the corresponding ProvisioningState. - */ - public static ProvisioningState fromString(String name) { - return fromString(name, ProvisioningState.class); - } - - /** - * Gets known ProvisioningState values. - * - * @return known ProvisioningState values. - */ - public static Collection values() { - return values(ProvisioningState.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ResetAllToDefault.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ResetAllToDefault.java deleted file mode 100644 index f7237d095c0f2..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ResetAllToDefault.java +++ /dev/null @@ -1,51 +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.mysqlflexibleserver.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Whether to reset all server parameters to default. - */ -public final class ResetAllToDefault extends ExpandableStringEnum { - /** - * Static value True for ResetAllToDefault. - */ - public static final ResetAllToDefault TRUE = fromString("True"); - - /** - * Static value False for ResetAllToDefault. - */ - public static final ResetAllToDefault FALSE = fromString("False"); - - /** - * Creates a new instance of ResetAllToDefault value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ResetAllToDefault() { - } - - /** - * Creates or finds a ResetAllToDefault from its string representation. - * - * @param name a name to look for. - * @return the corresponding ResetAllToDefault. - */ - public static ResetAllToDefault fromString(String name) { - return fromString(name, ResetAllToDefault.class); - } - - /** - * Gets known ResetAllToDefault values. - * - * @return known ResetAllToDefault values. - */ - public static Collection values() { - return values(ResetAllToDefault.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Server.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Server.java index 92ccd8f5e9e4b..7b3557f253a05 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Server.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Server.java @@ -4,14 +4,11 @@ package com.azure.resourcemanager.mysqlflexibleserver.models; -import com.azure.core.http.rest.Response; import com.azure.core.management.Region; import com.azure.core.management.SystemData; import com.azure.core.util.Context; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.HighAvailabilityValidationEstimationInner; import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerInner; import java.time.OffsetDateTime; -import java.util.List; import java.util.Map; /** @@ -58,17 +55,17 @@ public interface Server { * * @return the identity value. */ - MySqlServerIdentity identity(); + Identity identity(); /** * Gets the sku property: The SKU (pricing tier) of the server. * * @return the sku value. */ - MySqlServerSku sku(); + Sku sku(); /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * Gets the systemData property: The system metadata relating to this resource. * * @return the systemData value. */ @@ -189,13 +186,6 @@ public interface Server { */ Network network(); - /** - * Gets the privateEndpointConnections property: PrivateEndpointConnections related properties of a server. - * - * @return the privateEndpointConnections value. - */ - List privateEndpointConnections(); - /** * Gets the maintenanceWindow property: Maintenance window of a server. * @@ -203,13 +193,6 @@ public interface Server { */ MaintenanceWindow maintenanceWindow(); - /** - * Gets the importSourceProperties property: Source properties for import from storage. - * - * @return the importSourceProperties value. - */ - ImportSourceProperties importSourceProperties(); - /** * Gets the region of the resource. * @@ -298,8 +281,7 @@ interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithIde DefinitionStages.WithVersion, DefinitionStages.WithAvailabilityZone, DefinitionStages.WithCreateMode, DefinitionStages.WithSourceServerResourceId, DefinitionStages.WithRestorePointInTime, DefinitionStages.WithReplicationRole, DefinitionStages.WithDataEncryption, DefinitionStages.WithStorage, - DefinitionStages.WithBackup, DefinitionStages.WithHighAvailability, DefinitionStages.WithNetwork, - DefinitionStages.WithImportSourceProperties { + DefinitionStages.WithBackup, DefinitionStages.WithHighAvailability, DefinitionStages.WithNetwork { /** * Executes the create request. * @@ -339,7 +321,7 @@ interface WithIdentity { * @param identity The cmk identity for the server. * @return the next definition stage. */ - WithCreate withIdentity(MySqlServerIdentity identity); + WithCreate withIdentity(Identity identity); } /** @@ -352,7 +334,7 @@ interface WithSku { * @param sku The SKU (pricing tier) of the server. * @return the next definition stage. */ - WithCreate withSku(MySqlServerSku sku); + WithCreate withSku(Sku sku); } /** @@ -528,19 +510,6 @@ interface WithNetwork { */ WithCreate withNetwork(Network network); } - - /** - * The stage of the Server definition allowing to specify importSourceProperties. - */ - interface WithImportSourceProperties { - /** - * Specifies the importSourceProperties property: Source properties for import from storage.. - * - * @param importSourceProperties Source properties for import from storage. - * @return the next definition stage. - */ - WithCreate withImportSourceProperties(ImportSourceProperties importSourceProperties); - } } /** @@ -554,9 +523,9 @@ interface WithImportSourceProperties { * The template for Server update. */ interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity, UpdateStages.WithSku, - UpdateStages.WithAdministratorLoginPassword, UpdateStages.WithVersion, UpdateStages.WithStorage, - UpdateStages.WithBackup, UpdateStages.WithHighAvailability, UpdateStages.WithMaintenanceWindow, - UpdateStages.WithReplicationRole, UpdateStages.WithDataEncryption, UpdateStages.WithNetwork { + UpdateStages.WithAdministratorLoginPassword, UpdateStages.WithStorage, UpdateStages.WithBackup, + UpdateStages.WithHighAvailability, UpdateStages.WithMaintenanceWindow, UpdateStages.WithReplicationRole, + UpdateStages.WithDataEncryption { /** * Executes the update request. * @@ -600,7 +569,7 @@ interface WithIdentity { * @param identity The cmk identity for the server. * @return the next definition stage. */ - Update withIdentity(MySqlServerIdentity identity); + Update withIdentity(Identity identity); } /** @@ -613,7 +582,7 @@ interface WithSku { * @param sku The SKU (pricing tier) of the server. * @return the next definition stage. */ - Update withSku(MySqlServerSku sku); + Update withSku(Sku sku); } /** @@ -629,19 +598,6 @@ interface WithAdministratorLoginPassword { Update withAdministratorLoginPassword(String administratorLoginPassword); } - /** - * The stage of the Server update allowing to specify version. - */ - interface WithVersion { - /** - * Specifies the version property: Server version.. - * - * @param version Server version. - * @return the next definition stage. - */ - Update withVersion(ServerVersion version); - } - /** * The stage of the Server update allowing to specify storage. */ @@ -719,19 +675,6 @@ interface WithDataEncryption { */ Update withDataEncryption(DataEncryption dataEncryption); } - - /** - * The stage of the Server update allowing to specify network. - */ - interface WithNetwork { - /** - * Specifies the network property: Network related properties of a server. - * - * @param network Network related properties of a server. - * @return the next definition stage. - */ - Update withNetwork(Network network); - } } /** @@ -767,31 +710,6 @@ interface WithNetwork { */ void failover(Context context); - /** - * Validate a deployment of high availability. - * - * @param parameters The required parameters for validation of high availability deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return high availability validation properties of a server along with {@link Response}. - */ - Response validateEstimateHighAvailabilityWithResponse( - HighAvailabilityValidationEstimationInner parameters, Context context); - - /** - * Validate a deployment of high availability. - * - * @param parameters The required parameters for validation of high availability deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return high availability validation properties of a server. - */ - HighAvailabilityValidationEstimation - validateEstimateHighAvailability(HighAvailabilityValidationEstimationInner parameters); - /** * Restarts a server. * @@ -848,25 +766,4 @@ Response validateEstimateHighAvailabilityW * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ void stop(Context context); - - /** - * Resets GTID on a server. - * - * @param parameters The required parameters for resetting GTID on a server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void resetGtid(ServerGtidSetParameter parameters); - - /** - * Resets GTID on a server. - * - * @param parameters The required parameters for resetting GTID on a server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void resetGtid(ServerGtidSetParameter parameters, Context context); } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerBackup.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerBackup.java index 3dfbac3fbf41f..ebf551c81cc7a 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerBackup.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerBackup.java @@ -34,7 +34,7 @@ public interface ServerBackup { String type(); /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * Gets the systemData property: The system metadata relating to this resource. * * @return the systemData value. */ diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerBackupV2.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerBackupV2.java deleted file mode 100644 index d509184270d2c..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerBackupV2.java +++ /dev/null @@ -1,191 +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.mysqlflexibleserver.models; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerBackupV2Inner; -import java.time.OffsetDateTime; - -/** - * An immutable client-side representation of ServerBackupV2. - */ -public interface ServerBackupV2 { - /** - * 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 backupNameV2 property: Backup name. - * - * @return the backupNameV2 value. - */ - String backupNameV2(); - - /** - * Gets the backupType property: The backupType property. - * - * @return the backupType value. - */ - BackupType backupType(); - - /** - * Gets the completedTime property: Backup completed time (ISO8601 format). - * - * @return the completedTime value. - */ - OffsetDateTime completedTime(); - - /** - * Gets the source property: Backup source. - * - * @return the source value. - */ - String source(); - - /** - * Gets the provisioningState property: The provisioning state of backup resource. - * - * @return the provisioningState value. - */ - ProvisioningState provisioningState(); - - /** - * Gets the inner com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerBackupV2Inner object. - * - * @return the inner object. - */ - ServerBackupV2Inner innerModel(); - - /** - * The entirety of the ServerBackupV2 definition. - */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { - } - - /** - * The ServerBackupV2 definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the ServerBackupV2 definition. - */ - interface Blank extends WithParentResource { - } - - /** - * The stage of the ServerBackupV2 definition allowing to specify parent resource. - */ - interface WithParentResource { - /** - * Specifies resourceGroupName, serverName. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @return the next definition stage. - */ - WithCreate withExistingFlexibleServer(String resourceGroupName, String serverName); - } - - /** - * The stage of the ServerBackupV2 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.WithBackupNameV2, DefinitionStages.WithBackupType, - DefinitionStages.WithCompletedTime, DefinitionStages.WithSource { - /** - * Executes the create request. - * - * @return the created resource. - */ - ServerBackupV2 create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - ServerBackupV2 create(Context context); - } - - /** - * The stage of the ServerBackupV2 definition allowing to specify backupNameV2. - */ - interface WithBackupNameV2 { - /** - * Specifies the backupNameV2 property: Backup name. - * - * @param backupNameV2 Backup name. - * @return the next definition stage. - */ - WithCreate withBackupNameV2(String backupNameV2); - } - - /** - * The stage of the ServerBackupV2 definition allowing to specify backupType. - */ - interface WithBackupType { - /** - * Specifies the backupType property: The backupType property.. - * - * @param backupType The backupType property. - * @return the next definition stage. - */ - WithCreate withBackupType(BackupType backupType); - } - - /** - * The stage of the ServerBackupV2 definition allowing to specify completedTime. - */ - interface WithCompletedTime { - /** - * Specifies the completedTime property: Backup completed time (ISO8601 format).. - * - * @param completedTime Backup completed time (ISO8601 format). - * @return the next definition stage. - */ - WithCreate withCompletedTime(OffsetDateTime completedTime); - } - - /** - * The stage of the ServerBackupV2 definition allowing to specify source. - */ - interface WithSource { - /** - * Specifies the source property: Backup source. - * - * @param source Backup source. - * @return the next definition stage. - */ - WithCreate withSource(String source); - } - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerBackupV2ListResult.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerBackupV2ListResult.java deleted file mode 100644 index c621d664bd245..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerBackupV2ListResult.java +++ /dev/null @@ -1,128 +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.mysqlflexibleserver.models; - -import com.azure.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.mysqlflexibleserver.fluent.models.ServerBackupV2Inner; -import java.io.IOException; -import java.util.List; - -/** - * A list of server backups. - */ -@Fluent -public final class ServerBackupV2ListResult implements JsonSerializable { - /* - * The list of backups of a server. - */ - private List value; - - /* - * The link used to get the next page of operations. - */ - private String nextLink; - - /** - * Creates an instance of ServerBackupV2ListResult class. - */ - public ServerBackupV2ListResult() { - } - - /** - * Get the value property: The list of backups of a server. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of backups of a server. - * - * @param value the value value to set. - * @return the ServerBackupV2ListResult object itself. - */ - public ServerBackupV2ListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The link used to get the next page of operations. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The link used to get the next page of operations. - * - * @param nextLink the nextLink value to set. - * @return the ServerBackupV2ListResult object itself. - */ - public ServerBackupV2ListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - - /** - * {@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 ServerBackupV2ListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ServerBackupV2ListResult if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IOException If an error occurs while reading the ServerBackupV2ListResult. - */ - public static ServerBackupV2ListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ServerBackupV2ListResult deserializedServerBackupV2ListResult = new ServerBackupV2ListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> ServerBackupV2Inner.fromJson(reader1)); - deserializedServerBackupV2ListResult.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedServerBackupV2ListResult.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedServerBackupV2ListResult; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerEditionCapabilityV2.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerEditionCapabilityV2.java deleted file mode 100644 index 0287f392df4ee..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerEditionCapabilityV2.java +++ /dev/null @@ -1,156 +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.mysqlflexibleserver.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; - -/** - * Server edition capabilities. - */ -@Immutable -public final class ServerEditionCapabilityV2 implements JsonSerializable { - /* - * Server edition name - */ - private String name; - - /* - * Default Sku name - */ - private String defaultSku; - - /* - * Default storage size - */ - private Integer defaultStorageSize; - - /* - * A list of supported storage editions - */ - private List supportedStorageEditions; - - /* - * A list of supported Skus - */ - private List supportedSkus; - - /** - * Creates an instance of ServerEditionCapabilityV2 class. - */ - public ServerEditionCapabilityV2() { - } - - /** - * Get the name property: Server edition name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the defaultSku property: Default Sku name. - * - * @return the defaultSku value. - */ - public String defaultSku() { - return this.defaultSku; - } - - /** - * Get the defaultStorageSize property: Default storage size. - * - * @return the defaultStorageSize value. - */ - public Integer defaultStorageSize() { - return this.defaultStorageSize; - } - - /** - * Get the supportedStorageEditions property: A list of supported storage editions. - * - * @return the supportedStorageEditions value. - */ - public List supportedStorageEditions() { - return this.supportedStorageEditions; - } - - /** - * Get the supportedSkus property: A list of supported Skus. - * - * @return the supportedSkus value. - */ - public List supportedSkus() { - return this.supportedSkus; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (supportedStorageEditions() != null) { - supportedStorageEditions().forEach(e -> e.validate()); - } - if (supportedSkus() != null) { - supportedSkus().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ServerEditionCapabilityV2 from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ServerEditionCapabilityV2 if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IOException If an error occurs while reading the ServerEditionCapabilityV2. - */ - public static ServerEditionCapabilityV2 fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ServerEditionCapabilityV2 deserializedServerEditionCapabilityV2 = new ServerEditionCapabilityV2(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - deserializedServerEditionCapabilityV2.name = reader.getString(); - } else if ("defaultSku".equals(fieldName)) { - deserializedServerEditionCapabilityV2.defaultSku = reader.getString(); - } else if ("defaultStorageSize".equals(fieldName)) { - deserializedServerEditionCapabilityV2.defaultStorageSize = reader.getNullable(JsonReader::getInt); - } else if ("supportedStorageEditions".equals(fieldName)) { - List supportedStorageEditions - = reader.readArray(reader1 -> StorageEditionCapability.fromJson(reader1)); - deserializedServerEditionCapabilityV2.supportedStorageEditions = supportedStorageEditions; - } else if ("supportedSkus".equals(fieldName)) { - List supportedSkus - = reader.readArray(reader1 -> SkuCapabilityV2.fromJson(reader1)); - deserializedServerEditionCapabilityV2.supportedSkus = supportedSkus; - } else { - reader.skipChildren(); - } - } - - return deserializedServerEditionCapabilityV2; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerForUpdate.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerForUpdate.java index aca6576d3da23..5dbf0c2d69530 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerForUpdate.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerForUpdate.java @@ -21,12 +21,12 @@ public final class ServerForUpdate implements JsonSerializable /* * The cmk identity for the server. */ - private MySqlServerIdentity identity; + private Identity identity; /* * The SKU (pricing tier) of the server. */ - private MySqlServerSku sku; + private Sku sku; /* * The properties that can be updated for a server. @@ -49,7 +49,7 @@ public ServerForUpdate() { * * @return the identity value. */ - public MySqlServerIdentity identity() { + public Identity identity() { return this.identity; } @@ -59,7 +59,7 @@ public MySqlServerIdentity identity() { * @param identity the identity value to set. * @return the ServerForUpdate object itself. */ - public ServerForUpdate withIdentity(MySqlServerIdentity identity) { + public ServerForUpdate withIdentity(Identity identity) { this.identity = identity; return this; } @@ -69,7 +69,7 @@ public ServerForUpdate withIdentity(MySqlServerIdentity identity) { * * @return the sku value. */ - public MySqlServerSku sku() { + public Sku sku() { return this.sku; } @@ -79,7 +79,7 @@ public MySqlServerSku sku() { * @param sku the sku value to set. * @return the ServerForUpdate object itself. */ - public ServerForUpdate withSku(MySqlServerSku sku) { + public ServerForUpdate withSku(Sku sku) { this.sku = sku; return this; } @@ -136,29 +136,6 @@ public ServerForUpdate withAdministratorLoginPassword(String administratorLoginP return this; } - /** - * Get the version property: Server version. - * - * @return the version value. - */ - public ServerVersion version() { - return this.innerProperties() == null ? null : this.innerProperties().version(); - } - - /** - * Set the version property: Server version. - * - * @param version the version value to set. - * @return the ServerForUpdate object itself. - */ - public ServerForUpdate withVersion(ServerVersion version) { - if (this.innerProperties() == null) { - this.innerProperties = new ServerPropertiesForUpdate(); - } - this.innerProperties().withVersion(version); - return this; - } - /** * Get the storage property: Storage related properties of a server. * @@ -297,29 +274,6 @@ public ServerForUpdate withDataEncryption(DataEncryption dataEncryption) { return this; } - /** - * Get the network property: Network related properties of a server. - * - * @return the network value. - */ - public Network network() { - return this.innerProperties() == null ? null : this.innerProperties().network(); - } - - /** - * Set the network property: Network related properties of a server. - * - * @param network the network value to set. - * @return the ServerForUpdate object itself. - */ - public ServerForUpdate withNetwork(Network network) { - if (this.innerProperties() == null) { - this.innerProperties = new ServerPropertiesForUpdate(); - } - this.innerProperties().withNetwork(network); - return this; - } - /** * Validates the instance. * @@ -366,9 +320,9 @@ public static ServerForUpdate fromJson(JsonReader jsonReader) throws IOException reader.nextToken(); if ("identity".equals(fieldName)) { - deserializedServerForUpdate.identity = MySqlServerIdentity.fromJson(reader); + deserializedServerForUpdate.identity = Identity.fromJson(reader); } else if ("sku".equals(fieldName)) { - deserializedServerForUpdate.sku = MySqlServerSku.fromJson(reader); + deserializedServerForUpdate.sku = Sku.fromJson(reader); } else if ("properties".equals(fieldName)) { deserializedServerForUpdate.innerProperties = ServerPropertiesForUpdate.fromJson(reader); } else if ("tags".equals(fieldName)) { diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerGtidSetParameter.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerGtidSetParameter.java deleted file mode 100644 index 10512bcb2624f..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerGtidSetParameter.java +++ /dev/null @@ -1,93 +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.mysqlflexibleserver.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Server Gtid set parameters. - */ -@Fluent -public final class ServerGtidSetParameter implements JsonSerializable { - /* - * The Gtid set of server. - */ - private String gtidSet; - - /** - * Creates an instance of ServerGtidSetParameter class. - */ - public ServerGtidSetParameter() { - } - - /** - * Get the gtidSet property: The Gtid set of server. - * - * @return the gtidSet value. - */ - public String gtidSet() { - return this.gtidSet; - } - - /** - * Set the gtidSet property: The Gtid set of server. - * - * @param gtidSet the gtidSet value to set. - * @return the ServerGtidSetParameter object itself. - */ - public ServerGtidSetParameter withGtidSet(String gtidSet) { - this.gtidSet = gtidSet; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("gtidSet", this.gtidSet); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ServerGtidSetParameter from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ServerGtidSetParameter if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IOException If an error occurs while reading the ServerGtidSetParameter. - */ - public static ServerGtidSetParameter fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ServerGtidSetParameter deserializedServerGtidSetParameter = new ServerGtidSetParameter(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("gtidSet".equals(fieldName)) { - deserializedServerGtidSetParameter.gtidSet = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedServerGtidSetParameter; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerSkuTier.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerSkuTier.java deleted file mode 100644 index fc9345c5772f9..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerSkuTier.java +++ /dev/null @@ -1,56 +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.mysqlflexibleserver.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The tier of the particular SKU, e.g. GeneralPurpose. - */ -public final class ServerSkuTier extends ExpandableStringEnum { - /** - * Static value Burstable for ServerSkuTier. - */ - public static final ServerSkuTier BURSTABLE = fromString("Burstable"); - - /** - * Static value GeneralPurpose for ServerSkuTier. - */ - public static final ServerSkuTier GENERAL_PURPOSE = fromString("GeneralPurpose"); - - /** - * Static value MemoryOptimized for ServerSkuTier. - */ - public static final ServerSkuTier MEMORY_OPTIMIZED = fromString("MemoryOptimized"); - - /** - * Creates a new instance of ServerSkuTier value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ServerSkuTier() { - } - - /** - * Creates or finds a ServerSkuTier from its string representation. - * - * @param name a name to look for. - * @return the corresponding ServerSkuTier. - */ - public static ServerSkuTier fromString(String name) { - return fromString(name, ServerSkuTier.class); - } - - /** - * Gets known ServerSkuTier values. - * - * @return known ServerSkuTier values. - */ - public static Collection values() { - return values(ServerSkuTier.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerVersionCapabilityV2.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerVersionCapabilityV2.java deleted file mode 100644 index 6e48a496ea46a..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServerVersionCapabilityV2.java +++ /dev/null @@ -1,81 +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.mysqlflexibleserver.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; - -/** - * Server version capabilities. - */ -@Immutable -public final class ServerVersionCapabilityV2 implements JsonSerializable { - /* - * server version - */ - private String name; - - /** - * Creates an instance of ServerVersionCapabilityV2 class. - */ - public ServerVersionCapabilityV2() { - } - - /** - * Get the name property: server version. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Validates the 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 ServerVersionCapabilityV2 from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ServerVersionCapabilityV2 if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IOException If an error occurs while reading the ServerVersionCapabilityV2. - */ - public static ServerVersionCapabilityV2 fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ServerVersionCapabilityV2 deserializedServerVersionCapabilityV2 = new ServerVersionCapabilityV2(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - deserializedServerVersionCapabilityV2.name = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedServerVersionCapabilityV2; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Servers.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Servers.java index 6d9e3a1ed37d4..5aac88dffc04f 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Servers.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Servers.java @@ -7,7 +7,6 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.HighAvailabilityValidationEstimationInner; /** * Resource collection API of Servers. @@ -127,36 +126,6 @@ public interface Servers { */ void failover(String resourceGroupName, String serverName, Context context); - /** - * Validate a deployment of high availability. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for validation of high availability deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return high availability validation properties of a server along with {@link Response}. - */ - Response validateEstimateHighAvailabilityWithResponse( - String resourceGroupName, String serverName, HighAvailabilityValidationEstimationInner parameters, - Context context); - - /** - * Validate a deployment of high availability. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for validation of high availability deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return high availability validation properties of a server. - */ - HighAvailabilityValidationEstimation validateEstimateHighAvailability(String resourceGroupName, String serverName, - HighAvailabilityValidationEstimationInner parameters); - /** * Restarts a server. * @@ -228,31 +197,6 @@ HighAvailabilityValidationEstimation validateEstimateHighAvailability(String res */ void stop(String resourceGroupName, String serverName, Context context); - /** - * Resets GTID on a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for resetting GTID on a server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void resetGtid(String resourceGroupName, String serverName, ServerGtidSetParameter parameters); - - /** - * Resets GTID on a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param parameters The required parameters for resetting GTID on a server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void resetGtid(String resourceGroupName, String serverName, ServerGtidSetParameter parameters, Context context); - /** * Gets information about a server. * diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServersMigrations.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServersMigrations.java deleted file mode 100644 index 0065f5d5b0698..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/ServersMigrations.java +++ /dev/null @@ -1,37 +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.mysqlflexibleserver.models; - -import com.azure.core.util.Context; - -/** - * Resource collection API of ServersMigrations. - */ -public interface ServersMigrations { - /** - * Cutover migration for MySQL import, it will switch source elastic server DNS to flexible server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a server. - */ - Server cutoverMigration(String resourceGroupName, String serverName); - - /** - * Cutover migration for MySQL import, it will switch source elastic server DNS to flexible server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a server. - */ - Server cutoverMigration(String resourceGroupName, String serverName, Context context); -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MySqlServerSku.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Sku.java similarity index 67% rename from sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MySqlServerSku.java rename to sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Sku.java index 318f558a47e74..5efbc5715f435 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/MySqlServerSku.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Sku.java @@ -16,7 +16,7 @@ * Billing information related properties of a server. */ @Fluent -public final class MySqlServerSku implements JsonSerializable { +public final class Sku implements JsonSerializable { /* * The name of the sku, e.g. Standard_D32s_v3. */ @@ -25,12 +25,12 @@ public final class MySqlServerSku implements JsonSerializable { /* * The tier of the particular SKU, e.g. GeneralPurpose. */ - private ServerSkuTier tier; + private SkuTier tier; /** - * Creates an instance of MySqlServerSku class. + * Creates an instance of Sku class. */ - public MySqlServerSku() { + public Sku() { } /** @@ -46,9 +46,9 @@ public String name() { * Set the name property: The name of the sku, e.g. Standard_D32s_v3. * * @param name the name value to set. - * @return the MySqlServerSku object itself. + * @return the Sku object itself. */ - public MySqlServerSku withName(String name) { + public Sku withName(String name) { this.name = name; return this; } @@ -58,7 +58,7 @@ public MySqlServerSku withName(String name) { * * @return the tier value. */ - public ServerSkuTier tier() { + public SkuTier tier() { return this.tier; } @@ -66,9 +66,9 @@ public ServerSkuTier tier() { * Set the tier property: The tier of the particular SKU, e.g. GeneralPurpose. * * @param tier the tier value to set. - * @return the MySqlServerSku object itself. + * @return the Sku object itself. */ - public MySqlServerSku withTier(ServerSkuTier tier) { + public Sku withTier(SkuTier tier) { this.tier = tier; return this; } @@ -80,16 +80,14 @@ public MySqlServerSku withTier(ServerSkuTier tier) { */ public void validate() { if (name() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property name in model MySqlServerSku")); + throw LOGGER.atError().log(new IllegalArgumentException("Missing required property name in model Sku")); } if (tier() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property tier in model MySqlServerSku")); + throw LOGGER.atError().log(new IllegalArgumentException("Missing required property tier in model Sku")); } } - private static final ClientLogger LOGGER = new ClientLogger(MySqlServerSku.class); + private static final ClientLogger LOGGER = new ClientLogger(Sku.class); /** * {@inheritDoc} @@ -103,31 +101,31 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of MySqlServerSku from the JsonReader. + * Reads an instance of Sku from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of MySqlServerSku if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. + * @return An instance of Sku if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the MySqlServerSku. + * @throws IOException If an error occurs while reading the Sku. */ - public static MySqlServerSku fromJson(JsonReader jsonReader) throws IOException { + public static Sku fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - MySqlServerSku deserializedMySqlServerSku = new MySqlServerSku(); + Sku deserializedSku = new Sku(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("name".equals(fieldName)) { - deserializedMySqlServerSku.name = reader.getString(); + deserializedSku.name = reader.getString(); } else if ("tier".equals(fieldName)) { - deserializedMySqlServerSku.tier = ServerSkuTier.fromString(reader.getString()); + deserializedSku.tier = SkuTier.fromString(reader.getString()); } else { reader.skipChildren(); } } - return deserializedMySqlServerSku; + return deserializedSku; }); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/SkuCapabilityV2.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/SkuCapabilityV2.java deleted file mode 100644 index f1efedfabda89..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/SkuCapabilityV2.java +++ /dev/null @@ -1,164 +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.mysqlflexibleserver.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; - -/** - * Sku capability. - */ -@Immutable -public final class SkuCapabilityV2 implements JsonSerializable { - /* - * vCore name - */ - private String name; - - /* - * supported vCores - */ - private Long vCores; - - /* - * supported IOPS - */ - private Long supportedIops; - - /* - * supported memory per vCore in MB - */ - private Long supportedMemoryPerVCoreMB; - - /* - * Supported zones - */ - private List supportedZones; - - /* - * Supported high availability mode - */ - private List supportedHAMode; - - /** - * Creates an instance of SkuCapabilityV2 class. - */ - public SkuCapabilityV2() { - } - - /** - * Get the name property: vCore name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the vCores property: supported vCores. - * - * @return the vCores value. - */ - public Long vCores() { - return this.vCores; - } - - /** - * Get the supportedIops property: supported IOPS. - * - * @return the supportedIops value. - */ - public Long supportedIops() { - return this.supportedIops; - } - - /** - * Get the supportedMemoryPerVCoreMB property: supported memory per vCore in MB. - * - * @return the supportedMemoryPerVCoreMB value. - */ - public Long supportedMemoryPerVCoreMB() { - return this.supportedMemoryPerVCoreMB; - } - - /** - * Get the supportedZones property: Supported zones. - * - * @return the supportedZones value. - */ - public List supportedZones() { - return this.supportedZones; - } - - /** - * Get the supportedHAMode property: Supported high availability mode. - * - * @return the supportedHAMode value. - */ - public List supportedHAMode() { - return this.supportedHAMode; - } - - /** - * Validates the 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 SkuCapabilityV2 from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SkuCapabilityV2 if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the SkuCapabilityV2. - */ - public static SkuCapabilityV2 fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SkuCapabilityV2 deserializedSkuCapabilityV2 = new SkuCapabilityV2(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - deserializedSkuCapabilityV2.name = reader.getString(); - } else if ("vCores".equals(fieldName)) { - deserializedSkuCapabilityV2.vCores = reader.getNullable(JsonReader::getLong); - } else if ("supportedIops".equals(fieldName)) { - deserializedSkuCapabilityV2.supportedIops = reader.getNullable(JsonReader::getLong); - } else if ("supportedMemoryPerVCoreMB".equals(fieldName)) { - deserializedSkuCapabilityV2.supportedMemoryPerVCoreMB = reader.getNullable(JsonReader::getLong); - } else if ("supportedZones".equals(fieldName)) { - List supportedZones = reader.readArray(reader1 -> reader1.getString()); - deserializedSkuCapabilityV2.supportedZones = supportedZones; - } else if ("supportedHAMode".equals(fieldName)) { - List supportedHAMode = reader.readArray(reader1 -> reader1.getString()); - deserializedSkuCapabilityV2.supportedHAMode = supportedHAMode; - } else { - reader.skipChildren(); - } - } - - return deserializedSkuCapabilityV2; - }); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/SkuTier.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/SkuTier.java new file mode 100644 index 0000000000000..fbd0df4ca90dc --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/SkuTier.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.mysqlflexibleserver.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The tier of the particular SKU, e.g. GeneralPurpose. + */ +public final class SkuTier extends ExpandableStringEnum { + /** + * Static value Burstable for SkuTier. + */ + public static final SkuTier BURSTABLE = fromString("Burstable"); + + /** + * Static value GeneralPurpose for SkuTier. + */ + public static final SkuTier GENERAL_PURPOSE = fromString("GeneralPurpose"); + + /** + * Static value MemoryOptimized for SkuTier. + */ + public static final SkuTier MEMORY_OPTIMIZED = fromString("MemoryOptimized"); + + /** + * Creates a new instance of SkuTier value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SkuTier() { + } + + /** + * Creates or finds a SkuTier from its string representation. + * + * @param name a name to look for. + * @return the corresponding SkuTier. + */ + public static SkuTier fromString(String name) { + return fromString(name, SkuTier.class); + } + + /** + * Gets known SkuTier values. + * + * @return known SkuTier values. + */ + public static Collection values() { + return values(SkuTier.class); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Storage.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Storage.java index d930e17505556..7f18171dd8628 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Storage.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/Storage.java @@ -31,21 +31,11 @@ public final class Storage implements JsonSerializable { */ private EnableStatusEnum autoGrow; - /* - * Enable Log On Disk or not. - */ - private EnableStatusEnum logOnDisk; - /* * The sku name of the server storage. */ private String storageSku; - /* - * Enable IO Auto Scaling or not. - */ - private EnableStatusEnum autoIoScaling; - /** * Creates an instance of Storage class. */ @@ -112,26 +102,6 @@ public Storage withAutoGrow(EnableStatusEnum autoGrow) { return this; } - /** - * Get the logOnDisk property: Enable Log On Disk or not. - * - * @return the logOnDisk value. - */ - public EnableStatusEnum logOnDisk() { - return this.logOnDisk; - } - - /** - * Set the logOnDisk property: Enable Log On Disk or not. - * - * @param logOnDisk the logOnDisk value to set. - * @return the Storage object itself. - */ - public Storage withLogOnDisk(EnableStatusEnum logOnDisk) { - this.logOnDisk = logOnDisk; - return this; - } - /** * Get the storageSku property: The sku name of the server storage. * @@ -141,26 +111,6 @@ public String storageSku() { return this.storageSku; } - /** - * Get the autoIoScaling property: Enable IO Auto Scaling or not. - * - * @return the autoIoScaling value. - */ - public EnableStatusEnum autoIoScaling() { - return this.autoIoScaling; - } - - /** - * Set the autoIoScaling property: Enable IO Auto Scaling or not. - * - * @param autoIoScaling the autoIoScaling value to set. - * @return the Storage object itself. - */ - public Storage withAutoIoScaling(EnableStatusEnum autoIoScaling) { - this.autoIoScaling = autoIoScaling; - return this; - } - /** * Validates the instance. * @@ -178,8 +128,6 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeNumberField("storageSizeGB", this.storageSizeGB); jsonWriter.writeNumberField("iops", this.iops); jsonWriter.writeStringField("autoGrow", this.autoGrow == null ? null : this.autoGrow.toString()); - jsonWriter.writeStringField("logOnDisk", this.logOnDisk == null ? null : this.logOnDisk.toString()); - jsonWriter.writeStringField("autoIoScaling", this.autoIoScaling == null ? null : this.autoIoScaling.toString()); return jsonWriter.writeEndObject(); } @@ -204,12 +152,8 @@ public static Storage fromJson(JsonReader jsonReader) throws IOException { deserializedStorage.iops = reader.getNullable(JsonReader::getInt); } else if ("autoGrow".equals(fieldName)) { deserializedStorage.autoGrow = EnableStatusEnum.fromString(reader.getString()); - } else if ("logOnDisk".equals(fieldName)) { - deserializedStorage.logOnDisk = EnableStatusEnum.fromString(reader.getString()); } else if ("storageSku".equals(fieldName)) { deserializedStorage.storageSku = reader.getString(); - } else if ("autoIoScaling".equals(fieldName)) { - deserializedStorage.autoIoScaling = EnableStatusEnum.fromString(reader.getString()); } else { reader.skipChildren(); } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/StorageEditionCapability.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/StorageEditionCapability.java index 27b3970351046..df4a8a04e6796 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/StorageEditionCapability.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/main/java/com/azure/resourcemanager/mysqlflexibleserver/models/StorageEditionCapability.java @@ -41,16 +41,6 @@ public final class StorageEditionCapability implements JsonSerializable Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MySqlManager manager = MySqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - AdvancedThreatProtection response = manager.advancedThreatProtectionSettings() - .getWithResponse("t", "ld", AdvancedThreatProtectionName.DEFAULT, com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(AdvancedThreatProtectionState.ENABLED, response.state()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionSettingsListMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionSettingsListMockTests.java deleted file mode 100644 index b4db885ac9821..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionSettingsListMockTests.java +++ /dev/null @@ -1,40 +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.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtection; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionState; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class AdvancedThreatProtectionSettingsListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"creationTime\":\"2021-03-27T20:00:22Z\",\"state\":\"Enabled\",\"provisioningState\":\"Failed\"},\"id\":\"fmzzsdymbrny\",\"name\":\"u\",\"type\":\"m\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MySqlManager manager = MySqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.advancedThreatProtectionSettings() - .list("hihfrbbcevqagtlt", "hlfkqojpy", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(AdvancedThreatProtectionState.ENABLED, response.iterator().next().state()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionSettingsUpdateMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionSettingsUpdateMockTests.java deleted file mode 100644 index 58ba3abc790f1..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionSettingsUpdateMockTests.java +++ /dev/null @@ -1,43 +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.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtection; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionForUpdate; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionName; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionState; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class AdvancedThreatProtectionSettingsUpdateMockTests { - @Test - public void testUpdate() throws Exception { - String responseStr - = "{\"properties\":{\"creationTime\":\"2021-06-11T04:36:53Z\",\"state\":\"Enabled\",\"provisioningState\":\"Succeeded\"},\"id\":\"dz\",\"name\":\"ezwwv\",\"type\":\"iqyuvvfo\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MySqlManager manager = MySqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - AdvancedThreatProtection response = manager.advancedThreatProtectionSettings() - .update("jlmxhomdynhd", "digumbnr", AdvancedThreatProtectionName.DEFAULT, - new AdvancedThreatProtectionForUpdate().withState(AdvancedThreatProtectionState.ENABLED), - com.azure.core.util.Context.NONE); - - Assertions.assertEquals(AdvancedThreatProtectionState.ENABLED, response.state()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionSettingsUpdatePutMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionSettingsUpdatePutMockTests.java deleted file mode 100644 index 5766d7d914527..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionSettingsUpdatePutMockTests.java +++ /dev/null @@ -1,43 +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.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AdvancedThreatProtectionInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtection; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionName; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionState; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class AdvancedThreatProtectionSettingsUpdatePutMockTests { - @Test - public void testUpdatePut() throws Exception { - String responseStr - = "{\"properties\":{\"creationTime\":\"2020-12-25T01:29:23Z\",\"state\":\"Disabled\",\"provisioningState\":\"Succeeded\"},\"id\":\"mtk\",\"name\":\"bo\",\"type\":\"ppnvdxz\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MySqlManager manager = MySqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - AdvancedThreatProtection response = manager.advancedThreatProtectionSettings() - .updatePut("kphhq", "ikvylauya", AdvancedThreatProtectionName.DEFAULT, - new AdvancedThreatProtectionInner().withState(AdvancedThreatProtectionState.DISABLED), - com.azure.core.util.Context.NONE); - - Assertions.assertEquals(AdvancedThreatProtectionState.DISABLED, response.state()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionUpdatePropertiesTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionUpdatePropertiesTests.java deleted file mode 100644 index e084764290dc5..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AdvancedThreatProtectionUpdatePropertiesTests.java +++ /dev/null @@ -1,27 +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.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AdvancedThreatProtectionUpdateProperties; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdvancedThreatProtectionState; -import org.junit.jupiter.api.Assertions; - -public final class AdvancedThreatProtectionUpdatePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AdvancedThreatProtectionUpdateProperties model - = BinaryData.fromString("{\"state\":\"Enabled\"}").toObject(AdvancedThreatProtectionUpdateProperties.class); - Assertions.assertEquals(AdvancedThreatProtectionState.ENABLED, model.state()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AdvancedThreatProtectionUpdateProperties model - = new AdvancedThreatProtectionUpdateProperties().withState(AdvancedThreatProtectionState.ENABLED); - model = BinaryData.fromObject(model).toObject(AdvancedThreatProtectionUpdateProperties.class); - Assertions.assertEquals(AdvancedThreatProtectionState.ENABLED, model.state()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorInnerTests.java deleted file mode 100644 index a1398f0517633..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorInnerTests.java +++ /dev/null @@ -1,40 +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.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AzureADAdministratorInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorType; -import org.junit.jupiter.api.Assertions; - -public final class AzureADAdministratorInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AzureADAdministratorInner model = BinaryData.fromString( - "{\"properties\":{\"administratorType\":\"ActiveDirectory\",\"login\":\"uv\",\"sid\":\"xpyb\",\"tenantId\":\"m\",\"identityResourceId\":\"mtz\"},\"id\":\"bsphrupidgsybbe\",\"name\":\"hphoycm\",\"type\":\"xaobhdxbmtqioqjz\"}") - .toObject(AzureADAdministratorInner.class); - Assertions.assertEquals(AdministratorType.ACTIVE_DIRECTORY, model.administratorType()); - Assertions.assertEquals("uv", model.login()); - Assertions.assertEquals("xpyb", model.sid()); - Assertions.assertEquals("m", model.tenantId()); - Assertions.assertEquals("mtz", model.identityResourceId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AzureADAdministratorInner model - = new AzureADAdministratorInner().withAdministratorType(AdministratorType.ACTIVE_DIRECTORY) - .withLogin("uv") - .withSid("xpyb") - .withTenantId("m") - .withIdentityResourceId("mtz"); - model = BinaryData.fromObject(model).toObject(AzureADAdministratorInner.class); - Assertions.assertEquals(AdministratorType.ACTIVE_DIRECTORY, model.administratorType()); - Assertions.assertEquals("uv", model.login()); - Assertions.assertEquals("xpyb", model.sid()); - Assertions.assertEquals("m", model.tenantId()); - Assertions.assertEquals("mtz", model.identityResourceId()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsCreateOrUpdateMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsCreateOrUpdateMockTests.java deleted file mode 100644 index 4a036bf20a6d2..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsCreateOrUpdateMockTests.java +++ /dev/null @@ -1,51 +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.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorName; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorType; -import com.azure.resourcemanager.mysqlflexibleserver.models.AzureADAdministrator; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class AzureADAdministratorsCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - String responseStr - = "{\"properties\":{\"administratorType\":\"ActiveDirectory\",\"login\":\"qhhahhxvrhmzkwpj\",\"sid\":\"wspughftqsxhqx\",\"tenantId\":\"xukndxdigr\",\"identityResourceId\":\"uufzdmsyqtfihw\"},\"id\":\"otzi\",\"name\":\"gamv\",\"type\":\"phoszqz\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MySqlManager manager = MySqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - AzureADAdministrator response = manager.azureADAdministrators() - .define(AdministratorName.ACTIVE_DIRECTORY) - .withExistingFlexibleServer("irgzp", "rlazszrnw") - .withAdministratorType(AdministratorType.ACTIVE_DIRECTORY) - .withLogin("pwp") - .withSid("lwbtlhf") - .withTenantId("jcdh") - .withIdentityResourceId("fjvfbgofeljagr") - .create(); - - Assertions.assertEquals(AdministratorType.ACTIVE_DIRECTORY, response.administratorType()); - Assertions.assertEquals("qhhahhxvrhmzkwpj", response.login()); - Assertions.assertEquals("wspughftqsxhqx", response.sid()); - Assertions.assertEquals("xukndxdigr", response.tenantId()); - Assertions.assertEquals("uufzdmsyqtfihw", response.identityResourceId()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsDeleteMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsDeleteMockTests.java deleted file mode 100644 index cefb63240e106..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsDeleteMockTests.java +++ /dev/null @@ -1,36 +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.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorName; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class AzureADAdministratorsDeleteMockTests { - @Test - public void testDelete() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MySqlManager manager = MySqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.azureADAdministrators() - .delete("tawfsdjpvkvp", "jxbkzbzkdvn", AdministratorName.ACTIVE_DIRECTORY, - com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsGetWithResponseMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsGetWithResponseMockTests.java deleted file mode 100644 index 53289cbb668ef..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsGetWithResponseMockTests.java +++ /dev/null @@ -1,45 +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.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorName; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorType; -import com.azure.resourcemanager.mysqlflexibleserver.models.AzureADAdministrator; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class AzureADAdministratorsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"administratorType\":\"ActiveDirectory\",\"login\":\"fhmouwq\",\"sid\":\"zrfze\",\"tenantId\":\"ebizikayuh\",\"identityResourceId\":\"bjbsybb\"},\"id\":\"r\",\"name\":\"t\",\"type\":\"dgmfpgvmpipasl\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MySqlManager manager = MySqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - AzureADAdministrator response = manager.azureADAdministrators() - .getWithResponse("abudurgk", "kmokz", AdministratorName.ACTIVE_DIRECTORY, com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(AdministratorType.ACTIVE_DIRECTORY, response.administratorType()); - Assertions.assertEquals("fhmouwq", response.login()); - Assertions.assertEquals("zrfze", response.sid()); - Assertions.assertEquals("ebizikayuh", response.tenantId()); - Assertions.assertEquals("bjbsybb", response.identityResourceId()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsListByServerMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsListByServerMockTests.java deleted file mode 100644 index c876e59637db5..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/AzureADAdministratorsListByServerMockTests.java +++ /dev/null @@ -1,44 +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.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorType; -import com.azure.resourcemanager.mysqlflexibleserver.models.AzureADAdministrator; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class AzureADAdministratorsListByServerMockTests { - @Test - public void testListByServer() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"administratorType\":\"ActiveDirectory\",\"login\":\"twbdsrezpdrhn\",\"sid\":\"yowqkdwytisibir\",\"tenantId\":\"pikpz\",\"identityResourceId\":\"ejzanlfz\"},\"id\":\"av\",\"name\":\"mbzonokix\",\"type\":\"jq\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MySqlManager manager = MySqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.azureADAdministrators().listByServer("haq", "x", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(AdministratorType.ACTIVE_DIRECTORY, response.iterator().next().administratorType()); - Assertions.assertEquals("twbdsrezpdrhn", response.iterator().next().login()); - Assertions.assertEquals("yowqkdwytisibir", response.iterator().next().sid()); - Assertions.assertEquals("pikpz", response.iterator().next().tenantId()); - Assertions.assertEquals("ejzanlfz", response.iterator().next().identityResourceId()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportRequestTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportRequestTests.java deleted file mode 100644 index c324ccfed6eb2..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportRequestTests.java +++ /dev/null @@ -1,34 +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.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupAndExportRequest; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupFormat; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupSettings; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupStoreDetails; -import org.junit.jupiter.api.Assertions; - -public final class BackupAndExportRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BackupAndExportRequest model = BinaryData.fromString( - "{\"targetDetails\":{\"objectType\":\"BackupStoreDetails\"},\"backupSettings\":{\"backupName\":\"ixjsprozvcputeg\",\"backupFormat\":\"Raw\"}}") - .toObject(BackupAndExportRequest.class); - Assertions.assertEquals("ixjsprozvcputeg", model.backupSettings().backupName()); - Assertions.assertEquals(BackupFormat.RAW, model.backupSettings().backupFormat()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BackupAndExportRequest model = new BackupAndExportRequest() - .withBackupSettings( - new BackupSettings().withBackupName("ixjsprozvcputeg").withBackupFormat(BackupFormat.RAW)) - .withTargetDetails(new BackupStoreDetails()); - model = BinaryData.fromObject(model).toObject(BackupAndExportRequest.class); - Assertions.assertEquals("ixjsprozvcputeg", model.backupSettings().backupName()); - Assertions.assertEquals(BackupFormat.RAW, model.backupSettings().backupFormat()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportResponsePropertiesTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportResponsePropertiesTests.java deleted file mode 100644 index 81dfd8a67f54f..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportResponsePropertiesTests.java +++ /dev/null @@ -1,33 +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.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.BackupAndExportResponseProperties; -import org.junit.jupiter.api.Assertions; - -public final class BackupAndExportResponsePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BackupAndExportResponseProperties model = BinaryData.fromString( - "{\"datasourceSizeInBytes\":1188445860245908260,\"dataTransferredInBytes\":5160558923391750551,\"backupMetadata\":\"fdosyg\"}") - .toObject(BackupAndExportResponseProperties.class); - Assertions.assertEquals(1188445860245908260L, model.datasourceSizeInBytes()); - Assertions.assertEquals(5160558923391750551L, model.dataTransferredInBytes()); - Assertions.assertEquals("fdosyg", model.backupMetadata()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BackupAndExportResponseProperties model - = new BackupAndExportResponseProperties().withDatasourceSizeInBytes(1188445860245908260L) - .withDataTransferredInBytes(5160558923391750551L) - .withBackupMetadata("fdosyg"); - model = BinaryData.fromObject(model).toObject(BackupAndExportResponseProperties.class); - Assertions.assertEquals(1188445860245908260L, model.datasourceSizeInBytes()); - Assertions.assertEquals(5160558923391750551L, model.dataTransferredInBytes()); - Assertions.assertEquals("fdosyg", model.backupMetadata()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportResponseTypeTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportResponseTypeTests.java deleted file mode 100644 index e018f219e1ec7..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportResponseTypeTests.java +++ /dev/null @@ -1,33 +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.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupAndExportResponseType; -import org.junit.jupiter.api.Assertions; - -public final class BackupAndExportResponseTypeTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BackupAndExportResponseType model = BinaryData.fromString( - "{\"objectType\":\"BackupAndExportResponse\",\"datasourceSizeInBytes\":6258392064517057846,\"dataTransferredInBytes\":2176235645270803384,\"backupMetadata\":\"jivfxzsjabib\"}") - .toObject(BackupAndExportResponseType.class); - Assertions.assertEquals(6258392064517057846L, model.datasourceSizeInBytes()); - Assertions.assertEquals(2176235645270803384L, model.dataTransferredInBytes()); - Assertions.assertEquals("jivfxzsjabib", model.backupMetadata()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BackupAndExportResponseType model - = new BackupAndExportResponseType().withDatasourceSizeInBytes(6258392064517057846L) - .withDataTransferredInBytes(2176235645270803384L) - .withBackupMetadata("jivfxzsjabib"); - model = BinaryData.fromObject(model).toObject(BackupAndExportResponseType.class); - Assertions.assertEquals(6258392064517057846L, model.datasourceSizeInBytes()); - Assertions.assertEquals(2176235645270803384L, model.dataTransferredInBytes()); - Assertions.assertEquals("jivfxzsjabib", model.backupMetadata()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportsValidateBackupWithResponseMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportsValidateBackupWithResponseMockTests.java deleted file mode 100644 index ac8c1cef8647c..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupAndExportsValidateBackupWithResponseMockTests.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.ValidateBackupResponse; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class BackupAndExportsValidateBackupWithResponseMockTests { - @Test - public void testValidateBackupWithResponse() throws Exception { - String responseStr = "{\"properties\":{\"numberOfContainers\":488471027}}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MySqlManager manager = MySqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ValidateBackupResponse response = manager.backupAndExports() - .validateBackupWithResponse("wz", "bnhlmc", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(488471027, response.numberOfContainers()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupRequestBaseTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupRequestBaseTests.java deleted file mode 100644 index 9d4402068254f..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupRequestBaseTests.java +++ /dev/null @@ -1,31 +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.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupFormat; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupRequestBase; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupSettings; -import org.junit.jupiter.api.Assertions; - -public final class BackupRequestBaseTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BackupRequestBase model - = BinaryData.fromString("{\"backupSettings\":{\"backupName\":\"mfdatscmdvpj\",\"backupFormat\":\"Raw\"}}") - .toObject(BackupRequestBase.class); - Assertions.assertEquals("mfdatscmdvpj", model.backupSettings().backupName()); - Assertions.assertEquals(BackupFormat.RAW, model.backupSettings().backupFormat()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BackupRequestBase model = new BackupRequestBase() - .withBackupSettings(new BackupSettings().withBackupName("mfdatscmdvpj").withBackupFormat(BackupFormat.RAW)); - model = BinaryData.fromObject(model).toObject(BackupRequestBase.class); - Assertions.assertEquals("mfdatscmdvpj", model.backupSettings().backupName()); - Assertions.assertEquals(BackupFormat.RAW, model.backupSettings().backupFormat()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupSettingsTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupSettingsTests.java deleted file mode 100644 index dc90d09ba0a94..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupSettingsTests.java +++ /dev/null @@ -1,28 +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.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupFormat; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupSettings; -import org.junit.jupiter.api.Assertions; - -public final class BackupSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BackupSettings model = BinaryData.fromString("{\"backupName\":\"suuv\",\"backupFormat\":\"Raw\"}") - .toObject(BackupSettings.class); - Assertions.assertEquals("suuv", model.backupName()); - Assertions.assertEquals(BackupFormat.RAW, model.backupFormat()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BackupSettings model = new BackupSettings().withBackupName("suuv").withBackupFormat(BackupFormat.RAW); - model = BinaryData.fromObject(model).toObject(BackupSettings.class); - Assertions.assertEquals("suuv", model.backupName()); - Assertions.assertEquals(BackupFormat.RAW, model.backupFormat()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupStoreDetailsTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupStoreDetailsTests.java deleted file mode 100644 index 730d5eb543acd..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupStoreDetailsTests.java +++ /dev/null @@ -1,22 +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.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupStoreDetails; - -public final class BackupStoreDetailsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BackupStoreDetails model - = BinaryData.fromString("{\"objectType\":\"BackupStoreDetails\"}").toObject(BackupStoreDetails.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BackupStoreDetails model = new BackupStoreDetails(); - model = BinaryData.fromObject(model).toObject(BackupStoreDetails.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupTests.java index 7bcb2b458b9fd..580e8f2baf6fa 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupTests.java @@ -13,21 +13,18 @@ public final class BackupTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { Backup model = BinaryData.fromString( - "{\"backupRetentionDays\":1913635803,\"backupIntervalHours\":1733107709,\"geoRedundantBackup\":\"Enabled\",\"earliestRestoreDate\":\"2021-11-26T04:57:33Z\"}") + "{\"backupRetentionDays\":1950851050,\"geoRedundantBackup\":\"Disabled\",\"earliestRestoreDate\":\"2021-01-21T08:28Z\"}") .toObject(Backup.class); - Assertions.assertEquals(1913635803, model.backupRetentionDays()); - Assertions.assertEquals(1733107709, model.backupIntervalHours()); - Assertions.assertEquals(EnableStatusEnum.ENABLED, model.geoRedundantBackup()); + Assertions.assertEquals(1950851050, model.backupRetentionDays()); + Assertions.assertEquals(EnableStatusEnum.DISABLED, model.geoRedundantBackup()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - Backup model = new Backup().withBackupRetentionDays(1913635803) - .withBackupIntervalHours(1733107709) - .withGeoRedundantBackup(EnableStatusEnum.ENABLED); + Backup model + = new Backup().withBackupRetentionDays(1950851050).withGeoRedundantBackup(EnableStatusEnum.DISABLED); model = BinaryData.fromObject(model).toObject(Backup.class); - Assertions.assertEquals(1913635803, model.backupRetentionDays()); - Assertions.assertEquals(1733107709, model.backupIntervalHours()); - Assertions.assertEquals(EnableStatusEnum.ENABLED, model.geoRedundantBackup()); + Assertions.assertEquals(1950851050, model.backupRetentionDays()); + Assertions.assertEquals(EnableStatusEnum.DISABLED, model.geoRedundantBackup()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupsGetWithResponseMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupsGetWithResponseMockTests.java index faa224e72a328..796a3b346271e 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupsGetWithResponseMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupsGetWithResponseMockTests.java @@ -21,7 +21,7 @@ public final class BackupsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"backupType\":\"vezrypqlmfeo\",\"completedTime\":\"2021-08-09T08:39:34Z\",\"source\":\"wkyhkobopgxe\"},\"id\":\"owepbqpcrfkb\",\"name\":\"ccsnjvcdwxlpq\",\"type\":\"kftnkhtjsyin\"}"; + = "{\"properties\":{\"backupType\":\"xdbabphlwr\",\"completedTime\":\"2021-04-06T00:21:45Z\",\"source\":\"tsthsucocm\"},\"id\":\"yazttbtwwrqpue\",\"name\":\"ckzywbiexzfeyue\",\"type\":\"xibxujwbhqwalm\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -31,11 +31,11 @@ public void testGetWithResponse() throws Exception { new AzureProfile("", "", AzureEnvironment.AZURE)); ServerBackup response = manager.backups() - .getWithResponse("wzrmuh", "pfcqdp", "qxqvpsvuoymgc", com.azure.core.util.Context.NONE) + .getWithResponse("tnrsyn", "qidybyx", "zfcl", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("vezrypqlmfeo", response.backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-09T08:39:34Z"), response.completedTime()); - Assertions.assertEquals("wkyhkobopgxe", response.source()); + Assertions.assertEquals("xdbabphlwr", response.backupType()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-06T00:21:45Z"), response.completedTime()); + Assertions.assertEquals("tsthsucocm", response.source()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupsListByServerMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupsListByServerMockTests.java index b79494451f0ba..4d049487e9846 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupsListByServerMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupsListByServerMockTests.java @@ -22,7 +22,7 @@ public final class BackupsListByServerMockTests { @Test public void testListByServer() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"backupType\":\"kbir\",\"completedTime\":\"2021-03-20T05:32:50Z\",\"source\":\"hlhkjoqrvqqaatj\"},\"id\":\"rv\",\"name\":\"oupmfii\",\"type\":\"fggjioolvr\"}]}"; + = "{\"value\":[{\"properties\":{\"backupType\":\"wbavxbniwdj\",\"completedTime\":\"2021-04-13T19:54:16Z\",\"source\":\"s\"},\"id\":\"pgn\",\"name\":\"ytxhp\",\"type\":\"xbzpfzab\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -32,11 +32,11 @@ public void testListByServer() throws Exception { new AzureProfile("", "", AzureEnvironment.AZURE)); PagedIterable response - = manager.backups().listByServer("wfqatmtd", "tmdvypgikdgs", com.azure.core.util.Context.NONE); + = manager.backups().listByServer("zyoxaepdkzjan", "ux", com.azure.core.util.Context.NONE); - Assertions.assertEquals("kbir", response.iterator().next().backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-20T05:32:50Z"), + Assertions.assertEquals("wbavxbniwdj", response.iterator().next().backupType()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-13T19:54:16Z"), response.iterator().next().completedTime()); - Assertions.assertEquals("hlhkjoqrvqqaatj", response.iterator().next().source()); + Assertions.assertEquals("s", response.iterator().next().source()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupsPutWithResponseMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupsPutWithResponseMockTests.java deleted file mode 100644 index ed58fb84427f6..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/BackupsPutWithResponseMockTests.java +++ /dev/null @@ -1,41 +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.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerBackup; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class BackupsPutWithResponseMockTests { - @Test - public void testPutWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"backupType\":\"vyqia\",\"completedTime\":\"2021-01-15T03:57:36Z\",\"source\":\"pcnp\"},\"id\":\"cjaesgvvs\",\"name\":\"cyajguqf\",\"type\":\"wygzlvdnkfxusem\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MySqlManager manager = MySqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ServerBackup response = manager.backups() - .putWithResponse("dphqamv", "kfwynw", "vtbvkayh", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("vyqia", response.backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-15T03:57:36Z"), response.completedTime()); - Assertions.assertEquals("pcnp", response.source()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CapabilitiesListResultTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CapabilitiesListResultTests.java index 0669ab7d54b96..105432f72b679 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CapabilitiesListResultTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CapabilitiesListResultTests.java @@ -11,7 +11,7 @@ public final class CapabilitiesListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CapabilitiesListResult model = BinaryData.fromString( - "{\"value\":[{\"zone\":\"zycispn\",\"supportedHAMode\":[\"hmgkbrpyy\",\"hibnuqqkpika\"],\"supportedGeoBackupRegions\":[\"vtq\",\"gnbuy\",\"hijggme\"],\"supportedFlexibleServerEditions\":[{\"name\":\"arbu\",\"supportedStorageEditions\":[{},{},{},{}],\"supportedServerVersions\":[{},{}]},{\"name\":\"azzmhjrunmpxt\",\"supportedStorageEditions\":[{}],\"supportedServerVersions\":[{},{},{},{}]},{\"name\":\"nlankxmyskpb\",\"supportedStorageEditions\":[{},{},{},{}],\"supportedServerVersions\":[{},{},{},{}]}]}],\"nextLink\":\"cxy\"}") + "{\"value\":[{\"zone\":\"kexxppof\",\"supportedHAMode\":[\"x\",\"fjpgddtocjjxhvp\",\"o\",\"exhd\"],\"supportedGeoBackupRegions\":[\"bqe\"],\"supportedFlexibleServerEditions\":[{\"name\":\"qbzvddntwnd\",\"supportedStorageEditions\":[{},{},{},{}],\"supportedServerVersions\":[{},{},{},{}]},{\"name\":\"npzaoq\",\"supportedStorageEditions\":[{},{},{},{}],\"supportedServerVersions\":[{},{},{},{}]},{\"name\":\"f\",\"supportedStorageEditions\":[{}],\"supportedServerVersions\":[{},{},{}]}]},{\"zone\":\"lmjthjq\",\"supportedHAMode\":[\"yeicxmqciwqvhk\",\"ixuigdtopbobj\"],\"supportedGeoBackupRegions\":[\"m\"],\"supportedFlexibleServerEditions\":[{\"name\":\"m\",\"supportedStorageEditions\":[{},{},{},{}],\"supportedServerVersions\":[{}]}]}],\"nextLink\":\"yvvtpgvdfgio\"}") .toObject(CapabilitiesListResult.class); } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CapabilityInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CapabilityInnerTests.java deleted file mode 100644 index 8f6d6e53eba77..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CapabilityInnerTests.java +++ /dev/null @@ -1,23 +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.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.CapabilityInner; - -public final class CapabilityInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CapabilityInner model = BinaryData.fromString( - "{\"properties\":{\"supportedGeoBackupRegions\":[\"dxwitx\"],\"supportedFlexibleServerEditions\":[{\"name\":\"wgqwgxhn\",\"defaultSku\":\"kxfbkpycgklwndn\",\"defaultStorageSize\":1205583230,\"supportedStorageEditions\":[{\"name\":\"hvylwzbt\",\"minStorageSize\":3335905424967181903,\"maxStorageSize\":5441871026164197951,\"minBackupRetentionDays\":9120098526772116433,\"maxBackupRetentionDays\":133246775143239397,\"minBackupIntervalHours\":8891221399810858011,\"maxBackupIntervalHours\":4938464628745807464},{\"name\":\"eualupjmkhf\",\"minStorageSize\":3301190446287542210,\"maxStorageSize\":1475779972366024488,\"minBackupRetentionDays\":4801244624659706170,\"maxBackupRetentionDays\":4282365131498375699,\"minBackupIntervalHours\":6365988456807659162,\"maxBackupIntervalHours\":7508041016656443291},{\"name\":\"wtgh\",\"minStorageSize\":4480218373622074054,\"maxStorageSize\":1248291372184779781,\"minBackupRetentionDays\":5418002986537845043,\"maxBackupRetentionDays\":692631569824073211,\"minBackupIntervalHours\":9032907208555956547,\"maxBackupIntervalHours\":4855611501955594368},{\"name\":\"btn\",\"minStorageSize\":8168827985153452849,\"maxStorageSize\":5406292049482807684,\"minBackupRetentionDays\":9167362709610232735,\"maxBackupRetentionDays\":6525239708045322977,\"minBackupIntervalHours\":7151462329487158065,\"maxBackupIntervalHours\":6136339981043942378}],\"supportedSkus\":[{\"name\":\"gwyzm\",\"vCores\":8423964713618805979,\"supportedIops\":8960971107785160729,\"supportedMemoryPerVCoreMB\":3572252614282926056,\"supportedZones\":[\"cbpwxqpsrknft\",\"uvriuhprwm\",\"yvxqtayriwwroy\",\"bexrmcq\"],\"supportedHAMode\":[\"cnojvknmefqsg\",\"vah\",\"pjyzhpv\",\"qzcjrvxdj\"]},{\"name\":\"mwlxk\",\"vCores\":8451132931226635993,\"supportedIops\":8948733559998471922,\"supportedMemoryPerVCoreMB\":6856642650959955968,\"supportedZones\":[\"zunlu\",\"hnnpr\",\"xipeilpjzuaejx\",\"ultskzbbtdz\"],\"supportedHAMode\":[\"e\",\"kgpwoz\",\"hkfpbs\",\"yofd\"]},{\"name\":\"uusdttouwa\",\"vCores\":8365704524222172400,\"supportedIops\":108645290116886503,\"supportedMemoryPerVCoreMB\":2699583635820054770,\"supportedZones\":[\"vbxwyjsflhh\"],\"supportedHAMode\":[\"lnjixisxya\"]}]},{\"name\":\"oyaqcslyjpkiid\",\"defaultSku\":\"exznelixhnr\",\"defaultStorageSize\":644635434,\"supportedStorageEditions\":[{\"name\":\"bnxknalaulppg\",\"minStorageSize\":8537474704908454871,\"maxStorageSize\":5149418490652934677,\"minBackupRetentionDays\":6445741537137473269,\"maxBackupRetentionDays\":7517503656775424408,\"minBackupIntervalHours\":5108796098292798355,\"maxBackupIntervalHours\":5284833703695885613},{\"name\":\"gylgqgitxmedjvcs\",\"minStorageSize\":315217649899212778,\"maxStorageSize\":6527904541779250049,\"minBackupRetentionDays\":3372205995909078044,\"maxBackupRetentionDays\":2313446192917643442,\"minBackupIntervalHours\":4093757027555713253,\"maxBackupIntervalHours\":6364378757262685424}],\"supportedSkus\":[{\"name\":\"apkteoellwptfdyg\",\"vCores\":4189677250965468268,\"supportedIops\":1621994351674627524,\"supportedMemoryPerVCoreMB\":2230780242905097780,\"supportedZones\":[\"qrhhu\",\"opppcqeq\",\"ol\"],\"supportedHAMode\":[\"hzxct\",\"bgbkdmoizpost\",\"grcfb\"]},{\"name\":\"rmfqjhhkxbpvj\",\"vCores\":7630037301947416018,\"supportedIops\":1509248183766128687,\"supportedMemoryPerVCoreMB\":839547414401646019,\"supportedZones\":[\"ivkrtsw\",\"xqzvszjfa\"],\"supportedHAMode\":[\"fdxxivetvtcqaqtd\"]},{\"name\":\"mcbxvwvxysl\",\"vCores\":2902711033817845170,\"supportedIops\":1129786436342039782,\"supportedMemoryPerVCoreMB\":2977681561409094554,\"supportedZones\":[\"blmpewww\"],\"supportedHAMode\":[\"rvrnsvshqjohxc\",\"sbfov\"]}]}],\"supportedServerVersions\":[{\"name\":\"uvwbhsqfs\"},{\"name\":\"cgjbirxbp\"},{\"name\":\"srfbjfdtwss\"}]},\"id\":\"ftpvjzbexil\",\"name\":\"znfqqnvwpmqtar\",\"type\":\"oujmkcjhwqytj\"}") - .toObject(CapabilityInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CapabilityInner model = new CapabilityInner(); - model = BinaryData.fromObject(model).toObject(CapabilityInner.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CapabilityPropertiesInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CapabilityPropertiesInnerTests.java index 8c9c4acd3e491..23fabe73fe6c6 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CapabilityPropertiesInnerTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CapabilityPropertiesInnerTests.java @@ -11,7 +11,7 @@ public final class CapabilityPropertiesInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CapabilityPropertiesInner model = BinaryData.fromString( - "{\"zone\":\"y\",\"supportedHAMode\":[\"synlqidybyxczfc\"],\"supportedGeoBackupRegions\":[\"axdbabph\",\"wrqlfktsthsuco\",\"mnyyazt\",\"bt\"],\"supportedFlexibleServerEditions\":[{\"name\":\"puedckzywbiexzf\",\"supportedStorageEditions\":[{\"name\":\"axibxujw\",\"minStorageSize\":6825122128576329936,\"maxStorageSize\":5077177029124630587,\"minBackupRetentionDays\":4821082223595321199,\"maxBackupRetentionDays\":6581700194330598875,\"minBackupIntervalHours\":3002964049994364759,\"maxBackupIntervalHours\":8317150744706816550}],\"supportedServerVersions\":[{\"name\":\"ux\",\"supportedSkus\":[{}]},{\"name\":\"bavxbniwdjswzt\",\"supportedSkus\":[{}]},{\"name\":\"gnxytxhpzxbz\",\"supportedSkus\":[{},{},{}]}]}]}") + "{\"zone\":\"ftutqxlngxlefgu\",\"supportedHAMode\":[\"krxd\",\"mi\"],\"supportedGeoBackupRegions\":[\"hzrvqd\"],\"supportedFlexibleServerEditions\":[{\"name\":\"jybige\",\"supportedStorageEditions\":[{\"name\":\"bowsk\",\"minStorageSize\":4187351799054769848,\"maxStorageSize\":8321881464692032483,\"minBackupRetentionDays\":450756782993701005,\"maxBackupRetentionDays\":5423629655028728584},{\"name\":\"ywgndrv\",\"minStorageSize\":9186245080720246611,\"maxStorageSize\":1284533525863803675,\"minBackupRetentionDays\":4712637840273391271,\"maxBackupRetentionDays\":7340674686507262093}],\"supportedServerVersions\":[{\"name\":\"pec\",\"supportedSkus\":[{}]},{\"name\":\"coofsxlzev\",\"supportedSkus\":[{}]},{\"name\":\"jqabcypmivkwlzuv\",\"supportedSkus\":[{},{}]}]}]}") .toObject(CapabilityPropertiesInner.class); } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CapabilityPropertiesV2Tests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CapabilityPropertiesV2Tests.java deleted file mode 100644 index ae0e0f949d9f3..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CapabilityPropertiesV2Tests.java +++ /dev/null @@ -1,23 +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.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.CapabilityPropertiesV2; - -public final class CapabilityPropertiesV2Tests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CapabilityPropertiesV2 model = BinaryData.fromString( - "{\"supportedGeoBackupRegions\":[\"n\"],\"supportedFlexibleServerEditions\":[{\"name\":\"gdrjervnaenqpe\",\"defaultSku\":\"ndoygmifthnzdnd\",\"defaultStorageSize\":962281735,\"supportedStorageEditions\":[{\"name\":\"qig\",\"minStorageSize\":1427620858530935166,\"maxStorageSize\":8642059696861181136,\"minBackupRetentionDays\":5173080348817508321,\"maxBackupRetentionDays\":5682368071850928759,\"minBackupIntervalHours\":4798554753544552849,\"maxBackupIntervalHours\":8390013026245928421},{\"name\":\"gycdu\",\"minStorageSize\":766659448073134411,\"maxStorageSize\":5983692847651607240,\"minBackupRetentionDays\":7165810433952097400,\"maxBackupRetentionDays\":218788129440257069,\"minBackupIntervalHours\":2513887765446717369,\"maxBackupIntervalHours\":1053709421770726696},{\"name\":\"mmdnbbglzps\",\"minStorageSize\":5564635396435851396,\"maxStorageSize\":1234182854379113397,\"minBackupRetentionDays\":2986988161676305406,\"maxBackupRetentionDays\":3868778507667885775,\"minBackupIntervalHours\":5645412032437353957,\"maxBackupIntervalHours\":5470431238820396350}],\"supportedSkus\":[{\"name\":\"fznudaodvxzb\",\"vCores\":1564863042825261686,\"supportedIops\":6314298447266577178,\"supportedMemoryPerVCoreMB\":4154359310176459322,\"supportedZones\":[\"hxsrzdzucersc\"],\"supportedHAMode\":[\"nevf\"]},{\"name\":\"jmygtdsslswtmwer\",\"vCores\":2319180534572952806,\"supportedIops\":7993353797121101484,\"supportedMemoryPerVCoreMB\":8502248453767637112,\"supportedZones\":[\"bnetshh\",\"zhedplvwiw\"],\"supportedHAMode\":[\"wmbesldnkw\",\"tppjflcx\"]},{\"name\":\"aokonzmnsik\",\"vCores\":4352288907832795001,\"supportedIops\":2625319933705965301,\"supportedMemoryPerVCoreMB\":4891735483783264620,\"supportedZones\":[\"fzxmhhvhgureodkw\"],\"supportedHAMode\":[\"agxti\",\"qdxbxwa\",\"bogqxndlkzgxhu\"]},{\"name\":\"plbpodxun\",\"vCores\":1740102742322747396,\"supportedIops\":7282370910524293112,\"supportedMemoryPerVCoreMB\":5789185793221344217,\"supportedZones\":[\"wlrbqtkoievseo\",\"gqrlltmuwla\"],\"supportedHAMode\":[\"izxbmpgcjef\",\"zmuvpbttdumorppx\",\"bmnzbtbhjpgl\"]}]},{\"name\":\"gohdneuelfphsd\",\"defaultSku\":\"t\",\"defaultStorageSize\":223656030,\"supportedStorageEditions\":[{\"name\":\"owwquuvxz\",\"minStorageSize\":6214959618688242083,\"maxStorageSize\":5272627491576584483,\"minBackupRetentionDays\":6465268745370114488,\"maxBackupRetentionDays\":2144640656240762223,\"minBackupIntervalHours\":2524808261528080597,\"maxBackupIntervalHours\":3202643871738398151}],\"supportedSkus\":[{\"name\":\"wdsjnkalju\",\"vCores\":4944685452793755609,\"supportedIops\":8223750660917060648,\"supportedMemoryPerVCoreMB\":8486438671495128315,\"supportedZones\":[\"zzewkfvhqcrai\"],\"supportedHAMode\":[\"n\",\"pfuflrw\"]},{\"name\":\"hdlxyjrxsagafcn\",\"vCores\":3356824061163345093,\"supportedIops\":3473341415341754337,\"supportedMemoryPerVCoreMB\":2722432459544366405,\"supportedZones\":[\"bcvkcvqvpkeq\"],\"supportedHAMode\":[\"drhvoodsotbo\",\"zdopcjwvnhd\"]},{\"name\":\"wmgxcxrsl\",\"vCores\":4609069884543966713,\"supportedIops\":7040134278923407185,\"supportedMemoryPerVCoreMB\":4150565343365520377,\"supportedZones\":[\"hjwniyqsluic\",\"dggkzzlvmbmpa\"],\"supportedHAMode\":[\"dfvue\",\"yw\",\"bpfvm\"]},{\"name\":\"hrfou\",\"vCores\":4811650617060953950,\"supportedIops\":5921863254735243053,\"supportedMemoryPerVCoreMB\":7140764207385351369,\"supportedZones\":[\"vqtmnub\",\"xkp\",\"ksmond\"],\"supportedHAMode\":[\"uxvypomgkopkwh\",\"jvp\",\"jqg\"]}]},{\"name\":\"smocmbq\",\"defaultSku\":\"vmkcx\",\"defaultStorageSize\":1061947770,\"supportedStorageEditions\":[{\"name\":\"elxprglyatddck\",\"minStorageSize\":1605920653761823709,\"maxStorageSize\":7850386713816708447,\"minBackupRetentionDays\":3070743576677662051,\"maxBackupRetentionDays\":2629967509256369573,\"minBackupIntervalHours\":3405568102133288247,\"maxBackupIntervalHours\":3019773513658765057},{\"name\":\"sdqrhzoymibmrq\",\"minStorageSize\":5977240495404401854,\"maxStorageSize\":8539790193753290872,\"minBackupRetentionDays\":3859662575119335920,\"maxBackupRetentionDays\":7176903777537856658,\"minBackupIntervalHours\":5665928384383195367,\"maxBackupIntervalHours\":7740523087334543020},{\"name\":\"yyv\",\"minStorageSize\":5748246004762300961,\"maxStorageSize\":3645438525729002905,\"minBackupRetentionDays\":3596857482537932759,\"maxBackupRetentionDays\":1477566052149971065,\"minBackupIntervalHours\":2878415356343371962,\"maxBackupIntervalHours\":6217672492639104016},{\"name\":\"ashrt\",\"minStorageSize\":1151592632214539496,\"maxStorageSize\":3530483379804377024,\"minBackupRetentionDays\":8989578588874797078,\"maxBackupRetentionDays\":3970058282735667200,\"minBackupIntervalHours\":2291924082393091786,\"maxBackupIntervalHours\":4256703090352932350}],\"supportedSkus\":[{\"name\":\"ipqiiobyuqerpq\",\"vCores\":9153525245739477269,\"supportedIops\":8381194936769139880,\"supportedMemoryPerVCoreMB\":8353822306247184184,\"supportedZones\":[\"butauvfb\",\"kuwhh\",\"hykojoxafnndlpic\",\"koymkcd\"],\"supportedHAMode\":[\"pkkpw\",\"reqnovvqfov\",\"jxywsuws\"]},{\"name\":\"s\",\"vCores\":4579993960866529408,\"supportedIops\":164789879294916168,\"supportedMemoryPerVCoreMB\":8488213744236915877,\"supportedZones\":[\"ea\",\"neqn\",\"arrwlquu\",\"jfqka\"],\"supportedHAMode\":[\"iipfpubj\",\"bwwift\"]}]}],\"supportedServerVersions\":[{\"name\":\"vpuvks\"},{\"name\":\"lsa\"},{\"name\":\"ynfs\"},{\"name\":\"ljphuopxodl\"}]}") - .toObject(CapabilityPropertiesV2.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CapabilityPropertiesV2 model = new CapabilityPropertiesV2(); - model = BinaryData.fromObject(model).toObject(CapabilityPropertiesV2.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CapabilitySetsListTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CapabilitySetsListTests.java deleted file mode 100644 index 691f328769e21..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CapabilitySetsListTests.java +++ /dev/null @@ -1,23 +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.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.CapabilitySetsList; - -public final class CapabilitySetsListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CapabilitySetsList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"supportedGeoBackupRegions\":[\"b\",\"e\"],\"supportedFlexibleServerEditions\":[{\"name\":\"k\",\"defaultSku\":\"ali\",\"defaultStorageSize\":12612409,\"supportedStorageEditions\":[{},{},{}],\"supportedSkus\":[{},{},{}]}],\"supportedServerVersions\":[{\"name\":\"ashsfwxos\"},{\"name\":\"z\"},{\"name\":\"ugicjooxdjebw\"}]},\"id\":\"cwwfvovbvme\",\"name\":\"ecivyh\",\"type\":\"ce\"}],\"nextLink\":\"jgjrwjueiotwm\"}") - .toObject(CapabilitySetsList.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CapabilitySetsList model = new CapabilitySetsList(); - model = BinaryData.fromObject(model).toObject(CapabilitySetsList.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CheckNameAvailabilitiesExecuteWithResponseMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CheckNameAvailabilitiesExecuteWithResponseMockTests.java index a1ee5bb40ff9e..89d5527c1a454 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CheckNameAvailabilitiesExecuteWithResponseMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CheckNameAvailabilitiesExecuteWithResponseMockTests.java @@ -21,7 +21,7 @@ public final class CheckNameAvailabilitiesExecuteWithResponseMockTests { @Test public void testExecuteWithResponse() throws Exception { - String responseStr = "{\"message\":\"vftjuhd\",\"nameAvailable\":true,\"reason\":\"mtggu\"}"; + String responseStr = "{\"message\":\"mocmbqfqvmk\",\"nameAvailable\":false,\"reason\":\"apvhelxprgly\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -31,12 +31,12 @@ public void testExecuteWithResponse() throws Exception { new AzureProfile("", "", AzureEnvironment.AZURE)); NameAvailability response = manager.checkNameAvailabilities() - .executeWithResponse("mbcxfhbcp", new NameAvailabilityRequest().withName("rxvxcjzh").withType("zxfpxtgqsc"), + .executeWithResponse("mond", new NameAvailabilityRequest().withName("mquxvypo").withType("kopkwhojvpajqgx"), com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("vftjuhd", response.message()); - Assertions.assertEquals(true, response.nameAvailable()); - Assertions.assertEquals("mtggu", response.reason()); + Assertions.assertEquals("mocmbqfqvmk", response.message()); + Assertions.assertEquals(false, response.nameAvailable()); + Assertions.assertEquals("apvhelxprgly", response.reason()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CheckNameAvailabilityWithoutLocationsExecuteWithResponseMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CheckNameAvailabilityWithoutLocationsExecuteWithResponseMockTests.java index c4cecf658b29a..8a90eb62c7a45 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CheckNameAvailabilityWithoutLocationsExecuteWithResponseMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CheckNameAvailabilityWithoutLocationsExecuteWithResponseMockTests.java @@ -21,7 +21,7 @@ public final class CheckNameAvailabilityWithoutLocationsExecuteWithResponseMockTests { @Test public void testExecuteWithResponse() throws Exception { - String responseStr = "{\"message\":\"vyi\",\"nameAvailable\":false,\"reason\":\"dfvpg\"}"; + String responseStr = "{\"message\":\"sdqrhzoymibmrq\",\"nameAvailable\":false,\"reason\":\"hwflu\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -31,12 +31,12 @@ public void testExecuteWithResponse() throws Exception { new AzureProfile("", "", AzureEnvironment.AZURE)); NameAvailability response = manager.checkNameAvailabilityWithoutLocations() - .executeWithResponse(new NameAvailabilityRequest().withName("pijrajcivmmghf").withType("iwrxgkn"), + .executeWithResponse(new NameAvailabilityRequest().withName("tddckcb").withType("ejrjxgciqibrho"), com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("vyi", response.message()); + Assertions.assertEquals("sdqrhzoymibmrq", response.message()); Assertions.assertEquals(false, response.nameAvailable()); - Assertions.assertEquals("dfvpg", response.reason()); + Assertions.assertEquals("hwflu", response.reason()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CheckVirtualNetworkSubnetUsagesExecuteWithResponseMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CheckVirtualNetworkSubnetUsagesExecuteWithResponseMockTests.java index ca2fa3dadf555..38a04e28c3a59 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CheckVirtualNetworkSubnetUsagesExecuteWithResponseMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/CheckVirtualNetworkSubnetUsagesExecuteWithResponseMockTests.java @@ -21,7 +21,7 @@ public final class CheckVirtualNetworkSubnetUsagesExecuteWithResponseMockTests { @Test public void testExecuteWithResponse() throws Exception { String responseStr - = "{\"location\":\"hlf\",\"subscriptionId\":\"wpchwahf\",\"delegatedSubnetsUsage\":[{\"subnetName\":\"nfepgf\",\"usage\":1851396648069747872},{\"subnetName\":\"l\",\"usage\":1627173261577825656},{\"subnetName\":\"xykxhdj\",\"usage\":6091189064792747688}]}"; + = "{\"location\":\"gk\",\"subscriptionId\":\"lvmbmpaxmodfvuef\",\"delegatedSubnetsUsage\":[{\"subnetName\":\"pfvmwyhrfou\",\"usage\":4811650617060953950},{\"subnetName\":\"kcpwiy\",\"usage\":3618670144532110213},{\"subnetName\":\"nubexk\",\"usage\":6799001413428276597}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -31,8 +31,8 @@ public void testExecuteWithResponse() throws Exception { new AzureProfile("", "", AzureEnvironment.AZURE)); VirtualNetworkSubnetUsageResult response = manager.checkVirtualNetworkSubnetUsages() - .executeWithResponse("eazulcs", - new VirtualNetworkSubnetUsageParameter().withVirtualNetworkResourceId("hwwn"), + .executeWithResponse("khjwn", + new VirtualNetworkSubnetUsageParameter().withVirtualNetworkResourceId("qsluicp"), com.azure.core.util.Context.NONE) .getValue(); diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationForBatchUpdatePropertiesTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationForBatchUpdatePropertiesTests.java index d75fac0d10425..f20e37171ed82 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationForBatchUpdatePropertiesTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationForBatchUpdatePropertiesTests.java @@ -12,18 +12,18 @@ public final class ConfigurationForBatchUpdatePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ConfigurationForBatchUpdateProperties model - = BinaryData.fromString("{\"value\":\"erkujys\",\"source\":\"eju\"}") + = BinaryData.fromString("{\"value\":\"u\",\"source\":\"krlkhbzhfepg\"}") .toObject(ConfigurationForBatchUpdateProperties.class); - Assertions.assertEquals("erkujys", model.value()); - Assertions.assertEquals("eju", model.source()); + Assertions.assertEquals("u", model.value()); + Assertions.assertEquals("krlkhbzhfepg", model.source()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ConfigurationForBatchUpdateProperties model - = new ConfigurationForBatchUpdateProperties().withValue("erkujys").withSource("eju"); + = new ConfigurationForBatchUpdateProperties().withValue("u").withSource("krlkhbzhfepg"); model = BinaryData.fromObject(model).toObject(ConfigurationForBatchUpdateProperties.class); - Assertions.assertEquals("erkujys", model.value()); - Assertions.assertEquals("eju", model.source()); + Assertions.assertEquals("u", model.value()); + Assertions.assertEquals("krlkhbzhfepg", model.source()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationForBatchUpdateTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationForBatchUpdateTests.java index 33ab147775113..dd5a85dbf85f6 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationForBatchUpdateTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationForBatchUpdateTests.java @@ -11,22 +11,23 @@ public final class ConfigurationForBatchUpdateTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ConfigurationForBatchUpdate model = BinaryData.fromString( - "{\"name\":\"bmbexppbhtqqro\",\"properties\":{\"value\":\"fpsalgbqu\",\"source\":\"gjyjgzjaoyfhrtxi\"}}") + ConfigurationForBatchUpdate model = BinaryData + .fromString( + "{\"name\":\"hurzafblj\",\"properties\":{\"value\":\"btoqcjmkljavbqid\",\"source\":\"ajzyul\"}}") .toObject(ConfigurationForBatchUpdate.class); - Assertions.assertEquals("bmbexppbhtqqro", model.name()); - Assertions.assertEquals("fpsalgbqu", model.value()); - Assertions.assertEquals("gjyjgzjaoyfhrtxi", model.source()); + Assertions.assertEquals("hurzafblj", model.name()); + Assertions.assertEquals("btoqcjmkljavbqid", model.value()); + Assertions.assertEquals("ajzyul", model.source()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ConfigurationForBatchUpdate model = new ConfigurationForBatchUpdate().withName("bmbexppbhtqqro") - .withValue("fpsalgbqu") - .withSource("gjyjgzjaoyfhrtxi"); + ConfigurationForBatchUpdate model = new ConfigurationForBatchUpdate().withName("hurzafblj") + .withValue("btoqcjmkljavbqid") + .withSource("ajzyul"); model = BinaryData.fromObject(model).toObject(ConfigurationForBatchUpdate.class); - Assertions.assertEquals("bmbexppbhtqqro", model.name()); - Assertions.assertEquals("fpsalgbqu", model.value()); - Assertions.assertEquals("gjyjgzjaoyfhrtxi", model.source()); + Assertions.assertEquals("hurzafblj", model.name()); + Assertions.assertEquals("btoqcjmkljavbqid", model.value()); + Assertions.assertEquals("ajzyul", model.source()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationInnerTests.java index 5d97b6dcf483b..07fd51c8d22e5 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationInnerTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationInnerTests.java @@ -13,21 +13,18 @@ public final class ConfigurationInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ConfigurationInner model = BinaryData.fromString( - "{\"properties\":{\"value\":\"xxwr\",\"currentValue\":\"douskcqvkocrcjdk\",\"description\":\"nh\",\"documentationLink\":\"njbiksqrglssain\",\"defaultValue\":\"jwnzlljfmp\",\"dataType\":\"ebvmgxsabkyqd\",\"allowedValues\":\"jitcjczdzevn\",\"source\":\"system-default\",\"isReadOnly\":\"False\",\"isConfigPendingRestart\":\"True\",\"isDynamicConfig\":\"False\"},\"id\":\"dsbdkvwrwjf\",\"name\":\"usnhutje\",\"type\":\"tmrldhugjzzdatq\"}") + "{\"properties\":{\"value\":\"ujysvle\",\"description\":\"vfqawrlyxwjkcpr\",\"defaultValue\":\"wbxgjvt\",\"dataType\":\"p\",\"allowedValues\":\"szdnr\",\"source\":\"system-default\",\"isReadOnly\":\"False\",\"isConfigPendingRestart\":\"True\",\"isDynamicConfig\":\"True\"},\"id\":\"qfprwzwbn\",\"name\":\"uitnwuiz\",\"type\":\"a\"}") .toObject(ConfigurationInner.class); - Assertions.assertEquals("xxwr", model.value()); - Assertions.assertEquals("douskcqvkocrcjdk", model.currentValue()); + Assertions.assertEquals("ujysvle", model.value()); Assertions.assertEquals(ConfigurationSource.SYSTEM_DEFAULT, model.source()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ConfigurationInner model = new ConfigurationInner().withValue("xxwr") - .withCurrentValue("douskcqvkocrcjdk") - .withSource(ConfigurationSource.SYSTEM_DEFAULT); + ConfigurationInner model + = new ConfigurationInner().withValue("ujysvle").withSource(ConfigurationSource.SYSTEM_DEFAULT); model = BinaryData.fromObject(model).toObject(ConfigurationInner.class); - Assertions.assertEquals("xxwr", model.value()); - Assertions.assertEquals("douskcqvkocrcjdk", model.currentValue()); + Assertions.assertEquals("ujysvle", model.value()); Assertions.assertEquals(ConfigurationSource.SYSTEM_DEFAULT, model.source()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationListForBatchUpdateTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationListForBatchUpdateTests.java index c1a10ee01c6c7..b9b419db46234 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationListForBatchUpdateTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationListForBatchUpdateTests.java @@ -7,7 +7,6 @@ import com.azure.core.util.BinaryData; import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationForBatchUpdate; import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationListForBatchUpdate; -import com.azure.resourcemanager.mysqlflexibleserver.models.ResetAllToDefault; import java.util.Arrays; import org.junit.jupiter.api.Assertions; @@ -15,26 +14,23 @@ public final class ConfigurationListForBatchUpdateTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ConfigurationListForBatchUpdate model = BinaryData.fromString( - "{\"value\":[{\"name\":\"ejk\",\"properties\":{\"value\":\"nqgoulzndli\",\"source\":\"yqkgfg\"}},{\"name\":\"madgakeqsrxyb\",\"properties\":{\"value\":\"e\",\"source\":\"ytb\"}},{\"name\":\"qfou\",\"properties\":{\"value\":\"mnkzsmod\",\"source\":\"lougpbkw\"}},{\"name\":\"utduqktapspwgcu\",\"properties\":{\"value\":\"umkdosvqwhbmd\",\"source\":\"bjf\"}}],\"resetAllToDefault\":\"False\"}") + "{\"value\":[{\"name\":\"dnsezcxtbzs\",\"properties\":{\"value\":\"c\",\"source\":\"newmdwzjeiachbo\"}},{\"name\":\"flnrosfqpteehzz\",\"properties\":{\"value\":\"yqrimzin\",\"source\":\"swjdkirso\"}},{\"name\":\"qxhcrmn\",\"properties\":{\"value\":\"t\",\"source\":\"whdsoifiyip\"}},{\"name\":\"sqwpgrjb\",\"properties\":{\"value\":\"rcjxvsnbyxqabn\",\"source\":\"cpc\"}}]}") .toObject(ConfigurationListForBatchUpdate.class); - Assertions.assertEquals("ejk", model.value().get(0).name()); - Assertions.assertEquals("nqgoulzndli", model.value().get(0).value()); - Assertions.assertEquals("yqkgfg", model.value().get(0).source()); - Assertions.assertEquals(ResetAllToDefault.FALSE, model.resetAllToDefault()); + Assertions.assertEquals("dnsezcxtbzs", model.value().get(0).name()); + Assertions.assertEquals("c", model.value().get(0).value()); + Assertions.assertEquals("newmdwzjeiachbo", model.value().get(0).source()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ConfigurationListForBatchUpdate model = new ConfigurationListForBatchUpdate().withValue(Arrays.asList( - new ConfigurationForBatchUpdate().withName("ejk").withValue("nqgoulzndli").withSource("yqkgfg"), - new ConfigurationForBatchUpdate().withName("madgakeqsrxyb").withValue("e").withSource("ytb"), - new ConfigurationForBatchUpdate().withName("qfou").withValue("mnkzsmod").withSource("lougpbkw"), - new ConfigurationForBatchUpdate().withName("utduqktapspwgcu").withValue("umkdosvqwhbmd").withSource("bjf"))) - .withResetAllToDefault(ResetAllToDefault.FALSE); + new ConfigurationForBatchUpdate().withName("dnsezcxtbzs").withValue("c").withSource("newmdwzjeiachbo"), + new ConfigurationForBatchUpdate().withName("flnrosfqpteehzz").withValue("yqrimzin").withSource("swjdkirso"), + new ConfigurationForBatchUpdate().withName("qxhcrmn").withValue("t").withSource("whdsoifiyip"), + new ConfigurationForBatchUpdate().withName("sqwpgrjb").withValue("rcjxvsnbyxqabn").withSource("cpc"))); model = BinaryData.fromObject(model).toObject(ConfigurationListForBatchUpdate.class); - Assertions.assertEquals("ejk", model.value().get(0).name()); - Assertions.assertEquals("nqgoulzndli", model.value().get(0).value()); - Assertions.assertEquals("yqkgfg", model.value().get(0).source()); - Assertions.assertEquals(ResetAllToDefault.FALSE, model.resetAllToDefault()); + Assertions.assertEquals("dnsezcxtbzs", model.value().get(0).name()); + Assertions.assertEquals("c", model.value().get(0).value()); + Assertions.assertEquals("newmdwzjeiachbo", model.value().get(0).source()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationListResultInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationListResultInnerTests.java index 8dad3b6a28265..24ae23ac97f95 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationListResultInnerTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationListResultInnerTests.java @@ -15,31 +15,22 @@ public final class ConfigurationListResultInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ConfigurationListResultInner model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"value\":\"rlyxwjkcprbnw\",\"currentValue\":\"gjvtbv\",\"description\":\"sszdnru\",\"documentationLink\":\"guhmuouqfpr\",\"defaultValue\":\"wbnguitnwui\",\"dataType\":\"a\",\"allowedValues\":\"ufizuckyf\",\"source\":\"user-override\",\"isReadOnly\":\"True\",\"isConfigPendingRestart\":\"False\",\"isDynamicConfig\":\"True\"},\"id\":\"dzuhtymwi\",\"name\":\"dkfthwxmnt\",\"type\":\"i\"},{\"properties\":{\"value\":\"pvkmijcmmxdcuf\",\"currentValue\":\"srp\",\"description\":\"zidnsezcxtbzsgfy\",\"documentationLink\":\"sne\",\"defaultValue\":\"dwzjeiach\",\"dataType\":\"osfln\",\"allowedValues\":\"sfqpteehz\",\"source\":\"user-override\",\"isReadOnly\":\"True\",\"isConfigPendingRestart\":\"True\",\"isDynamicConfig\":\"False\"},\"id\":\"inpvswjdkirsoodq\",\"name\":\"hc\",\"type\":\"mnoh\"},{\"properties\":{\"value\":\"kwh\",\"currentValue\":\"oifiyipjxsqwpgr\",\"description\":\"znorcj\",\"documentationLink\":\"snb\",\"defaultValue\":\"qabnmoc\",\"dataType\":\"ysh\",\"allowedValues\":\"zafb\",\"source\":\"system-default\",\"isReadOnly\":\"False\",\"isConfigPendingRestart\":\"False\",\"isDynamicConfig\":\"True\"},\"id\":\"jmkljavbqidtqajz\",\"name\":\"ulpkudjkrl\",\"type\":\"hbzhfepg\"}],\"nextLink\":\"qex\"}") + "{\"value\":[{\"properties\":{\"value\":\"zloc\",\"description\":\"c\",\"defaultValue\":\"ierhhbcsglummaj\",\"dataType\":\"aodxo\",\"allowedValues\":\"bdxkqpxokaj\",\"source\":\"system-default\",\"isReadOnly\":\"False\",\"isConfigPendingRestart\":\"True\",\"isDynamicConfig\":\"True\"},\"id\":\"txgcpodgmaajr\",\"name\":\"vdjwzrlovm\",\"type\":\"lwhijcoejctbzaq\"}],\"nextLink\":\"sycbkbfk\"}") .toObject(ConfigurationListResultInner.class); - Assertions.assertEquals("rlyxwjkcprbnw", model.value().get(0).value()); - Assertions.assertEquals("gjvtbv", model.value().get(0).currentValue()); - Assertions.assertEquals(ConfigurationSource.USER_OVERRIDE, model.value().get(0).source()); - Assertions.assertEquals("qex", model.nextLink()); + Assertions.assertEquals("zloc", model.value().get(0).value()); + Assertions.assertEquals(ConfigurationSource.SYSTEM_DEFAULT, model.value().get(0).source()); + Assertions.assertEquals("sycbkbfk", model.nextLink()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ConfigurationListResultInner model = new ConfigurationListResultInner().withValue(Arrays.asList( - new ConfigurationInner().withValue("rlyxwjkcprbnw") - .withCurrentValue("gjvtbv") - .withSource(ConfigurationSource.USER_OVERRIDE), - new ConfigurationInner().withValue("pvkmijcmmxdcuf") - .withCurrentValue("srp") - .withSource(ConfigurationSource.USER_OVERRIDE), - new ConfigurationInner().withValue("kwh") - .withCurrentValue("oifiyipjxsqwpgr") - .withSource(ConfigurationSource.SYSTEM_DEFAULT))) - .withNextLink("qex"); + ConfigurationListResultInner model = new ConfigurationListResultInner() + .withValue(Arrays + .asList(new ConfigurationInner().withValue("zloc").withSource(ConfigurationSource.SYSTEM_DEFAULT))) + .withNextLink("sycbkbfk"); model = BinaryData.fromObject(model).toObject(ConfigurationListResultInner.class); - Assertions.assertEquals("rlyxwjkcprbnw", model.value().get(0).value()); - Assertions.assertEquals("gjvtbv", model.value().get(0).currentValue()); - Assertions.assertEquals(ConfigurationSource.USER_OVERRIDE, model.value().get(0).source()); - Assertions.assertEquals("qex", model.nextLink()); + Assertions.assertEquals("zloc", model.value().get(0).value()); + Assertions.assertEquals(ConfigurationSource.SYSTEM_DEFAULT, model.value().get(0).source()); + Assertions.assertEquals("sycbkbfk", model.nextLink()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationPropertiesTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationPropertiesTests.java index 13fec3e19a6dd..7b32f30543ec5 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationPropertiesTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationPropertiesTests.java @@ -13,21 +13,18 @@ public final class ConfigurationPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ConfigurationProperties model = BinaryData.fromString( - "{\"value\":\"oc\",\"currentValue\":\"eablg\",\"description\":\"uticndvkaozwyif\",\"documentationLink\":\"hxh\",\"defaultValue\":\"okftyxolniwpwcuk\",\"dataType\":\"kgiawxklryplwck\",\"allowedValues\":\"syyp\",\"source\":\"system-default\",\"isReadOnly\":\"True\",\"isConfigPendingRestart\":\"False\",\"isDynamicConfig\":\"False\"}") + "{\"value\":\"ufizuckyf\",\"description\":\"rfidfvzwdz\",\"defaultValue\":\"tymw\",\"dataType\":\"dkfthwxmnt\",\"allowedValues\":\"waopvkmijcmmxd\",\"source\":\"user-override\",\"isReadOnly\":\"False\",\"isConfigPendingRestart\":\"False\",\"isDynamicConfig\":\"True\"}") .toObject(ConfigurationProperties.class); - Assertions.assertEquals("oc", model.value()); - Assertions.assertEquals("eablg", model.currentValue()); - Assertions.assertEquals(ConfigurationSource.SYSTEM_DEFAULT, model.source()); + Assertions.assertEquals("ufizuckyf", model.value()); + Assertions.assertEquals(ConfigurationSource.USER_OVERRIDE, model.source()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ConfigurationProperties model = new ConfigurationProperties().withValue("oc") - .withCurrentValue("eablg") - .withSource(ConfigurationSource.SYSTEM_DEFAULT); + ConfigurationProperties model + = new ConfigurationProperties().withValue("ufizuckyf").withSource(ConfigurationSource.USER_OVERRIDE); model = BinaryData.fromObject(model).toObject(ConfigurationProperties.class); - Assertions.assertEquals("oc", model.value()); - Assertions.assertEquals("eablg", model.currentValue()); - Assertions.assertEquals(ConfigurationSource.SYSTEM_DEFAULT, model.source()); + Assertions.assertEquals("ufizuckyf", model.value()); + Assertions.assertEquals(ConfigurationSource.USER_OVERRIDE, model.source()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsBatchUpdateMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsBatchUpdateMockTests.java index a98906de7eda5..01de786460d74 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsBatchUpdateMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsBatchUpdateMockTests.java @@ -14,7 +14,6 @@ import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationListForBatchUpdate; import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationListResult; import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationSource; -import com.azure.resourcemanager.mysqlflexibleserver.models.ResetAllToDefault; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import java.util.Arrays; @@ -26,7 +25,7 @@ public final class ConfigurationsBatchUpdateMockTests { @Test public void testBatchUpdate() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"value\":\"jbdhqxvc\",\"currentValue\":\"frpdsofbshrns\",\"description\":\"uswdv\",\"documentationLink\":\"ybycnunvj\",\"defaultValue\":\"tkfa\",\"dataType\":\"opqgikyzirtxdyux\",\"allowedValues\":\"jntpsewgioilqu\",\"source\":\"system-default\",\"isReadOnly\":\"False\",\"isConfigPendingRestart\":\"True\",\"isDynamicConfig\":\"False\"},\"id\":\"ox\",\"name\":\"rgguf\",\"type\":\"yaomtb\"}],\"nextLink\":\"havgrvk\"}"; + = "{\"value\":[{\"properties\":{\"value\":\"xyawj\",\"description\":\"aq\",\"defaultValue\":\"lyjpk\",\"dataType\":\"dzyexznelixh\",\"allowedValues\":\"ztfolhbnxk\",\"source\":\"system-default\",\"isReadOnly\":\"False\",\"isConfigPendingRestart\":\"True\",\"isDynamicConfig\":\"False\"},\"id\":\"dtpnapnyiropuhp\",\"name\":\"gvpgy\",\"type\":\"gqgitxmedjvcsl\"},{\"properties\":{\"value\":\"wwncwzzhxgk\",\"description\":\"mgucna\",\"defaultValue\":\"t\",\"dataType\":\"ellwptfdy\",\"allowedValues\":\"fqbuaceopzf\",\"source\":\"system-default\",\"isReadOnly\":\"False\",\"isConfigPendingRestart\":\"True\",\"isDynamicConfig\":\"False\"},\"id\":\"cq\",\"name\":\"qxolzdahzx\",\"type\":\"t\"},{\"properties\":{\"value\":\"bkdmo\",\"description\":\"postmgrcfbunrm\",\"defaultValue\":\"jhhkxbp\",\"dataType\":\"ymjhxxjyngudivkr\",\"allowedValues\":\"wbxqzvszjfau\",\"source\":\"user-override\",\"isReadOnly\":\"True\",\"isConfigPendingRestart\":\"True\",\"isDynamicConfig\":\"True\"},\"id\":\"vtcqaqtdo\",\"name\":\"mcbxvwvxysl\",\"type\":\"bhsfxob\"},{\"properties\":{\"value\":\"k\",\"description\":\"mpew\",\"defaultValue\":\"fbkrvrnsvs\",\"dataType\":\"johxcrsb\",\"allowedValues\":\"vasrruvwb\",\"source\":\"user-override\",\"isReadOnly\":\"True\",\"isConfigPendingRestart\":\"False\",\"isDynamicConfig\":\"True\"},\"id\":\"birx\",\"name\":\"pybsrfbjfdtw\",\"type\":\"sotftpvj\"}],\"nextLink\":\"exilzznfqqnvwpmq\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -36,18 +35,15 @@ public void testBatchUpdate() throws Exception { new AzureProfile("", "", AzureEnvironment.AZURE)); ConfigurationListResult response = manager.configurations() - .batchUpdate("fdlwg", "ytsbwtovv", new ConfigurationListForBatchUpdate() - .withValue(Arrays.asList( - new ConfigurationForBatchUpdate().withName("inqfiufxqknpirgn") - .withValue("twqmsniffcdmqnr") - .withSource("lpijnkrxfrd"), - new ConfigurationForBatchUpdate().withName("c").withValue("izzronasxiftozqy").withSource("f"), - new ConfigurationForBatchUpdate().withName("esgogc").withValue("nnxk").withSource("gnyhmossxkkg"))) - .withResetAllToDefault(ResetAllToDefault.FALSE), com.azure.core.util.Context.NONE); + .batchUpdate("wozuhkf", "bsjyofdx", + new ConfigurationListForBatchUpdate() + .withValue(Arrays.asList(new ConfigurationForBatchUpdate().withName("dttouwaboekqvkel") + .withValue("vbxwyjsflhh") + .withSource("aln"))), + com.azure.core.util.Context.NONE); - Assertions.assertEquals("jbdhqxvc", response.value().get(0).value()); - Assertions.assertEquals("frpdsofbshrns", response.value().get(0).currentValue()); + Assertions.assertEquals("xyawj", response.value().get(0).value()); Assertions.assertEquals(ConfigurationSource.SYSTEM_DEFAULT, response.value().get(0).source()); - Assertions.assertEquals("havgrvk", response.nextLink()); + Assertions.assertEquals("exilzznfqqnvwpmq", response.nextLink()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsGetWithResponseMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsGetWithResponseMockTests.java index bd9617363214f..7853ffad70a1e 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsGetWithResponseMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsGetWithResponseMockTests.java @@ -22,7 +22,7 @@ public final class ConfigurationsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"value\":\"stotxh\",\"currentValue\":\"ujbypelmcuvhixb\",\"description\":\"yfwnylr\",\"documentationLink\":\"o\",\"defaultValue\":\"ttpkiwkkbnujrywv\",\"dataType\":\"lbfpncurd\",\"allowedValues\":\"wiithtywub\",\"source\":\"user-override\",\"isReadOnly\":\"True\",\"isConfigPendingRestart\":\"True\",\"isDynamicConfig\":\"True\"},\"id\":\"dntwjchrdgo\",\"name\":\"hxumwctondzj\",\"type\":\"uu\"}"; + = "{\"properties\":{\"value\":\"gzva\",\"description\":\"pjyzhpv\",\"defaultValue\":\"zcjrvxdjzlmwlx\",\"dataType\":\"ug\",\"allowedValues\":\"zovawjvz\",\"source\":\"system-default\",\"isReadOnly\":\"True\",\"isConfigPendingRestart\":\"True\",\"isDynamicConfig\":\"False\"},\"id\":\"nxipeil\",\"name\":\"jzuaejxdultskzbb\",\"type\":\"dzumveekg\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -32,11 +32,10 @@ public void testGetWithResponse() throws Exception { new AzureProfile("", "", AzureEnvironment.AZURE)); Configuration response = manager.configurations() - .getWithResponse("wau", "qncygupkvi", "mdscwxqupev", com.azure.core.util.Context.NONE) + .getWithResponse("bexrmcq", "bycnojvkn", "e", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("stotxh", response.value()); - Assertions.assertEquals("ujbypelmcuvhixb", response.currentValue()); - Assertions.assertEquals(ConfigurationSource.USER_OVERRIDE, response.source()); + Assertions.assertEquals("gzva", response.value()); + Assertions.assertEquals(ConfigurationSource.SYSTEM_DEFAULT, response.source()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsListByServerMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsListByServerMockTests.java index 706b047b4c80e..832008e191215 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsListByServerMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsListByServerMockTests.java @@ -23,7 +23,7 @@ public final class ConfigurationsListByServerMockTests { @Test public void testListByServer() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"value\":\"cy\",\"currentValue\":\"zdgiruj\",\"description\":\"bomvzzbtdcqv\",\"documentationLink\":\"iyujviylwdshfs\",\"defaultValue\":\"rbgyefry\",\"dataType\":\"gaojf\",\"allowedValues\":\"nc\",\"source\":\"user-override\",\"isReadOnly\":\"True\",\"isConfigPendingRestart\":\"False\",\"isDynamicConfig\":\"False\"},\"id\":\"ymoxoftpipiwyczu\",\"name\":\"xacpqjli\",\"type\":\"hyus\"}]}"; + = "{\"value\":[{\"properties\":{\"value\":\"wj\",\"description\":\"gdrjervnaenqpe\",\"defaultValue\":\"ndoygmifthnzdnd\",\"dataType\":\"gnayqigynduh\",\"allowedValues\":\"hqlkthumaqo\",\"source\":\"system-default\",\"isReadOnly\":\"True\",\"isConfigPendingRestart\":\"True\",\"isDynamicConfig\":\"False\"},\"id\":\"tgccymvaolpss\",\"name\":\"qlfmmdnbb\",\"type\":\"lzpswiydm\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -32,12 +32,10 @@ public void testListByServer() throws Exception { .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureEnvironment.AZURE)); - PagedIterable response = manager.configurations() - .listByServer("fo", "jzhpjbibgjmfx", "mv", "cluyovwxnbkf", 1806347124, 1794198042, - com.azure.core.util.Context.NONE); + PagedIterable response + = manager.configurations().listByServer("aruoujmkcjhwqyt", "r", com.azure.core.util.Context.NONE); - Assertions.assertEquals("cy", response.iterator().next().value()); - Assertions.assertEquals("zdgiruj", response.iterator().next().currentValue()); - Assertions.assertEquals(ConfigurationSource.USER_OVERRIDE, response.iterator().next().source()); + Assertions.assertEquals("wj", response.iterator().next().value()); + Assertions.assertEquals(ConfigurationSource.SYSTEM_DEFAULT, response.iterator().next().source()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsCreateOrUpdateMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsUpdateMockTests.java similarity index 58% rename from sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsCreateOrUpdateMockTests.java rename to sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsUpdateMockTests.java index e5246e456e303..933a5358c446b 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsCreateOrUpdateMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ConfigurationsUpdateMockTests.java @@ -10,6 +10,7 @@ import com.azure.core.management.profile.AzureProfile; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; +import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ConfigurationInner; import com.azure.resourcemanager.mysqlflexibleserver.models.Configuration; import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationSource; import java.nio.charset.StandardCharsets; @@ -18,11 +19,11 @@ import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; -public final class ConfigurationsCreateOrUpdateMockTests { +public final class ConfigurationsUpdateMockTests { @Test - public void testCreateOrUpdate() throws Exception { + public void testUpdate() throws Exception { String responseStr - = "{\"properties\":{\"value\":\"ojgcyzt\",\"currentValue\":\"mznbaeqphch\",\"description\":\"rn\",\"documentationLink\":\"x\",\"defaultValue\":\"uwrykqgaifmvikl\",\"dataType\":\"dvk\",\"allowedValues\":\"ejd\",\"source\":\"system-default\",\"isReadOnly\":\"False\",\"isConfigPendingRestart\":\"True\",\"isDynamicConfig\":\"True\"},\"id\":\"jivolvtnov\",\"name\":\"fzg\",\"type\":\"mjdftu\"}"; + = "{\"properties\":{\"value\":\"jkbegibtnmxiebww\",\"description\":\"oayqc\",\"defaultValue\":\"rtzju\",\"dataType\":\"wyzmhtxon\",\"allowedValues\":\"ts\",\"source\":\"user-override\",\"isReadOnly\":\"True\",\"isConfigPendingRestart\":\"False\",\"isDynamicConfig\":\"False\"},\"id\":\"srknftguv\",\"name\":\"iuhprwmdyvxqta\",\"type\":\"riwwroy\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -32,15 +33,11 @@ public void testCreateOrUpdate() throws Exception { new AzureProfile("", "", AzureEnvironment.AZURE)); Configuration response = manager.configurations() - .define("euzvx") - .withExistingFlexibleServer("skasdvlmfwdgzxu", "ucvpamrs") - .withValue("sjnhn") - .withCurrentValue("xifqjzgxm") - .withSource(ConfigurationSource.USER_OVERRIDE) - .create(); + .update("euecivyhzceuoj", "jrwjueiotwm", "dytdxwitx", + new ConfigurationInner().withValue("awgqwgxhni").withSource(ConfigurationSource.USER_OVERRIDE), + com.azure.core.util.Context.NONE); - Assertions.assertEquals("ojgcyzt", response.value()); - Assertions.assertEquals("mznbaeqphch", response.currentValue()); - Assertions.assertEquals(ConfigurationSource.SYSTEM_DEFAULT, response.source()); + Assertions.assertEquals("jkbegibtnmxiebww", response.value()); + Assertions.assertEquals(ConfigurationSource.USER_OVERRIDE, response.source()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabaseInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabaseInnerTests.java index 4f64b465bf883..c136870ba9788 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabaseInnerTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabaseInnerTests.java @@ -12,17 +12,17 @@ public final class DatabaseInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DatabaseInner model = BinaryData.fromString( - "{\"properties\":{\"charset\":\"c\",\"collation\":\"c\"},\"id\":\"ierhhbcsglummaj\",\"name\":\"j\",\"type\":\"odxobnbdxkqpxok\"}") + "{\"properties\":{\"charset\":\"zqqedq\",\"collation\":\"bciqfouflm\"},\"id\":\"kzsmodm\",\"name\":\"lougpbkw\",\"type\":\"mutduqktaps\"}") .toObject(DatabaseInner.class); - Assertions.assertEquals("c", model.charset()); - Assertions.assertEquals("c", model.collation()); + Assertions.assertEquals("zqqedq", model.charset()); + Assertions.assertEquals("bciqfouflm", model.collation()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - DatabaseInner model = new DatabaseInner().withCharset("c").withCollation("c"); + DatabaseInner model = new DatabaseInner().withCharset("zqqedq").withCollation("bciqfouflm"); model = BinaryData.fromObject(model).toObject(DatabaseInner.class); - Assertions.assertEquals("c", model.charset()); - Assertions.assertEquals("c", model.collation()); + Assertions.assertEquals("zqqedq", model.charset()); + Assertions.assertEquals("bciqfouflm", model.collation()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabaseListResultTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabaseListResultTests.java index afd3efbb3a36e..9534a12cf1d5b 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabaseListResultTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabaseListResultTests.java @@ -14,22 +14,21 @@ public final class DatabaseListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DatabaseListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"charset\":\"ajrmvdjwzrlovmc\",\"collation\":\"hijco\"},\"id\":\"ctbzaq\",\"name\":\"qsycbkbfkgu\",\"type\":\"dkexxppofm\"},{\"properties\":{\"charset\":\"c\",\"collation\":\"pg\"},\"id\":\"toc\",\"name\":\"j\",\"type\":\"hvpmoue\"}],\"nextLink\":\"dzxibqeojnxqbzvd\"}") + "{\"value\":[{\"properties\":{\"charset\":\"ddgmb\",\"collation\":\"ex\"},\"id\":\"bhtqqrolfpfpsa\",\"name\":\"gbquxigj\",\"type\":\"jgzjaoyfhrtx\"}],\"nextLink\":\"n\"}") .toObject(DatabaseListResult.class); - Assertions.assertEquals("ajrmvdjwzrlovmc", model.value().get(0).charset()); - Assertions.assertEquals("hijco", model.value().get(0).collation()); - Assertions.assertEquals("dzxibqeojnxqbzvd", model.nextLink()); + Assertions.assertEquals("ddgmb", model.value().get(0).charset()); + Assertions.assertEquals("ex", model.value().get(0).collation()); + Assertions.assertEquals("n", model.nextLink()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { DatabaseListResult model = new DatabaseListResult() - .withValue(Arrays.asList(new DatabaseInner().withCharset("ajrmvdjwzrlovmc").withCollation("hijco"), - new DatabaseInner().withCharset("c").withCollation("pg"))) - .withNextLink("dzxibqeojnxqbzvd"); + .withValue(Arrays.asList(new DatabaseInner().withCharset("ddgmb").withCollation("ex"))) + .withNextLink("n"); model = BinaryData.fromObject(model).toObject(DatabaseListResult.class); - Assertions.assertEquals("ajrmvdjwzrlovmc", model.value().get(0).charset()); - Assertions.assertEquals("hijco", model.value().get(0).collation()); - Assertions.assertEquals("dzxibqeojnxqbzvd", model.nextLink()); + Assertions.assertEquals("ddgmb", model.value().get(0).charset()); + Assertions.assertEquals("ex", model.value().get(0).collation()); + Assertions.assertEquals("n", model.nextLink()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasePropertiesTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasePropertiesTests.java index e7322e6dd0867..5d4e07dfa5a00 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasePropertiesTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasePropertiesTests.java @@ -11,17 +11,17 @@ public final class DatabasePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - DatabaseProperties model = BinaryData.fromString("{\"charset\":\"ionpimexg\",\"collation\":\"xgcp\"}") + DatabaseProperties model = BinaryData.fromString("{\"charset\":\"gcue\",\"collation\":\"umkdosvqwhbmd\"}") .toObject(DatabaseProperties.class); - Assertions.assertEquals("ionpimexg", model.charset()); - Assertions.assertEquals("xgcp", model.collation()); + Assertions.assertEquals("gcue", model.charset()); + Assertions.assertEquals("umkdosvqwhbmd", model.collation()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - DatabaseProperties model = new DatabaseProperties().withCharset("ionpimexg").withCollation("xgcp"); + DatabaseProperties model = new DatabaseProperties().withCharset("gcue").withCollation("umkdosvqwhbmd"); model = BinaryData.fromObject(model).toObject(DatabaseProperties.class); - Assertions.assertEquals("ionpimexg", model.charset()); - Assertions.assertEquals("xgcp", model.collation()); + Assertions.assertEquals("gcue", model.charset()); + Assertions.assertEquals("umkdosvqwhbmd", model.collation()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesCreateOrUpdateMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesCreateOrUpdateMockTests.java index 47aec5aac9619..1559c79cbc776 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesCreateOrUpdateMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesCreateOrUpdateMockTests.java @@ -21,7 +21,7 @@ public final class DatabasesCreateOrUpdateMockTests { @Test public void testCreateOrUpdate() throws Exception { String responseStr - = "{\"properties\":{\"charset\":\"kkqfqjbvle\",\"collation\":\"fmluiqtqzfavyvn\"},\"id\":\"ybar\",\"name\":\"euayjkqabqgzsles\",\"type\":\"cbhernntiewdj\"}"; + = "{\"properties\":{\"charset\":\"qhakauhashsf\",\"collation\":\"osow\"},\"id\":\"cugicjoox\",\"name\":\"j\",\"type\":\"bwpucwwfvovbv\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -31,13 +31,13 @@ public void testCreateOrUpdate() throws Exception { new AzureProfile("", "", AzureEnvironment.AZURE)); Database response = manager.databases() - .define("zedqbcvhzlhplo") - .withExistingFlexibleServer("ostgkts", "vdxec") - .withCharset("dlwwqfbumlkxt") - .withCollation("jfsmlmbtxhwgfwsr") + .define("vfadmws") + .withExistingFlexibleServer("hcdhmdual", "exq") + .withCharset("gvxp") + .withCollation("omzlfmi") .create(); - Assertions.assertEquals("kkqfqjbvle", response.charset()); - Assertions.assertEquals("fmluiqtqzfavyvn", response.collation()); + Assertions.assertEquals("qhakauhashsf", response.charset()); + Assertions.assertEquals("osow", response.collation()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesDeleteMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesDeleteMockTests.java index 4f681f815fc80..73d9cf1c8bd62 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesDeleteMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesDeleteMockTests.java @@ -27,7 +27,7 @@ public void testDelete() throws Exception { .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureEnvironment.AZURE)); - manager.databases().delete("jltduceam", "mczuo", "ejwcwwqiok", com.azure.core.util.Context.NONE); + manager.databases().delete("fjz", "fqkquj", "dsuyonobgla", com.azure.core.util.Context.NONE); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesGetWithResponseMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesGetWithResponseMockTests.java index 3ba2ebbf4dbaf..ff3abec478ab9 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesGetWithResponseMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesGetWithResponseMockTests.java @@ -21,7 +21,7 @@ public final class DatabasesGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"charset\":\"cfzq\",\"collation\":\"yxgtczh\"},\"id\":\"dbsdshm\",\"name\":\"xmaehvbbxu\",\"type\":\"iplt\"}"; + = "{\"properties\":{\"charset\":\"xy\",\"collation\":\"moyrxvwfudwpz\"},\"id\":\"xhdzhlrqjbhckf\",\"name\":\"lhrxsbkyvpyc\",\"type\":\"n\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -31,9 +31,9 @@ public void testGetWithResponse() throws Exception { new AzureProfile("", "", AzureEnvironment.AZURE)); Database response - = manager.databases().getWithResponse("ssxmojms", "p", "jpr", com.azure.core.util.Context.NONE).getValue(); + = manager.databases().getWithResponse("cq", "tcc", "g", com.azure.core.util.Context.NONE).getValue(); - Assertions.assertEquals("cfzq", response.charset()); - Assertions.assertEquals("yxgtczh", response.collation()); + Assertions.assertEquals("xy", response.charset()); + Assertions.assertEquals("moyrxvwfudwpz", response.collation()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesListByServerMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesListByServerMockTests.java index c4ea56e2d5584..0778ef785294f 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesListByServerMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DatabasesListByServerMockTests.java @@ -22,7 +22,7 @@ public final class DatabasesListByServerMockTests { @Test public void testListByServer() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"charset\":\"wrck\",\"collation\":\"kl\"},\"id\":\"pluodpv\",\"name\":\"uudl\",\"type\":\"zibt\"}]}"; + = "{\"value\":[{\"properties\":{\"charset\":\"fkuwbcrnwbmehhse\",\"collation\":\"jusrtslhspk\"},\"id\":\"emaofmxagkvt\",\"name\":\"elmqk\",\"type\":\"hahvljuahaq\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -31,10 +31,9 @@ public void testListByServer() throws Exception { .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureEnvironment.AZURE)); - PagedIterable response - = manager.databases().listByServer("n", "tbaxk", com.azure.core.util.Context.NONE); + PagedIterable response = manager.databases().listByServer("z", "p", com.azure.core.util.Context.NONE); - Assertions.assertEquals("wrck", response.iterator().next().charset()); - Assertions.assertEquals("kl", response.iterator().next().collation()); + Assertions.assertEquals("fkuwbcrnwbmehhse", response.iterator().next().charset()); + Assertions.assertEquals("jusrtslhspk", response.iterator().next().collation()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DelegatedSubnetUsageTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DelegatedSubnetUsageTests.java index d2d5fececbe7e..0935f5fafd9d6 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DelegatedSubnetUsageTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/DelegatedSubnetUsageTests.java @@ -11,7 +11,7 @@ public final class DelegatedSubnetUsageTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DelegatedSubnetUsage model - = BinaryData.fromString("{\"subnetName\":\"vgpiohgwxrt\",\"usage\":9067557687831354923}") + = BinaryData.fromString("{\"subnetName\":\"ezrkgqhcjrefo\",\"usage\":149589040651836260}") .toObject(DelegatedSubnetUsage.class); } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRuleInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRuleInnerTests.java index 67f97a1a42ebe..8e9b401f9cb62 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRuleInnerTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRuleInnerTests.java @@ -12,18 +12,18 @@ public final class FirewallRuleInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { FirewallRuleInner model = BinaryData.fromString( - "{\"properties\":{\"startIpAddress\":\"ntwndeicbtwnpzao\",\"endIpAddress\":\"vuhrhcffcyddgl\"},\"id\":\"t\",\"name\":\"jqkwpyeicx\",\"type\":\"qciwqvhkhixuigdt\"}") + "{\"properties\":{\"startIpAddress\":\"kufubljo\",\"endIpAddress\":\"xqeofjaeqjhqjba\"},\"id\":\"msmjqulngsntn\",\"name\":\"ybkzgcwr\",\"type\":\"clxxwrljdo\"}") .toObject(FirewallRuleInner.class); - Assertions.assertEquals("ntwndeicbtwnpzao", model.startIpAddress()); - Assertions.assertEquals("vuhrhcffcyddgl", model.endIpAddress()); + Assertions.assertEquals("kufubljo", model.startIpAddress()); + Assertions.assertEquals("xqeofjaeqjhqjba", model.endIpAddress()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { FirewallRuleInner model - = new FirewallRuleInner().withStartIpAddress("ntwndeicbtwnpzao").withEndIpAddress("vuhrhcffcyddgl"); + = new FirewallRuleInner().withStartIpAddress("kufubljo").withEndIpAddress("xqeofjaeqjhqjba"); model = BinaryData.fromObject(model).toObject(FirewallRuleInner.class); - Assertions.assertEquals("ntwndeicbtwnpzao", model.startIpAddress()); - Assertions.assertEquals("vuhrhcffcyddgl", model.endIpAddress()); + Assertions.assertEquals("kufubljo", model.startIpAddress()); + Assertions.assertEquals("xqeofjaeqjhqjba", model.endIpAddress()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRuleListResultTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRuleListResultTests.java index 0ee05ef5d5e49..581cc87c32e49 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRuleListResultTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRuleListResultTests.java @@ -14,21 +14,24 @@ public final class FirewallRuleListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { FirewallRuleListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"startIpAddress\":\"a\",\"endIpAddress\":\"a\"},\"id\":\"rzayv\",\"name\":\"t\",\"type\":\"gvdfgiotkftutq\"}],\"nextLink\":\"ngxlefgugnxkrxdq\"}") + "{\"value\":[{\"properties\":{\"startIpAddress\":\"sainqpjwnzl\",\"endIpAddress\":\"jfm\"},\"id\":\"eebvmgxsab\",\"name\":\"yqduujit\",\"type\":\"jczdzevndh\"},{\"properties\":{\"startIpAddress\":\"rwpdappdsbdkvwrw\",\"endIpAddress\":\"feusnhut\"},\"id\":\"ltmrldh\",\"name\":\"gjzzdatqxhocdg\",\"type\":\"ablgphuticndvk\"},{\"properties\":{\"startIpAddress\":\"ozwyiftyhxhuro\",\"endIpAddress\":\"ftyxolniw\"},\"id\":\"cukjf\",\"name\":\"giawx\",\"type\":\"lryplwckbasyy\"},{\"properties\":{\"startIpAddress\":\"nddhsgcbacph\",\"endIpAddress\":\"jkot\"},\"id\":\"qgoulznd\",\"name\":\"i\",\"type\":\"wyqkgfgibm\"}],\"nextLink\":\"gakeqsr\"}") .toObject(FirewallRuleListResult.class); - Assertions.assertEquals("a", model.value().get(0).startIpAddress()); - Assertions.assertEquals("a", model.value().get(0).endIpAddress()); - Assertions.assertEquals("ngxlefgugnxkrxdq", model.nextLink()); + Assertions.assertEquals("sainqpjwnzl", model.value().get(0).startIpAddress()); + Assertions.assertEquals("jfm", model.value().get(0).endIpAddress()); + Assertions.assertEquals("gakeqsr", model.nextLink()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { FirewallRuleListResult model = new FirewallRuleListResult() - .withValue(Arrays.asList(new FirewallRuleInner().withStartIpAddress("a").withEndIpAddress("a"))) - .withNextLink("ngxlefgugnxkrxdq"); + .withValue(Arrays.asList(new FirewallRuleInner().withStartIpAddress("sainqpjwnzl").withEndIpAddress("jfm"), + new FirewallRuleInner().withStartIpAddress("rwpdappdsbdkvwrw").withEndIpAddress("feusnhut"), + new FirewallRuleInner().withStartIpAddress("ozwyiftyhxhuro").withEndIpAddress("ftyxolniw"), + new FirewallRuleInner().withStartIpAddress("nddhsgcbacph").withEndIpAddress("jkot"))) + .withNextLink("gakeqsr"); model = BinaryData.fromObject(model).toObject(FirewallRuleListResult.class); - Assertions.assertEquals("a", model.value().get(0).startIpAddress()); - Assertions.assertEquals("a", model.value().get(0).endIpAddress()); - Assertions.assertEquals("ngxlefgugnxkrxdq", model.nextLink()); + Assertions.assertEquals("sainqpjwnzl", model.value().get(0).startIpAddress()); + Assertions.assertEquals("jfm", model.value().get(0).endIpAddress()); + Assertions.assertEquals("gakeqsr", model.nextLink()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulePropertiesTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulePropertiesTests.java index 2135166d7fd29..f1efbd76ba035 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulePropertiesTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulePropertiesTests.java @@ -11,17 +11,19 @@ public final class FirewallRulePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - FirewallRuleProperties model = BinaryData.fromString("{\"startIpAddress\":\"pbobjo\",\"endIpAddress\":\"hm\"}") - .toObject(FirewallRuleProperties.class); - Assertions.assertEquals("pbobjo", model.startIpAddress()); - Assertions.assertEquals("hm", model.endIpAddress()); + FirewallRuleProperties model + = BinaryData.fromString("{\"startIpAddress\":\"skcqvkocrcjd\",\"endIpAddress\":\"wtnhxbnjbiksqr\"}") + .toObject(FirewallRuleProperties.class); + Assertions.assertEquals("skcqvkocrcjd", model.startIpAddress()); + Assertions.assertEquals("wtnhxbnjbiksqr", model.endIpAddress()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - FirewallRuleProperties model = new FirewallRuleProperties().withStartIpAddress("pbobjo").withEndIpAddress("hm"); + FirewallRuleProperties model + = new FirewallRuleProperties().withStartIpAddress("skcqvkocrcjd").withEndIpAddress("wtnhxbnjbiksqr"); model = BinaryData.fromObject(model).toObject(FirewallRuleProperties.class); - Assertions.assertEquals("pbobjo", model.startIpAddress()); - Assertions.assertEquals("hm", model.endIpAddress()); + Assertions.assertEquals("skcqvkocrcjd", model.startIpAddress()); + Assertions.assertEquals("wtnhxbnjbiksqr", model.endIpAddress()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesCreateOrUpdateMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesCreateOrUpdateMockTests.java index e1631f5c62922..9b3ee450ed379 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesCreateOrUpdateMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesCreateOrUpdateMockTests.java @@ -21,7 +21,7 @@ public final class FirewallRulesCreateOrUpdateMockTests { @Test public void testCreateOrUpdate() throws Exception { String responseStr - = "{\"properties\":{\"startIpAddress\":\"alywjhhgdn\",\"endIpAddress\":\"xmsivfomiloxggdu\"},\"id\":\"q\",\"name\":\"dieuzaofj\",\"type\":\"hvcyyysfg\"}"; + = "{\"properties\":{\"startIpAddress\":\"nermcl\",\"endIpAddress\":\"plpho\"},\"id\":\"scrpabgyepsbjt\",\"name\":\"zq\",\"type\":\"gxywpmue\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -31,13 +31,13 @@ public void testCreateOrUpdate() throws Exception { new AzureProfile("", "", AzureEnvironment.AZURE)); FirewallRule response = manager.firewallRules() - .define("kokwbqplhlvnu") - .withExistingFlexibleServer("rxgibbd", "xconfozauors") - .withStartIpAddress("epzl") - .withEndIpAddress("phwzsoldweyuqdu") + .define("o") + .withExistingFlexibleServer("cwsvlxotog", "wrupqsxvnmicykvc") + .withStartIpAddress("eil") + .withEndIpAddress("vnotyfjfcnj") .create(); - Assertions.assertEquals("alywjhhgdn", response.startIpAddress()); - Assertions.assertEquals("xmsivfomiloxggdu", response.endIpAddress()); + Assertions.assertEquals("nermcl", response.startIpAddress()); + Assertions.assertEquals("plpho", response.endIpAddress()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesDeleteMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesDeleteMockTests.java index 08d34ef73d1d8..31dbe402d1e40 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesDeleteMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesDeleteMockTests.java @@ -27,7 +27,7 @@ public void testDelete() throws Exception { .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureEnvironment.AZURE)); - manager.firewallRules().delete("vbquwr", "ehwagoh", "uffkmrqemvvh", com.azure.core.util.Context.NONE); + manager.firewallRules().delete("lcuhxwtctyqiklb", "ovplw", "bhvgy", com.azure.core.util.Context.NONE); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesGetWithResponseMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesGetWithResponseMockTests.java index 3542aef8cada9..d0af043e676df 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesGetWithResponseMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesGetWithResponseMockTests.java @@ -21,7 +21,7 @@ public final class FirewallRulesGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"startIpAddress\":\"guaadraufactkahz\",\"endIpAddress\":\"v\"},\"id\":\"j\",\"name\":\"iuxxpshneekulfg\",\"type\":\"lqubkwdlen\"}"; + = "{\"properties\":{\"startIpAddress\":\"mg\",\"endIpAddress\":\"xnkjzkdesl\"},\"id\":\"lopwiyig\",\"name\":\"xpkd\",\"type\":\"zb\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -31,10 +31,10 @@ public void testGetWithResponse() throws Exception { new AzureProfile("", "", AzureEnvironment.AZURE)); FirewallRule response = manager.firewallRules() - .getWithResponse("xtdr", "futacoebjvewzc", "znmwcp", com.azure.core.util.Context.NONE) + .getWithResponse("gu", "svmkfssxquk", "fpl", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("guaadraufactkahz", response.startIpAddress()); - Assertions.assertEquals("v", response.endIpAddress()); + Assertions.assertEquals("mg", response.startIpAddress()); + Assertions.assertEquals("xnkjzkdesl", response.endIpAddress()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesListByServerMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesListByServerMockTests.java index 42b40f818eec6..68aa34daa2b02 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesListByServerMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FirewallRulesListByServerMockTests.java @@ -22,7 +22,7 @@ public final class FirewallRulesListByServerMockTests { @Test public void testListByServer() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"startIpAddress\":\"pjuohminyfl\",\"endIpAddress\":\"orwmduvwpklv\"},\"id\":\"mygdxpgpqch\",\"name\":\"sze\",\"type\":\"nnbj\"}]}"; + = "{\"value\":[{\"properties\":{\"startIpAddress\":\"txp\",\"endIpAddress\":\"ie\"},\"id\":\"fhvpesaps\",\"name\":\"rdqmhjjdhtldwkyz\",\"type\":\"uutkncw\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -32,9 +32,9 @@ public void testListByServer() throws Exception { new AzureProfile("", "", AzureEnvironment.AZURE)); PagedIterable response - = manager.firewallRules().listByServer("d", "utujba", com.azure.core.util.Context.NONE); + = manager.firewallRules().listByServer("iuebbaumny", "upedeojnabckhs", com.azure.core.util.Context.NONE); - Assertions.assertEquals("pjuohminyfl", response.iterator().next().startIpAddress()); - Assertions.assertEquals("orwmduvwpklv", response.iterator().next().endIpAddress()); + Assertions.assertEquals("txp", response.iterator().next().startIpAddress()); + Assertions.assertEquals("ie", response.iterator().next().endIpAddress()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FullBackupStoreDetailsTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FullBackupStoreDetailsTests.java deleted file mode 100644 index c3130241e093f..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/FullBackupStoreDetailsTests.java +++ /dev/null @@ -1,28 +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.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.FullBackupStoreDetails; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class FullBackupStoreDetailsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - FullBackupStoreDetails model = BinaryData.fromString( - "{\"objectType\":\"FullBackupStoreDetails\",\"sasUriList\":[\"cizsjqlhkrribdei\",\"qipqkghvxndz\",\"mkrefajpjorwkq\"]}") - .toObject(FullBackupStoreDetails.class); - Assertions.assertEquals("cizsjqlhkrribdei", model.sasUriList().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FullBackupStoreDetails model = new FullBackupStoreDetails() - .withSasUriList(Arrays.asList("cizsjqlhkrribdei", "qipqkghvxndz", "mkrefajpjorwkq")); - model = BinaryData.fromObject(model).toObject(FullBackupStoreDetails.class); - Assertions.assertEquals("cizsjqlhkrribdei", model.sasUriList().get(0)); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/GetPrivateDnsZoneSuffixResponseInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/GetPrivateDnsZoneSuffixResponseInnerTests.java index 696e27516696f..d07d80224ed32 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/GetPrivateDnsZoneSuffixResponseInnerTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/GetPrivateDnsZoneSuffixResponseInnerTests.java @@ -11,16 +11,17 @@ public final class GetPrivateDnsZoneSuffixResponseInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - GetPrivateDnsZoneSuffixResponseInner model = BinaryData.fromString("{\"privateDnsZoneSuffix\":\"glsbjjc\"}") - .toObject(GetPrivateDnsZoneSuffixResponseInner.class); - Assertions.assertEquals("glsbjjc", model.privateDnsZoneSuffix()); + GetPrivateDnsZoneSuffixResponseInner model + = BinaryData.fromString("{\"privateDnsZoneSuffix\":\"sounqecanoaeu\"}") + .toObject(GetPrivateDnsZoneSuffixResponseInner.class); + Assertions.assertEquals("sounqecanoaeu", model.privateDnsZoneSuffix()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { GetPrivateDnsZoneSuffixResponseInner model - = new GetPrivateDnsZoneSuffixResponseInner().withPrivateDnsZoneSuffix("glsbjjc"); + = new GetPrivateDnsZoneSuffixResponseInner().withPrivateDnsZoneSuffix("sounqecanoaeu"); model = BinaryData.fromObject(model).toObject(GetPrivateDnsZoneSuffixResponseInner.class); - Assertions.assertEquals("glsbjjc", model.privateDnsZoneSuffix()); + Assertions.assertEquals("sounqecanoaeu", model.privateDnsZoneSuffix()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/GetPrivateDnsZoneSuffixesExecuteWithResponseMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/GetPrivateDnsZoneSuffixesExecuteWithResponseMockTests.java index 6e089060382f4..7803691ca982c 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/GetPrivateDnsZoneSuffixesExecuteWithResponseMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/GetPrivateDnsZoneSuffixesExecuteWithResponseMockTests.java @@ -20,7 +20,7 @@ public final class GetPrivateDnsZoneSuffixesExecuteWithResponseMockTests { @Test public void testExecuteWithResponse() throws Exception { - String responseStr = "{\"privateDnsZoneSuffix\":\"cxfailcfxwmdboxd\"}"; + String responseStr = "{\"privateDnsZoneSuffix\":\"dtmhrkwofyyvoqa\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -32,6 +32,6 @@ public void testExecuteWithResponse() throws Exception { GetPrivateDnsZoneSuffixResponse response = manager.getPrivateDnsZoneSuffixes().executeWithResponse(com.azure.core.util.Context.NONE).getValue(); - Assertions.assertEquals("cxfailcfxwmdboxd", response.privateDnsZoneSuffix()); + Assertions.assertEquals("dtmhrkwofyyvoqa", response.privateDnsZoneSuffix()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/HighAvailabilityTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/HighAvailabilityTests.java index da7bc9689d99d..d46c6fb05e39a 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/HighAvailabilityTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/HighAvailabilityTests.java @@ -13,19 +13,18 @@ public final class HighAvailabilityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { HighAvailability model = BinaryData - .fromString( - "{\"mode\":\"Disabled\",\"state\":\"RemovingStandby\",\"standbyAvailabilityZone\":\"adehxnltyfsopp\"}") + .fromString("{\"mode\":\"ZoneRedundant\",\"state\":\"NotEnabled\",\"standbyAvailabilityZone\":\"cryuan\"}") .toObject(HighAvailability.class); - Assertions.assertEquals(HighAvailabilityMode.DISABLED, model.mode()); - Assertions.assertEquals("adehxnltyfsopp", model.standbyAvailabilityZone()); + Assertions.assertEquals(HighAvailabilityMode.ZONE_REDUNDANT, model.mode()); + Assertions.assertEquals("cryuan", model.standbyAvailabilityZone()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - HighAvailability model = new HighAvailability().withMode(HighAvailabilityMode.DISABLED) - .withStandbyAvailabilityZone("adehxnltyfsopp"); + HighAvailability model = new HighAvailability().withMode(HighAvailabilityMode.ZONE_REDUNDANT) + .withStandbyAvailabilityZone("cryuan"); model = BinaryData.fromObject(model).toObject(HighAvailability.class); - Assertions.assertEquals(HighAvailabilityMode.DISABLED, model.mode()); - Assertions.assertEquals("adehxnltyfsopp", model.standbyAvailabilityZone()); + Assertions.assertEquals(HighAvailabilityMode.ZONE_REDUNDANT, model.mode()); + Assertions.assertEquals("cryuan", model.standbyAvailabilityZone()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/HighAvailabilityValidationEstimationInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/HighAvailabilityValidationEstimationInnerTests.java deleted file mode 100644 index 58746647a6da5..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/HighAvailabilityValidationEstimationInnerTests.java +++ /dev/null @@ -1,27 +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.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.HighAvailabilityValidationEstimationInner; -import org.junit.jupiter.api.Assertions; - -public final class HighAvailabilityValidationEstimationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - HighAvailabilityValidationEstimationInner model = BinaryData.fromString( - "{\"estimatedDowntime\":2118838793,\"scheduledStandbyAvailabilityZone\":\"mvxi\",\"expectedStandbyAvailabilityZone\":\"uugidyjrrfby\"}") - .toObject(HighAvailabilityValidationEstimationInner.class); - Assertions.assertEquals("uugidyjrrfby", model.expectedStandbyAvailabilityZone()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - HighAvailabilityValidationEstimationInner model - = new HighAvailabilityValidationEstimationInner().withExpectedStandbyAvailabilityZone("uugidyjrrfby"); - model = BinaryData.fromObject(model).toObject(HighAvailabilityValidationEstimationInner.class); - Assertions.assertEquals("uugidyjrrfby", model.expectedStandbyAvailabilityZone()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MySqlServerIdentityTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/IdentityTests.java similarity index 58% rename from sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MySqlServerIdentityTests.java rename to sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/IdentityTests.java index 4e9ce504de52a..e088da35fa145 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MySqlServerIdentityTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/IdentityTests.java @@ -5,27 +5,26 @@ package com.azure.resourcemanager.mysqlflexibleserver.generated; import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.mysqlflexibleserver.models.Identity; import com.azure.resourcemanager.mysqlflexibleserver.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.mysqlflexibleserver.models.MySqlServerIdentity; import java.util.HashMap; import java.util.Map; import org.junit.jupiter.api.Assertions; -public final class MySqlServerIdentityTests { +public final class IdentityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - MySqlServerIdentity model = BinaryData.fromString( - "{\"principalId\":\"fionl\",\"tenantId\":\"x\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"rjfeallnwsubisnj\":\"datazxdpnqbqqw\",\"hcbonqvpkvlr\":\"datampmngnzscxaqwoo\",\"y\":\"datanjeaseipheofloke\"}}") - .toObject(MySqlServerIdentity.class); + Identity model = BinaryData.fromString( + "{\"principalId\":\"qjnqglhqgnufoooj\",\"tenantId\":\"ifsqesaagdfmg\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"zntocipaouajps\":\"dataxrifkwmrvkts\"}}") + .toObject(Identity.class); Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.type()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - MySqlServerIdentity model = new MySqlServerIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities(mapOf("rjfeallnwsubisnj", "datazxdpnqbqqw", "hcbonqvpkvlr", - "datampmngnzscxaqwoo", "y", "datanjeaseipheofloke")); - model = BinaryData.fromObject(model).toObject(MySqlServerIdentity.class); + Identity model = new Identity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf("zntocipaouajps", "dataxrifkwmrvkts")); + model = BinaryData.fromObject(model).toObject(Identity.class); Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.type()); } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ImportFromStorageResponseTypeTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ImportFromStorageResponseTypeTests.java deleted file mode 100644 index bd6deb6b4249b..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ImportFromStorageResponseTypeTests.java +++ /dev/null @@ -1,29 +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.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.ImportFromStorageResponseType; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class ImportFromStorageResponseTypeTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ImportFromStorageResponseType model = BinaryData - .fromString( - "{\"objectType\":\"ImportFromStorageResponse\",\"estimatedCompletionTime\":\"2021-09-21T09:33:48Z\"}") - .toObject(ImportFromStorageResponseType.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-21T09:33:48Z"), model.estimatedCompletionTime()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ImportFromStorageResponseType model = new ImportFromStorageResponseType() - .withEstimatedCompletionTime(OffsetDateTime.parse("2021-09-21T09:33:48Z")); - model = BinaryData.fromObject(model).toObject(ImportFromStorageResponseType.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-21T09:33:48Z"), model.estimatedCompletionTime()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LocationBasedCapabilitiesListMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LocationBasedCapabilitiesListMockTests.java index 967546caca370..16dd179e5c165 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LocationBasedCapabilitiesListMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LocationBasedCapabilitiesListMockTests.java @@ -21,7 +21,7 @@ public final class LocationBasedCapabilitiesListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"zone\":\"w\",\"supportedHAMode\":[\"wplefaxvxil\",\"btgn\",\"nzeyqxtjj\"],\"supportedGeoBackupRegions\":[\"lqhy\",\"avodg\",\"xdbeesmieknl\"],\"supportedFlexibleServerEditions\":[{\"name\":\"aawiuagydwqfb\",\"supportedStorageEditions\":[{\"name\":\"fgiagtcojocqwo\",\"minStorageSize\":3056699249247760671,\"maxStorageSize\":7238052431733623835,\"minBackupRetentionDays\":8876355294638697498,\"maxBackupRetentionDays\":5220960314956788398,\"minBackupIntervalHours\":8402905876452090730,\"maxBackupIntervalHours\":7581661872594982717}],\"supportedServerVersions\":[{\"name\":\"tkad\",\"supportedSkus\":[{}]},{\"name\":\"wn\",\"supportedSkus\":[{},{},{}]},{\"name\":\"bugrj\",\"supportedSkus\":[{}]},{\"name\":\"jc\",\"supportedSkus\":[{},{},{},{}]}]}]}]}"; + = "{\"value\":[{\"zone\":\"adbzmnvdfznud\",\"supportedHAMode\":[\"vxzbncb\",\"ylpstdbhhxsrzdz\",\"cers\",\"dntnevf\"],\"supportedGeoBackupRegions\":[\"mygtdssls\",\"tmweriofzpyq\",\"emwabnet\",\"hhszh\"],\"supportedFlexibleServerEditions\":[{\"name\":\"vwiwubmwmbesld\",\"supportedStorageEditions\":[{\"name\":\"tppjflcx\",\"minStorageSize\":3058762238955275057,\"maxStorageSize\":2510700461860168657,\"minBackupRetentionDays\":93220061334436953,\"maxBackupRetentionDays\":2991398819380628456},{\"name\":\"mkqzeqqkdltfzxmh\",\"minStorageSize\":4664695938466420383,\"maxStorageSize\":290569327537915175,\"minBackupRetentionDays\":820800207830190162,\"maxBackupRetentionDays\":5369174747362686105}],\"supportedServerVersions\":[{\"name\":\"xtibqdxbxwakbog\",\"supportedSkus\":[{},{},{}]},{\"name\":\"lkzgxhuriplbp\",\"supportedSkus\":[{},{},{},{}]}]},{\"name\":\"nkbebxmuby\",\"supportedStorageEditions\":[{\"name\":\"lrb\",\"minStorageSize\":8228747938287613437,\"maxStorageSize\":9145634763199835148,\"minBackupRetentionDays\":4523060122413380781,\"maxBackupRetentionDays\":2880173002615591497},{\"name\":\"l\",\"minStorageSize\":4929519207657456173,\"maxStorageSize\":8105546637199671811,\"minBackupRetentionDays\":8220583929714824601,\"maxBackupRetentionDays\":2432465930399611430}],\"supportedServerVersions\":[{\"name\":\"gcj\",\"supportedSkus\":[{}]},{\"name\":\"muvp\",\"supportedSkus\":[{}]},{\"name\":\"um\",\"supportedSkus\":[{}]},{\"name\":\"xe\",\"supportedSkus\":[{},{}]}]},{\"name\":\"btbhjpglkfgohd\",\"supportedStorageEditions\":[{\"name\":\"lfphsdyhtozfikd\",\"minStorageSize\":2120097512911222232,\"maxStorageSize\":891560083261976989,\"minBackupRetentionDays\":2092756450243660051,\"maxBackupRetentionDays\":6214959618688242083}],\"supportedServerVersions\":[{\"name\":\"hqzonosggbhcoh\",\"supportedSkus\":[{},{}]},{\"name\":\"jnkaljutiiswacff\",\"supportedSkus\":[{}]},{\"name\":\"zewk\",\"supportedSkus\":[{},{},{}]},{\"name\":\"crailvpn\",\"supportedSkus\":[{},{},{}]}]},{\"name\":\"flrwd\",\"supportedStorageEditions\":[{\"name\":\"xyjrxsagafcnih\",\"minStorageSize\":3130876298104392093,\"maxStorageSize\":7972426552267245030,\"minBackupRetentionDays\":8610358802606955668,\"maxBackupRetentionDays\":6066782690220181009},{\"name\":\"cvqvpkeqdcv\",\"minStorageSize\":5404644626428061791,\"maxStorageSize\":4054103831441569061,\"minBackupRetentionDays\":3436329358206451649,\"maxBackupRetentionDays\":6797997194848060096}],\"supportedServerVersions\":[{\"name\":\"pcjwv\",\"supportedSkus\":[{},{}]},{\"name\":\"d\",\"supportedSkus\":[{}]},{\"name\":\"cxrslpmutwuoe\",\"supportedSkus\":[{},{}]}]}]}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -31,7 +31,7 @@ public void testList() throws Exception { new AzureProfile("", "", AzureEnvironment.AZURE)); PagedIterable response - = manager.locationBasedCapabilities().list("vhmgorffukis", com.azure.core.util.Context.NONE); + = manager.locationBasedCapabilities().list("wyhzdx", com.azure.core.util.Context.NONE); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LocationBasedCapabilitySetsGetWithResponseMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LocationBasedCapabilitySetsGetWithResponseMockTests.java deleted file mode 100644 index 4682986b58eae..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LocationBasedCapabilitySetsGetWithResponseMockTests.java +++ /dev/null @@ -1,37 +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.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.Capability; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class LocationBasedCapabilitySetsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"supportedGeoBackupRegions\":[\"etoge\",\"joxslhvnhla\",\"rqnkkzjcjbtr\"],\"supportedFlexibleServerEditions\":[{\"name\":\"vvib\",\"defaultSku\":\"jj\",\"defaultStorageSize\":564299595,\"supportedStorageEditions\":[{},{}],\"supportedSkus\":[{}]},{\"name\":\"pkxztmoobkl\",\"defaultSku\":\"idgfc\",\"defaultStorageSize\":1491349609,\"supportedStorageEditions\":[{}],\"supportedSkus\":[{},{},{}]}],\"supportedServerVersions\":[{\"name\":\"hemjy\"},{\"name\":\"hujswtwkozzwcul\"}]},\"id\":\"awpfajnjwltlwtjj\",\"name\":\"uktalhsnvkcdmxz\",\"type\":\"poaimlnwiaaomyl\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MySqlManager manager = MySqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Capability response = manager.locationBasedCapabilitySets() - .getWithResponse("z", "seypxiutcxapz", com.azure.core.util.Context.NONE) - .getValue(); - - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LocationBasedCapabilitySetsListMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LocationBasedCapabilitySetsListMockTests.java deleted file mode 100644 index 5f865e62181a7..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LocationBasedCapabilitySetsListMockTests.java +++ /dev/null @@ -1,37 +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.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.Capability; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class LocationBasedCapabilitySetsListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"supportedGeoBackupRegions\":[\"efojyqdhcupl\"],\"supportedFlexibleServerEditions\":[{\"name\":\"wkhihihlhzdsqt\",\"defaultSku\":\"s\",\"defaultStorageSize\":1050448632,\"supportedStorageEditions\":[{},{}],\"supportedSkus\":[{}]},{\"name\":\"fgmvecactxmwo\",\"defaultSku\":\"yowc\",\"defaultStorageSize\":671380077,\"supportedStorageEditions\":[{},{}],\"supportedSkus\":[{},{}]},{\"name\":\"vgqouwifzmpj\",\"defaultSku\":\"ivqikfxcvhr\",\"defaultStorageSize\":1765107772,\"supportedStorageEditions\":[{},{},{},{}],\"supportedSkus\":[{},{},{},{}]}],\"supportedServerVersions\":[{\"name\":\"ikteusqczkvyk\"},{\"name\":\"ubyjaffmmf\"},{\"name\":\"cqc\"},{\"name\":\"bgq\"}]},\"id\":\"rtalmet\",\"name\":\"t\",\"type\":\"gdslqxihhrmoo\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MySqlManager manager = MySqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.locationBasedCapabilitySets().list("of", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LogFileInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LogFileInnerTests.java deleted file mode 100644 index 287e497a56a05..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LogFileInnerTests.java +++ /dev/null @@ -1,39 +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.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.LogFileInner; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class LogFileInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LogFileInner model = BinaryData.fromString( - "{\"properties\":{\"sizeInKB\":2270588281817751740,\"createdTime\":\"2021-10-30T06:22:22Z\",\"type\":\"jyoxgvclt\",\"lastModifiedTime\":\"2021-10-11T10:12:30Z\",\"url\":\"c\"},\"id\":\"kjeszz\",\"name\":\"bijhtxfvgxbf\",\"type\":\"mxnehmp\"}") - .toObject(LogFileInner.class); - Assertions.assertEquals(2270588281817751740L, model.sizeInKB()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-30T06:22:22Z"), model.createdTime()); - Assertions.assertEquals("jyoxgvclt", model.typePropertiesType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-11T10:12:30Z"), model.lastModifiedTime()); - Assertions.assertEquals("c", model.url()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LogFileInner model = new LogFileInner().withSizeInKB(2270588281817751740L) - .withCreatedTime(OffsetDateTime.parse("2021-10-30T06:22:22Z")) - .withTypePropertiesType("jyoxgvclt") - .withLastModifiedTime(OffsetDateTime.parse("2021-10-11T10:12:30Z")) - .withUrl("c"); - model = BinaryData.fromObject(model).toObject(LogFileInner.class); - Assertions.assertEquals(2270588281817751740L, model.sizeInKB()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-30T06:22:22Z"), model.createdTime()); - Assertions.assertEquals("jyoxgvclt", model.typePropertiesType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-11T10:12:30Z"), model.lastModifiedTime()); - Assertions.assertEquals("c", model.url()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LogFileListResultTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LogFileListResultTests.java deleted file mode 100644 index d8367c1cc2c50..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LogFileListResultTests.java +++ /dev/null @@ -1,60 +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.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.LogFileInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.LogFileListResult; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class LogFileListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LogFileListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"sizeInKB\":6694189583402716643,\"createdTime\":\"2021-10-04T01:34:07Z\",\"type\":\"fbishcbkha\",\"lastModifiedTime\":\"2021-05-05T10:08:59Z\",\"url\":\"eamdp\"},\"id\":\"g\",\"name\":\"lpbuxwgipwhonowk\",\"type\":\"shwankixzbinje\"},{\"properties\":{\"sizeInKB\":4664442885020763143,\"createdTime\":\"2020-12-26T19:40:41Z\",\"type\":\"nuzo\",\"lastModifiedTime\":\"2021-06-23T23:25:19Z\",\"url\":\"yqzrnkcqvyxlw\"},\"id\":\"lsicohoqqnwv\",\"name\":\"ryavwhheunmmqh\",\"type\":\"yxzk\"},{\"properties\":{\"sizeInKB\":5868571403319109352,\"createdTime\":\"2021-03-20T11:43:44Z\",\"type\":\"lyaxuc\",\"lastModifiedTime\":\"2021-08-29T22:44:57Z\",\"url\":\"szfkbe\"},\"id\":\"ewrmjmwvvjektc\",\"name\":\"senhwlrs\",\"type\":\"frzpwvlqdqgb\"},{\"properties\":{\"sizeInKB\":5657063864250371746,\"createdTime\":\"2021-05-04T00:16:05Z\",\"type\":\"etcktvfcivfsnk\",\"lastModifiedTime\":\"2021-12-09T18:50:38Z\",\"url\":\"tqhjfbebrjcx\"},\"id\":\"fuwutttxf\",\"name\":\"jrbirphxepcyv\",\"type\":\"hfnljkyq\"}],\"nextLink\":\"vuujq\"}") - .toObject(LogFileListResult.class); - Assertions.assertEquals(6694189583402716643L, model.value().get(0).sizeInKB()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-04T01:34:07Z"), model.value().get(0).createdTime()); - Assertions.assertEquals("fbishcbkha", model.value().get(0).typePropertiesType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-05T10:08:59Z"), model.value().get(0).lastModifiedTime()); - Assertions.assertEquals("eamdp", model.value().get(0).url()); - Assertions.assertEquals("vuujq", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LogFileListResult model = new LogFileListResult().withValue(Arrays.asList( - new LogFileInner().withSizeInKB(6694189583402716643L) - .withCreatedTime(OffsetDateTime.parse("2021-10-04T01:34:07Z")) - .withTypePropertiesType("fbishcbkha") - .withLastModifiedTime(OffsetDateTime.parse("2021-05-05T10:08:59Z")) - .withUrl("eamdp"), - new LogFileInner().withSizeInKB(4664442885020763143L) - .withCreatedTime(OffsetDateTime.parse("2020-12-26T19:40:41Z")) - .withTypePropertiesType("nuzo") - .withLastModifiedTime(OffsetDateTime.parse("2021-06-23T23:25:19Z")) - .withUrl("yqzrnkcqvyxlw"), - new LogFileInner().withSizeInKB(5868571403319109352L) - .withCreatedTime(OffsetDateTime.parse("2021-03-20T11:43:44Z")) - .withTypePropertiesType("lyaxuc") - .withLastModifiedTime(OffsetDateTime.parse("2021-08-29T22:44:57Z")) - .withUrl("szfkbe"), - new LogFileInner().withSizeInKB(5657063864250371746L) - .withCreatedTime(OffsetDateTime.parse("2021-05-04T00:16:05Z")) - .withTypePropertiesType("etcktvfcivfsnk") - .withLastModifiedTime(OffsetDateTime.parse("2021-12-09T18:50:38Z")) - .withUrl("tqhjfbebrjcx"))) - .withNextLink("vuujq"); - model = BinaryData.fromObject(model).toObject(LogFileListResult.class); - Assertions.assertEquals(6694189583402716643L, model.value().get(0).sizeInKB()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-04T01:34:07Z"), model.value().get(0).createdTime()); - Assertions.assertEquals("fbishcbkha", model.value().get(0).typePropertiesType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-05T10:08:59Z"), model.value().get(0).lastModifiedTime()); - Assertions.assertEquals("eamdp", model.value().get(0).url()); - Assertions.assertEquals("vuujq", model.nextLink()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LogFilePropertiesTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LogFilePropertiesTests.java deleted file mode 100644 index 6f43749d9203a..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LogFilePropertiesTests.java +++ /dev/null @@ -1,39 +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.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.LogFileProperties; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class LogFilePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LogFileProperties model = BinaryData.fromString( - "{\"sizeInKB\":4653478630911450001,\"createdTime\":\"2021-06-15T22:18:20Z\",\"type\":\"ebfqkkrbm\",\"lastModifiedTime\":\"2021-12-04T19:14:26Z\",\"url\":\"riwflzlfb\"}") - .toObject(LogFileProperties.class); - Assertions.assertEquals(4653478630911450001L, model.sizeInKB()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-15T22:18:20Z"), model.createdTime()); - Assertions.assertEquals("ebfqkkrbm", model.type()); - Assertions.assertEquals(OffsetDateTime.parse("2021-12-04T19:14:26Z"), model.lastModifiedTime()); - Assertions.assertEquals("riwflzlfb", model.url()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LogFileProperties model = new LogFileProperties().withSizeInKB(4653478630911450001L) - .withCreatedTime(OffsetDateTime.parse("2021-06-15T22:18:20Z")) - .withType("ebfqkkrbm") - .withLastModifiedTime(OffsetDateTime.parse("2021-12-04T19:14:26Z")) - .withUrl("riwflzlfb"); - model = BinaryData.fromObject(model).toObject(LogFileProperties.class); - Assertions.assertEquals(4653478630911450001L, model.sizeInKB()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-15T22:18:20Z"), model.createdTime()); - Assertions.assertEquals("ebfqkkrbm", model.type()); - Assertions.assertEquals(OffsetDateTime.parse("2021-12-04T19:14:26Z"), model.lastModifiedTime()); - Assertions.assertEquals("riwflzlfb", model.url()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LogFilesListByServerMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LogFilesListByServerMockTests.java deleted file mode 100644 index 8447e62cbbdda..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LogFilesListByServerMockTests.java +++ /dev/null @@ -1,44 +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.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.LogFile; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class LogFilesListByServerMockTests { - @Test - public void testListByServer() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"sizeInKB\":6282247410712068570,\"createdTime\":\"2021-05-31T00:15:25Z\",\"type\":\"vkbunzozudh\",\"lastModifiedTime\":\"2021-08-22T14:57:30Z\",\"url\":\"oyxcdyuib\"},\"id\":\"fdn\",\"name\":\"zydvfvf\",\"type\":\"jnaeois\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MySqlManager manager = MySqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.logFiles().listByServer("rafwgckhocxvdf", "fwafqrouda", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(6282247410712068570L, response.iterator().next().sizeInKB()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-31T00:15:25Z"), response.iterator().next().createdTime()); - Assertions.assertEquals("vkbunzozudh", response.iterator().next().typePropertiesType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-22T14:57:30Z"), - response.iterator().next().lastModifiedTime()); - Assertions.assertEquals("oyxcdyuib", response.iterator().next().url()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LongRunningBackupsCreateMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LongRunningBackupsCreateMockTests.java deleted file mode 100644 index ed43a91f65154..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LongRunningBackupsCreateMockTests.java +++ /dev/null @@ -1,48 +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.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupType; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerBackupV2; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class LongRunningBackupsCreateMockTests { - @Test - public void testCreate() throws Exception { - String responseStr - = "{\"properties\":{\"backupNameV2\":\"ipn\",\"backupType\":\"FULL\",\"completedTime\":\"2021-11-02T02:58:50Z\",\"source\":\"a\",\"provisioningState\":\"Succeeded\"},\"id\":\"jreafxtsgum\",\"name\":\"jglikkxwslolb\",\"type\":\"pvuzlmv\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MySqlManager manager = MySqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ServerBackupV2 response = manager.longRunningBackups() - .define("ixexcc") - .withExistingFlexibleServer("ngitvgbmhrixkwm", "ijejvegrhbpn") - .withBackupNameV2("eaxhcexdrrvqahqk") - .withBackupType(BackupType.FULL) - .withCompletedTime(OffsetDateTime.parse("2021-06-14T23:16:21Z")) - .withSource("jnhyjsvf") - .create(); - - Assertions.assertEquals("ipn", response.backupNameV2()); - Assertions.assertEquals(BackupType.FULL, response.backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-02T02:58:50Z"), response.completedTime()); - Assertions.assertEquals("a", response.source()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LongRunningBackupsOperationsGetWithResponseMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LongRunningBackupsOperationsGetWithResponseMockTests.java deleted file mode 100644 index ba7a19f595a63..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LongRunningBackupsOperationsGetWithResponseMockTests.java +++ /dev/null @@ -1,43 +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.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupType; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerBackupV2; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class LongRunningBackupsOperationsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"backupNameV2\":\"agfhsxtta\",\"backupType\":\"FULL\",\"completedTime\":\"2021-03-18T19:41:59Z\",\"source\":\"aa\",\"provisioningState\":\"Succeeded\"},\"id\":\"tnkdmkqj\",\"name\":\"lwuenvrkp\",\"type\":\"ou\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MySqlManager manager = MySqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ServerBackupV2 response = manager.longRunningBackupsOperations() - .getWithResponse("elfk", "gplcrpwjxeznoigb", "njwmwkpnbsazejj", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("agfhsxtta", response.backupNameV2()); - Assertions.assertEquals(BackupType.FULL, response.backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-18T19:41:59Z"), response.completedTime()); - Assertions.assertEquals("aa", response.source()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LongRunningBackupsOperationsListMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LongRunningBackupsOperationsListMockTests.java deleted file mode 100644 index 2f2c758012cc4..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/LongRunningBackupsOperationsListMockTests.java +++ /dev/null @@ -1,44 +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.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupType; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerBackupV2; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class LongRunningBackupsOperationsListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"backupNameV2\":\"xqtnq\",\"backupType\":\"FULL\",\"completedTime\":\"2021-05-14T16:05:17Z\",\"source\":\"fffiak\",\"provisioningState\":\"Canceled\"},\"id\":\"qmt\",\"name\":\"d\",\"type\":\"tmmjihyeozph\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MySqlManager manager = MySqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.longRunningBackupsOperations().list("ibreb", "aays", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("xqtnq", response.iterator().next().backupNameV2()); - Assertions.assertEquals(BackupType.FULL, response.iterator().next().backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-14T16:05:17Z"), - response.iterator().next().completedTime()); - Assertions.assertEquals("fffiak", response.iterator().next().source()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenanceInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenanceInnerTests.java deleted file mode 100644 index 7b4821361d149..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenanceInnerTests.java +++ /dev/null @@ -1,28 +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.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.MaintenanceInner; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class MaintenanceInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MaintenanceInner model = BinaryData.fromString( - "{\"properties\":{\"maintenanceType\":\"HotFixes\",\"maintenanceState\":\"Canceled\",\"maintenanceStartTime\":\"2021-10-22T08:31:17Z\",\"maintenanceEndTime\":\"2021-04-26T06:25:06Z\",\"maintenanceExecutionStartTime\":\"2021-06-27T09:44:07Z\",\"maintenanceExecutionEndTime\":\"2020-12-26T11:46:04Z\",\"maintenanceAvailableScheduleMinTime\":\"2021-12-03T14:40:57Z\",\"maintenanceAvailableScheduleMaxTime\":\"2021-01-12T02:54:37Z\",\"maintenanceTitle\":\"sd\",\"maintenanceDescription\":\"kgtdlmkkze\",\"provisioningState\":\"Succeeded\"},\"id\":\"ewpusdsttwvogvb\",\"name\":\"ejdcngqqmoakuf\",\"type\":\"m\"}") - .toObject(MaintenanceInner.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-22T08:31:17Z"), model.maintenanceStartTime()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MaintenanceInner model - = new MaintenanceInner().withMaintenanceStartTime(OffsetDateTime.parse("2021-10-22T08:31:17Z")); - model = BinaryData.fromObject(model).toObject(MaintenanceInner.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-22T08:31:17Z"), model.maintenanceStartTime()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenanceListResultTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenanceListResultTests.java deleted file mode 100644 index 4425fe4f155fd..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenanceListResultTests.java +++ /dev/null @@ -1,39 +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.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.MaintenanceInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceListResult; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class MaintenanceListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MaintenanceListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"maintenanceType\":\"HotFixes\",\"maintenanceState\":\"Processing\",\"maintenanceStartTime\":\"2021-01-11T18:29:49Z\",\"maintenanceEndTime\":\"2021-05-05T04:42:21Z\",\"maintenanceExecutionStartTime\":\"2021-11-16T17:43:34Z\",\"maintenanceExecutionEndTime\":\"2021-10-01T14:51:14Z\",\"maintenanceAvailableScheduleMinTime\":\"2021-06-09T02:28:34Z\",\"maintenanceAvailableScheduleMaxTime\":\"2021-11-19T19:19:01Z\",\"maintenanceTitle\":\"cslfaoqzpiyylha\",\"maintenanceDescription\":\"swhccsphk\",\"provisioningState\":\"Deleting\"},\"id\":\"itqscywuggwoluhc\",\"name\":\"bwemhairs\",\"type\":\"rgzdwmsweyp\"},{\"properties\":{\"maintenanceType\":\"HotFixes\",\"maintenanceState\":\"Processing\",\"maintenanceStartTime\":\"2021-03-24T09:21:34Z\",\"maintenanceEndTime\":\"2021-06-20T03:34:36Z\",\"maintenanceExecutionStartTime\":\"2021-10-03T20:31:22Z\",\"maintenanceExecutionEndTime\":\"2021-07-21T16:23:57Z\",\"maintenanceAvailableScheduleMinTime\":\"2021-08-27T14:08:45Z\",\"maintenanceAvailableScheduleMaxTime\":\"2021-10-28T16:47:06Z\",\"maintenanceTitle\":\"ktt\",\"maintenanceDescription\":\"tvlz\",\"provisioningState\":\"Deleting\"},\"id\":\"hz\",\"name\":\"ncsdtclusiyp\",\"type\":\"sfgytguslfead\"},{\"properties\":{\"maintenanceType\":\"RoutineMaintenance\",\"maintenanceState\":\"Scheduled\",\"maintenanceStartTime\":\"2021-11-04T08:30:12Z\",\"maintenanceEndTime\":\"2021-01-09T07:06:25Z\",\"maintenanceExecutionStartTime\":\"2021-05-08T07:59:13Z\",\"maintenanceExecutionEndTime\":\"2021-10-20T10:25:57Z\",\"maintenanceAvailableScheduleMinTime\":\"2021-04-26T05:02:54Z\",\"maintenanceAvailableScheduleMaxTime\":\"2021-04-29T01:54:20Z\",\"maintenanceTitle\":\"elolppvksrpqvuj\",\"maintenanceDescription\":\"aehtwd\",\"provisioningState\":\"Failed\"},\"id\":\"swibyr\",\"name\":\"dl\",\"type\":\"h\"},{\"properties\":{\"maintenanceType\":\"SecurityPatches\",\"maintenanceState\":\"Completed\",\"maintenanceStartTime\":\"2021-02-07T05:20:31Z\",\"maintenanceEndTime\":\"2021-11-29T07:17:38Z\",\"maintenanceExecutionStartTime\":\"2021-05-02T16:38:33Z\",\"maintenanceExecutionEndTime\":\"2021-05-07T13:40:48Z\",\"maintenanceAvailableScheduleMinTime\":\"2021-01-15T14:57:40Z\",\"maintenanceAvailableScheduleMaxTime\":\"2021-10-09T17:15:47Z\",\"maintenanceTitle\":\"xccedcpnmdyodn\",\"maintenanceDescription\":\"xltjcvnhltiu\",\"provisioningState\":\"Creating\"},\"id\":\"avvwxqi\",\"name\":\"y\",\"type\":\"unyowxwl\"}],\"nextLink\":\"jrkvfgbvfvpdbo\"}") - .toObject(MaintenanceListResult.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-11T18:29:49Z"), - model.value().get(0).maintenanceStartTime()); - Assertions.assertEquals("jrkvfgbvfvpdbo", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MaintenanceListResult model = new MaintenanceListResult() - .withValue(Arrays.asList( - new MaintenanceInner().withMaintenanceStartTime(OffsetDateTime.parse("2021-01-11T18:29:49Z")), - new MaintenanceInner().withMaintenanceStartTime(OffsetDateTime.parse("2021-03-24T09:21:34Z")), - new MaintenanceInner().withMaintenanceStartTime(OffsetDateTime.parse("2021-11-04T08:30:12Z")), - new MaintenanceInner().withMaintenanceStartTime(OffsetDateTime.parse("2021-02-07T05:20:31Z")))) - .withNextLink("jrkvfgbvfvpdbo"); - model = BinaryData.fromObject(model).toObject(MaintenanceListResult.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-11T18:29:49Z"), - model.value().get(0).maintenanceStartTime()); - Assertions.assertEquals("jrkvfgbvfvpdbo", model.nextLink()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenancePropertiesForUpdateTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenancePropertiesForUpdateTests.java deleted file mode 100644 index 10493b5aae32b..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenancePropertiesForUpdateTests.java +++ /dev/null @@ -1,28 +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.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.MaintenancePropertiesForUpdate; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class MaintenancePropertiesForUpdateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MaintenancePropertiesForUpdate model - = BinaryData.fromString("{\"maintenanceStartTime\":\"2021-08-08T19:14:54Z\"}") - .toObject(MaintenancePropertiesForUpdate.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-08T19:14:54Z"), model.maintenanceStartTime()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MaintenancePropertiesForUpdate model = new MaintenancePropertiesForUpdate() - .withMaintenanceStartTime(OffsetDateTime.parse("2021-08-08T19:14:54Z")); - model = BinaryData.fromObject(model).toObject(MaintenancePropertiesForUpdate.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-08T19:14:54Z"), model.maintenanceStartTime()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenancePropertiesTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenancePropertiesTests.java deleted file mode 100644 index 885562eee52b8..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenancePropertiesTests.java +++ /dev/null @@ -1,28 +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.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.MaintenanceProperties; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class MaintenancePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MaintenanceProperties model = BinaryData.fromString( - "{\"maintenanceType\":\"RoutineMaintenance\",\"maintenanceState\":\"InPreparation\",\"maintenanceStartTime\":\"2021-12-02T23:57:11Z\",\"maintenanceEndTime\":\"2021-07-10T05:57:49Z\",\"maintenanceExecutionStartTime\":\"2021-03-20T15:57:26Z\",\"maintenanceExecutionEndTime\":\"2021-01-23T08:17:26Z\",\"maintenanceAvailableScheduleMinTime\":\"2021-01-12T08:45:26Z\",\"maintenanceAvailableScheduleMaxTime\":\"2021-05-21T20:17:09Z\",\"maintenanceTitle\":\"pbminr\",\"maintenanceDescription\":\"woyuhhziuief\",\"provisioningState\":\"Failed\"}") - .toObject(MaintenanceProperties.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-12-02T23:57:11Z"), model.maintenanceStartTime()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MaintenanceProperties model - = new MaintenanceProperties().withMaintenanceStartTime(OffsetDateTime.parse("2021-12-02T23:57:11Z")); - model = BinaryData.fromObject(model).toObject(MaintenanceProperties.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-12-02T23:57:11Z"), model.maintenanceStartTime()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenanceUpdateTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenanceUpdateTests.java deleted file mode 100644 index d9679a4fc56fa..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenanceUpdateTests.java +++ /dev/null @@ -1,28 +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.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceUpdate; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class MaintenanceUpdateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MaintenanceUpdate model - = BinaryData.fromString("{\"properties\":{\"maintenanceStartTime\":\"2021-02-07T20:29:27Z\"}}") - .toObject(MaintenanceUpdate.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-07T20:29:27Z"), model.maintenanceStartTime()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MaintenanceUpdate model - = new MaintenanceUpdate().withMaintenanceStartTime(OffsetDateTime.parse("2021-02-07T20:29:27Z")); - model = BinaryData.fromObject(model).toObject(MaintenanceUpdate.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-07T20:29:27Z"), model.maintenanceStartTime()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenanceWindowTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenanceWindowTests.java index 91d51869fa162..2a5f164e4c5f4 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenanceWindowTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenanceWindowTests.java @@ -12,24 +12,24 @@ public final class MaintenanceWindowTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { MaintenanceWindow model = BinaryData.fromString( - "{\"customWindow\":\"ae\",\"startHour\":1901274446,\"startMinute\":1111397810,\"dayOfWeek\":2101228547}") + "{\"customWindow\":\"ryrtihfxtijbpzv\",\"startHour\":1041467339,\"startMinute\":706884387,\"dayOfWeek\":2084129316}") .toObject(MaintenanceWindow.class); - Assertions.assertEquals("ae", model.customWindow()); - Assertions.assertEquals(1901274446, model.startHour()); - Assertions.assertEquals(1111397810, model.startMinute()); - Assertions.assertEquals(2101228547, model.dayOfWeek()); + Assertions.assertEquals("ryrtihfxtijbpzv", model.customWindow()); + Assertions.assertEquals(1041467339, model.startHour()); + Assertions.assertEquals(706884387, model.startMinute()); + Assertions.assertEquals(2084129316, model.dayOfWeek()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - MaintenanceWindow model = new MaintenanceWindow().withCustomWindow("ae") - .withStartHour(1901274446) - .withStartMinute(1111397810) - .withDayOfWeek(2101228547); + MaintenanceWindow model = new MaintenanceWindow().withCustomWindow("ryrtihfxtijbpzv") + .withStartHour(1041467339) + .withStartMinute(706884387) + .withDayOfWeek(2084129316); model = BinaryData.fromObject(model).toObject(MaintenanceWindow.class); - Assertions.assertEquals("ae", model.customWindow()); - Assertions.assertEquals(1901274446, model.startHour()); - Assertions.assertEquals(1111397810, model.startMinute()); - Assertions.assertEquals(2101228547, model.dayOfWeek()); + Assertions.assertEquals("ryrtihfxtijbpzv", model.customWindow()); + Assertions.assertEquals(1041467339, model.startHour()); + Assertions.assertEquals(706884387, model.startMinute()); + Assertions.assertEquals(2084129316, model.dayOfWeek()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenancesListMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenancesListMockTests.java deleted file mode 100644 index 9edc1e5ab6ce1..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenancesListMockTests.java +++ /dev/null @@ -1,40 +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.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.Maintenance; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class MaintenancesListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"maintenanceType\":\"MinorVersionUpgrade\",\"maintenanceState\":\"Canceled\",\"maintenanceStartTime\":\"2021-07-29T02:48:32Z\",\"maintenanceEndTime\":\"2021-06-25T00:42:10Z\",\"maintenanceExecutionStartTime\":\"2021-03-11T16:27:53Z\",\"maintenanceExecutionEndTime\":\"2021-08-25T02:28:28Z\",\"maintenanceAvailableScheduleMinTime\":\"2021-11-04T20:43:16Z\",\"maintenanceAvailableScheduleMaxTime\":\"2021-05-22T09:32:30Z\",\"maintenanceTitle\":\"slstvasy\",\"maintenanceDescription\":\"xdza\",\"provisioningState\":\"Failed\"},\"id\":\"oohgu\",\"name\":\"fuzboyjathwtzolb\",\"type\":\"emwmdxmebwjs\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MySqlManager manager = MySqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.maintenances().list("jpdn", "zhajoylhjlmuo", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(OffsetDateTime.parse("2021-07-29T02:48:32Z"), - response.iterator().next().maintenanceStartTime()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenancesReadWithResponseMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenancesReadWithResponseMockTests.java deleted file mode 100644 index 983d417bfbab6..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenancesReadWithResponseMockTests.java +++ /dev/null @@ -1,39 +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.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.Maintenance; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class MaintenancesReadWithResponseMockTests { - @Test - public void testReadWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"maintenanceType\":\"HotFixes\",\"maintenanceState\":\"Processing\",\"maintenanceStartTime\":\"2021-08-06T13:46:48Z\",\"maintenanceEndTime\":\"2021-09-29T04:01:44Z\",\"maintenanceExecutionStartTime\":\"2021-05-03T20:49:03Z\",\"maintenanceExecutionEndTime\":\"2020-12-21T07:15:21Z\",\"maintenanceAvailableScheduleMinTime\":\"2021-05-22T08:13:46Z\",\"maintenanceAvailableScheduleMaxTime\":\"2021-03-16T15:28:43Z\",\"maintenanceTitle\":\"qnsdfzpbgtgky\",\"maintenanceDescription\":\"dgh\",\"provisioningState\":\"Deleting\"},\"id\":\"utlwxezwzhok\",\"name\":\"bwnhhtql\",\"type\":\"ehgpp\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MySqlManager manager = MySqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Maintenance response = manager.maintenances() - .readWithResponse("nwm", "tmvpdvjdhtt", "a", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(OffsetDateTime.parse("2021-08-06T13:46:48Z"), response.maintenanceStartTime()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenancesUpdateMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenancesUpdateMockTests.java deleted file mode 100644 index 885c59197a066..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MaintenancesUpdateMockTests.java +++ /dev/null @@ -1,41 +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.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.Maintenance; -import com.azure.resourcemanager.mysqlflexibleserver.models.MaintenanceUpdate; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class MaintenancesUpdateMockTests { - @Test - public void testUpdate() throws Exception { - String responseStr - = "{\"properties\":{\"maintenanceType\":\"MinorVersionUpgrade\",\"maintenanceState\":\"Canceled\",\"maintenanceStartTime\":\"2021-09-19T13:00:06Z\",\"maintenanceEndTime\":\"2021-10-26T21:38:36Z\",\"maintenanceExecutionStartTime\":\"2021-09-01T22:04:46Z\",\"maintenanceExecutionEndTime\":\"2021-07-23T12:06:13Z\",\"maintenanceAvailableScheduleMinTime\":\"2021-06-29T04:06:59Z\",\"maintenanceAvailableScheduleMaxTime\":\"2021-04-05T10:55:26Z\",\"maintenanceTitle\":\"ucb\",\"maintenanceDescription\":\"tgdqohmcwsldriz\",\"provisioningState\":\"Succeeded\"},\"id\":\"bra\",\"name\":\"llibphbqzmizak\",\"type\":\"kan\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MySqlManager manager = MySqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Maintenance response = manager.maintenances() - .update("pifhpfeoajvgcxtx", "csheafidltugsr", "smkss", - new MaintenanceUpdate().withMaintenanceStartTime(OffsetDateTime.parse("2021-07-01T11:45:20Z")), - com.azure.core.util.Context.NONE); - - Assertions.assertEquals(OffsetDateTime.parse("2021-09-19T13:00:06Z"), response.maintenanceStartTime()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MySqlServerSkuTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MySqlServerSkuTests.java deleted file mode 100644 index 0cb6310db1ea9..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/MySqlServerSkuTests.java +++ /dev/null @@ -1,28 +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.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.MySqlServerSku; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerSkuTier; -import org.junit.jupiter.api.Assertions; - -public final class MySqlServerSkuTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MySqlServerSku model = BinaryData.fromString("{\"name\":\"enjbdlwtgrhp\",\"tier\":\"GeneralPurpose\"}") - .toObject(MySqlServerSku.class); - Assertions.assertEquals("enjbdlwtgrhp", model.name()); - Assertions.assertEquals(ServerSkuTier.GENERAL_PURPOSE, model.tier()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MySqlServerSku model = new MySqlServerSku().withName("enjbdlwtgrhp").withTier(ServerSkuTier.GENERAL_PURPOSE); - model = BinaryData.fromObject(model).toObject(MySqlServerSku.class); - Assertions.assertEquals("enjbdlwtgrhp", model.name()); - Assertions.assertEquals(ServerSkuTier.GENERAL_PURPOSE, model.tier()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/NameAvailabilityInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/NameAvailabilityInnerTests.java index 5d5d919bed207..a9986676fa5cd 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/NameAvailabilityInnerTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/NameAvailabilityInnerTests.java @@ -12,20 +12,20 @@ public final class NameAvailabilityInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { NameAvailabilityInner model - = BinaryData.fromString("{\"message\":\"imfnjhfjx\",\"nameAvailable\":true,\"reason\":\"kkfoqr\"}") + = BinaryData.fromString("{\"message\":\"attpngjcrcczsq\",\"nameAvailable\":true,\"reason\":\"mdajv\"}") .toObject(NameAvailabilityInner.class); - Assertions.assertEquals("imfnjhfjx", model.message()); + Assertions.assertEquals("attpngjcrcczsq", model.message()); Assertions.assertEquals(true, model.nameAvailable()); - Assertions.assertEquals("kkfoqr", model.reason()); + Assertions.assertEquals("mdajv", model.reason()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { NameAvailabilityInner model - = new NameAvailabilityInner().withMessage("imfnjhfjx").withNameAvailable(true).withReason("kkfoqr"); + = new NameAvailabilityInner().withMessage("attpngjcrcczsq").withNameAvailable(true).withReason("mdajv"); model = BinaryData.fromObject(model).toObject(NameAvailabilityInner.class); - Assertions.assertEquals("imfnjhfjx", model.message()); + Assertions.assertEquals("attpngjcrcczsq", model.message()); Assertions.assertEquals(true, model.nameAvailable()); - Assertions.assertEquals("kkfoqr", model.reason()); + Assertions.assertEquals("mdajv", model.reason()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/NameAvailabilityRequestTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/NameAvailabilityRequestTests.java index 1f11aa80dc9ac..ee624a88a2b07 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/NameAvailabilityRequestTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/NameAvailabilityRequestTests.java @@ -11,17 +11,17 @@ public final class NameAvailabilityRequestTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - NameAvailabilityRequest model = BinaryData.fromString("{\"name\":\"epxgyqagvr\",\"type\":\"npkukghimdblx\"}") - .toObject(NameAvailabilityRequest.class); - Assertions.assertEquals("epxgyqagvr", model.name()); - Assertions.assertEquals("npkukghimdblx", model.type()); + NameAvailabilityRequest model + = BinaryData.fromString("{\"name\":\"qsl\",\"type\":\"yvxyqjp\"}").toObject(NameAvailabilityRequest.class); + Assertions.assertEquals("qsl", model.name()); + Assertions.assertEquals("yvxyqjp", model.type()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - NameAvailabilityRequest model = new NameAvailabilityRequest().withName("epxgyqagvr").withType("npkukghimdblx"); + NameAvailabilityRequest model = new NameAvailabilityRequest().withName("qsl").withType("yvxyqjp"); model = BinaryData.fromObject(model).toObject(NameAvailabilityRequest.class); - Assertions.assertEquals("epxgyqagvr", model.name()); - Assertions.assertEquals("npkukghimdblx", model.type()); + Assertions.assertEquals("qsl", model.name()); + Assertions.assertEquals("yvxyqjp", model.type()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/NetworkTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/NetworkTests.java index 66759c9b36941..3fbd9a3737201 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/NetworkTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/NetworkTests.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.mysqlflexibleserver.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.EnableStatusEnum; import com.azure.resourcemanager.mysqlflexibleserver.models.Network; import org.junit.jupiter.api.Assertions; @@ -13,21 +12,18 @@ public final class NetworkTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { Network model = BinaryData.fromString( - "{\"publicNetworkAccess\":\"Disabled\",\"delegatedSubnetResourceId\":\"snzwd\",\"privateDnsZoneResourceId\":\"bavo\"}") + "{\"publicNetworkAccess\":\"Enabled\",\"delegatedSubnetResourceId\":\"zdxtayrlhmwhf\",\"privateDnsZoneResourceId\":\"rqobmtuk\"}") .toObject(Network.class); - Assertions.assertEquals(EnableStatusEnum.DISABLED, model.publicNetworkAccess()); - Assertions.assertEquals("snzwd", model.delegatedSubnetResourceId()); - Assertions.assertEquals("bavo", model.privateDnsZoneResourceId()); + Assertions.assertEquals("zdxtayrlhmwhf", model.delegatedSubnetResourceId()); + Assertions.assertEquals("rqobmtuk", model.privateDnsZoneResourceId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - Network model = new Network().withPublicNetworkAccess(EnableStatusEnum.DISABLED) - .withDelegatedSubnetResourceId("snzwd") - .withPrivateDnsZoneResourceId("bavo"); + Network model + = new Network().withDelegatedSubnetResourceId("zdxtayrlhmwhf").withPrivateDnsZoneResourceId("rqobmtuk"); model = BinaryData.fromObject(model).toObject(Network.class); - Assertions.assertEquals(EnableStatusEnum.DISABLED, model.publicNetworkAccess()); - Assertions.assertEquals("snzwd", model.delegatedSubnetResourceId()); - Assertions.assertEquals("bavo", model.privateDnsZoneResourceId()); + Assertions.assertEquals("zdxtayrlhmwhf", model.delegatedSubnetResourceId()); + Assertions.assertEquals("rqobmtuk", model.privateDnsZoneResourceId()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationDisplayTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationDisplayTests.java index c779fb0d2dfd7..ea811568e3069 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationDisplayTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationDisplayTests.java @@ -12,24 +12,24 @@ public final class OperationDisplayTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OperationDisplay model = BinaryData.fromString( - "{\"provider\":\"wtl\",\"resource\":\"guxawqaldsyuuxi\",\"operation\":\"rqf\",\"description\":\"wyznkbyku\"}") + "{\"provider\":\"wkuofoskghsauu\",\"resource\":\"jmvxie\",\"operation\":\"ugidyjrr\",\"description\":\"y\"}") .toObject(OperationDisplay.class); - Assertions.assertEquals("wtl", model.provider()); - Assertions.assertEquals("guxawqaldsyuuxi", model.resource()); - Assertions.assertEquals("rqf", model.operation()); - Assertions.assertEquals("wyznkbyku", model.description()); + Assertions.assertEquals("wkuofoskghsauu", model.provider()); + Assertions.assertEquals("jmvxie", model.resource()); + Assertions.assertEquals("ugidyjrr", model.operation()); + Assertions.assertEquals("y", model.description()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - OperationDisplay model = new OperationDisplay().withProvider("wtl") - .withResource("guxawqaldsyuuxi") - .withOperation("rqf") - .withDescription("wyznkbyku"); + OperationDisplay model = new OperationDisplay().withProvider("wkuofoskghsauu") + .withResource("jmvxie") + .withOperation("ugidyjrr") + .withDescription("y"); model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - Assertions.assertEquals("wtl", model.provider()); - Assertions.assertEquals("guxawqaldsyuuxi", model.resource()); - Assertions.assertEquals("rqf", model.operation()); - Assertions.assertEquals("wyznkbyku", model.description()); + Assertions.assertEquals("wkuofoskghsauu", model.provider()); + Assertions.assertEquals("jmvxie", model.resource()); + Assertions.assertEquals("ugidyjrr", model.operation()); + Assertions.assertEquals("y", model.description()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationInnerTests.java index 21b9429a157ff..e6507813cb7ee 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationInnerTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationInnerTests.java @@ -15,33 +15,33 @@ public final class OperationInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OperationInner model = BinaryData.fromString( - "{\"name\":\"puqujmqlgkfbtn\",\"display\":{\"provider\":\"ongbjcnt\",\"resource\":\"i\",\"operation\":\"jed\",\"description\":\"wwa\"},\"origin\":\"kojvd\",\"properties\":{\"rzgszufoxci\":\"datafoqouicybx\",\"haz\":\"dataopidoamciodh\",\"toego\":\"datakhnzbonlw\",\"vbtqgsfraoyzk\":\"datadwbwhkszzcmrvexz\"}}") + "{\"name\":\"ys\",\"display\":{\"provider\":\"iuxhqyudxorr\",\"resource\":\"b\",\"operation\":\"czvyifq\",\"description\":\"kdvjsll\"},\"origin\":\"vvdfwatkpnpul\",\"properties\":{\"ruwiqzbqjvsov\":\"databczw\",\"hzdobpxjmflbvvnc\":\"datayokacspkw\",\"rsa\":\"datarkcciwwzjuqk\"}}") .toObject(OperationInner.class); - Assertions.assertEquals("puqujmqlgkfbtn", model.name()); - Assertions.assertEquals("ongbjcnt", model.display().provider()); - Assertions.assertEquals("i", model.display().resource()); - Assertions.assertEquals("jed", model.display().operation()); - Assertions.assertEquals("wwa", model.display().description()); - Assertions.assertEquals("kojvd", model.origin()); + Assertions.assertEquals("ys", model.name()); + Assertions.assertEquals("iuxhqyudxorr", model.display().provider()); + Assertions.assertEquals("b", model.display().resource()); + Assertions.assertEquals("czvyifq", model.display().operation()); + Assertions.assertEquals("kdvjsll", model.display().description()); + Assertions.assertEquals("vvdfwatkpnpul", model.origin()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - OperationInner model = new OperationInner().withName("puqujmqlgkfbtn") - .withDisplay(new OperationDisplay().withProvider("ongbjcnt") - .withResource("i") - .withOperation("jed") - .withDescription("wwa")) - .withOrigin("kojvd") - .withProperties(mapOf("rzgszufoxci", "datafoqouicybx", "haz", "dataopidoamciodh", "toego", "datakhnzbonlw", - "vbtqgsfraoyzk", "datadwbwhkszzcmrvexz")); + OperationInner model = new OperationInner().withName("ys") + .withDisplay(new OperationDisplay().withProvider("iuxhqyudxorr") + .withResource("b") + .withOperation("czvyifq") + .withDescription("kdvjsll")) + .withOrigin("vvdfwatkpnpul") + .withProperties( + mapOf("ruwiqzbqjvsov", "databczw", "hzdobpxjmflbvvnc", "datayokacspkw", "rsa", "datarkcciwwzjuqk")); model = BinaryData.fromObject(model).toObject(OperationInner.class); - Assertions.assertEquals("puqujmqlgkfbtn", model.name()); - Assertions.assertEquals("ongbjcnt", model.display().provider()); - Assertions.assertEquals("i", model.display().resource()); - Assertions.assertEquals("jed", model.display().operation()); - Assertions.assertEquals("wwa", model.display().description()); - Assertions.assertEquals("kojvd", model.origin()); + Assertions.assertEquals("ys", model.name()); + Assertions.assertEquals("iuxhqyudxorr", model.display().provider()); + Assertions.assertEquals("b", model.display().resource()); + Assertions.assertEquals("czvyifq", model.display().operation()); + Assertions.assertEquals("kdvjsll", model.display().description()); + Assertions.assertEquals("vvdfwatkpnpul", model.origin()); } // Use "Map.of" if available diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationListResultTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationListResultTests.java index 41305c35415c0..9662b875c5fbc 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationListResultTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationListResultTests.java @@ -17,35 +17,35 @@ public final class OperationListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OperationListResult model = BinaryData.fromString( - "{\"value\":[{\"name\":\"bvtvudutncormr\",\"display\":{\"provider\":\"tvcof\",\"resource\":\"f\",\"operation\":\"kgjubgdknnqvsazn\",\"description\":\"tor\"},\"origin\":\"sgsahmkycgr\",\"properties\":{\"vdmovsmzlxwabm\":\"datajuetaebur\"}}],\"nextLink\":\"efkifr\"}") + "{\"value\":[{\"name\":\"hltrpmopjmcmatuo\",\"display\":{\"provider\":\"fu\",\"resource\":\"aodsfcpkv\",\"operation\":\"dpuozmyz\",\"description\":\"agfuaxbezyiu\"},\"origin\":\"ktwh\",\"properties\":{\"wqsmbsur\":\"datawz\"}}],\"nextLink\":\"imoryocfsfksym\"}") .toObject(OperationListResult.class); - Assertions.assertEquals("bvtvudutncormr", model.value().get(0).name()); - Assertions.assertEquals("tvcof", model.value().get(0).display().provider()); - Assertions.assertEquals("f", model.value().get(0).display().resource()); - Assertions.assertEquals("kgjubgdknnqvsazn", model.value().get(0).display().operation()); - Assertions.assertEquals("tor", model.value().get(0).display().description()); - Assertions.assertEquals("sgsahmkycgr", model.value().get(0).origin()); - Assertions.assertEquals("efkifr", model.nextLink()); + Assertions.assertEquals("hltrpmopjmcmatuo", model.value().get(0).name()); + Assertions.assertEquals("fu", model.value().get(0).display().provider()); + Assertions.assertEquals("aodsfcpkv", model.value().get(0).display().resource()); + Assertions.assertEquals("dpuozmyz", model.value().get(0).display().operation()); + Assertions.assertEquals("agfuaxbezyiu", model.value().get(0).display().description()); + Assertions.assertEquals("ktwh", model.value().get(0).origin()); + Assertions.assertEquals("imoryocfsfksym", model.nextLink()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { OperationListResult model - = new OperationListResult().withValue(Arrays.asList(new OperationInner().withName("bvtvudutncormr") - .withDisplay(new OperationDisplay().withProvider("tvcof") - .withResource("f") - .withOperation("kgjubgdknnqvsazn") - .withDescription("tor")) - .withOrigin("sgsahmkycgr") - .withProperties(mapOf("vdmovsmzlxwabm", "datajuetaebur")))).withNextLink("efkifr"); + = new OperationListResult().withValue(Arrays.asList(new OperationInner().withName("hltrpmopjmcmatuo") + .withDisplay(new OperationDisplay().withProvider("fu") + .withResource("aodsfcpkv") + .withOperation("dpuozmyz") + .withDescription("agfuaxbezyiu")) + .withOrigin("ktwh") + .withProperties(mapOf("wqsmbsur", "datawz")))).withNextLink("imoryocfsfksym"); model = BinaryData.fromObject(model).toObject(OperationListResult.class); - Assertions.assertEquals("bvtvudutncormr", model.value().get(0).name()); - Assertions.assertEquals("tvcof", model.value().get(0).display().provider()); - Assertions.assertEquals("f", model.value().get(0).display().resource()); - Assertions.assertEquals("kgjubgdknnqvsazn", model.value().get(0).display().operation()); - Assertions.assertEquals("tor", model.value().get(0).display().description()); - Assertions.assertEquals("sgsahmkycgr", model.value().get(0).origin()); - Assertions.assertEquals("efkifr", model.nextLink()); + Assertions.assertEquals("hltrpmopjmcmatuo", model.value().get(0).name()); + Assertions.assertEquals("fu", model.value().get(0).display().provider()); + Assertions.assertEquals("aodsfcpkv", model.value().get(0).display().resource()); + Assertions.assertEquals("dpuozmyz", model.value().get(0).display().operation()); + Assertions.assertEquals("agfuaxbezyiu", model.value().get(0).display().description()); + Assertions.assertEquals("ktwh", model.value().get(0).origin()); + Assertions.assertEquals("imoryocfsfksym", model.nextLink()); } // Use "Map.of" if available diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationProgressResponseTypeTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationProgressResponseTypeTests.java deleted file mode 100644 index 0aea736933d9e..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationProgressResponseTypeTests.java +++ /dev/null @@ -1,23 +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.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.OperationProgressResponseType; - -public final class OperationProgressResponseTypeTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationProgressResponseType model - = BinaryData.fromString("{\"objectType\":\"OperationProgressResponseType\"}") - .toObject(OperationProgressResponseType.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationProgressResponseType model = new OperationProgressResponseType(); - model = BinaryData.fromObject(model).toObject(OperationProgressResponseType.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationsListMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationsListMockTests.java index 224dc299e04df..a267c54bc1f71 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationsListMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/OperationsListMockTests.java @@ -22,7 +22,7 @@ public final class OperationsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"name\":\"sftufqobrjlna\",\"display\":{\"provider\":\"ckknhxkizvy\",\"resource\":\"rzvul\",\"operation\":\"aaeranokqgukk\",\"description\":\"nvbroylaxx\"},\"origin\":\"cdisd\",\"properties\":{\"yvycytdclxgcckn\":\"datajbjsvgjrwh\"}}]}"; + = "{\"value\":[{\"name\":\"iexpbtgiwbwo\",\"display\":{\"provider\":\"ashrt\",\"resource\":\"kcnqxwbpo\",\"operation\":\"lpiujwaa\",\"description\":\"pqiiobyuqe\"},\"origin\":\"qlpqwcciuq\",\"properties\":{\"kuwhh\":\"databutauvfb\",\"koymkcd\":\"datahykojoxafnndlpic\",\"pkkpw\":\"datah\",\"jxywsuws\":\"datareqnovvqfov\"}}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -33,11 +33,11 @@ public void testList() throws Exception { PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); - Assertions.assertEquals("sftufqobrjlna", response.iterator().next().name()); - Assertions.assertEquals("ckknhxkizvy", response.iterator().next().display().provider()); - Assertions.assertEquals("rzvul", response.iterator().next().display().resource()); - Assertions.assertEquals("aaeranokqgukk", response.iterator().next().display().operation()); - Assertions.assertEquals("nvbroylaxx", response.iterator().next().display().description()); - Assertions.assertEquals("cdisd", response.iterator().next().origin()); + Assertions.assertEquals("iexpbtgiwbwo", response.iterator().next().name()); + Assertions.assertEquals("ashrt", response.iterator().next().display().provider()); + Assertions.assertEquals("kcnqxwbpo", response.iterator().next().display().resource()); + Assertions.assertEquals("lpiujwaa", response.iterator().next().display().operation()); + Assertions.assertEquals("pqiiobyuqe", response.iterator().next().display().description()); + Assertions.assertEquals("qlpqwcciuq", response.iterator().next().origin()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateEndpointConnectionPropertiesTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateEndpointConnectionPropertiesTests.java deleted file mode 100644 index 95d2e8c72f679..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateEndpointConnectionPropertiesTests.java +++ /dev/null @@ -1,40 +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.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.PrivateEndpointConnectionProperties; -import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpoint; -import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateLinkServiceConnectionState; -import org.junit.jupiter.api.Assertions; - -public final class PrivateEndpointConnectionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateEndpointConnectionProperties model = BinaryData.fromString( - "{\"groupIds\":[\"dectehfiqsc\",\"eypvhezrkg\",\"hcjrefovgmk\",\"sle\"],\"privateEndpoint\":{\"id\":\"xyqj\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"t\",\"actionsRequired\":\"ngj\"},\"provisioningState\":\"Creating\"}") - .toObject(PrivateEndpointConnectionProperties.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.REJECTED, - model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("t", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("ngj", model.privateLinkServiceConnectionState().actionsRequired()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpointConnectionProperties model - = new PrivateEndpointConnectionProperties().withPrivateEndpoint(new PrivateEndpoint()) - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.REJECTED) - .withDescription("t") - .withActionsRequired("ngj")); - model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionProperties.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.REJECTED, - model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("t", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("ngj", model.privateLinkServiceConnectionState().actionsRequired()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateEndpointConnectionTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateEndpointConnectionTests.java deleted file mode 100644 index 5a674b4315c13..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateEndpointConnectionTests.java +++ /dev/null @@ -1,39 +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.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpoint; -import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpointConnection; -import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateLinkServiceConnectionState; -import org.junit.jupiter.api.Assertions; - -public final class PrivateEndpointConnectionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateEndpointConnection model = BinaryData.fromString( - "{\"properties\":{\"groupIds\":[\"mohctb\"],\"privateEndpoint\":{\"id\":\"dwxdndnv\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"jjugwdkcglhslaz\",\"actionsRequired\":\"yggdtjixh\"},\"provisioningState\":\"Creating\"},\"id\":\"fqweykhmene\",\"name\":\"fyexfwhy\",\"type\":\"cibvyvdcsitynn\"}") - .toObject(PrivateEndpointConnection.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, - model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("jjugwdkcglhslaz", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("yggdtjixh", model.privateLinkServiceConnectionState().actionsRequired()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpointConnection model = new PrivateEndpointConnection().withPrivateEndpoint(new PrivateEndpoint()) - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) - .withDescription("jjugwdkcglhslaz") - .withActionsRequired("yggdtjixh")); - model = BinaryData.fromObject(model).toObject(PrivateEndpointConnection.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, - model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("jjugwdkcglhslaz", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("yggdtjixh", model.privateLinkServiceConnectionState().actionsRequired()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateEndpointTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateEndpointTests.java deleted file mode 100644 index 1975423089920..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateEndpointTests.java +++ /dev/null @@ -1,21 +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.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpoint; - -public final class PrivateEndpointTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateEndpoint model = BinaryData.fromString("{\"id\":\"zsqpjhvmdajvny\"}").toObject(PrivateEndpoint.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpoint model = new PrivateEndpoint(); - model = BinaryData.fromObject(model).toObject(PrivateEndpoint.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateLinkServiceConnectionStateTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateLinkServiceConnectionStateTests.java deleted file mode 100644 index 830a14a9c3c53..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/PrivateLinkServiceConnectionStateTests.java +++ /dev/null @@ -1,34 +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.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.mysqlflexibleserver.models.PrivateLinkServiceConnectionState; -import org.junit.jupiter.api.Assertions; - -public final class PrivateLinkServiceConnectionStateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkServiceConnectionState model - = BinaryData.fromString("{\"status\":\"Approved\",\"description\":\"q\",\"actionsRequired\":\"a\"}") - .toObject(PrivateLinkServiceConnectionState.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, model.status()); - Assertions.assertEquals("q", model.description()); - Assertions.assertEquals("a", model.actionsRequired()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkServiceConnectionState model - = new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) - .withDescription("q") - .withActionsRequired("a"); - model = BinaryData.fromObject(model).toObject(PrivateLinkServiceConnectionState.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, model.status()); - Assertions.assertEquals("q", model.description()); - Assertions.assertEquals("a", model.actionsRequired()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupInnerTests.java index 1f94502176b25..8a80f52278f9d 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupInnerTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupInnerTests.java @@ -13,21 +13,21 @@ public final class ServerBackupInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ServerBackupInner model = BinaryData.fromString( - "{\"properties\":{\"backupType\":\"ouajpsqucmpoyf\",\"completedTime\":\"2021-02-06T21:08:58Z\",\"source\":\"gknygjofjddeqs\"},\"id\":\"eupewnwreitjz\",\"name\":\"flusarhmof\",\"type\":\"qhsmyurkdtml\"}") + "{\"properties\":{\"backupType\":\"dpvwryoqpsoaccta\",\"completedTime\":\"2021-06-15T10:03:50Z\",\"source\":\"j\"},\"id\":\"hbcryffdfdosyge\",\"name\":\"paojakhmsbzjh\",\"type\":\"rzevdphlxaol\"}") .toObject(ServerBackupInner.class); - Assertions.assertEquals("ouajpsqucmpoyf", model.backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-06T21:08:58Z"), model.completedTime()); - Assertions.assertEquals("gknygjofjddeqs", model.source()); + Assertions.assertEquals("dpvwryoqpsoaccta", model.backupType()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-15T10:03:50Z"), model.completedTime()); + Assertions.assertEquals("j", model.source()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ServerBackupInner model = new ServerBackupInner().withBackupType("ouajpsqucmpoyf") - .withCompletedTime(OffsetDateTime.parse("2021-02-06T21:08:58Z")) - .withSource("gknygjofjddeqs"); + ServerBackupInner model = new ServerBackupInner().withBackupType("dpvwryoqpsoaccta") + .withCompletedTime(OffsetDateTime.parse("2021-06-15T10:03:50Z")) + .withSource("j"); model = BinaryData.fromObject(model).toObject(ServerBackupInner.class); - Assertions.assertEquals("ouajpsqucmpoyf", model.backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-06T21:08:58Z"), model.completedTime()); - Assertions.assertEquals("gknygjofjddeqs", model.source()); + Assertions.assertEquals("dpvwryoqpsoaccta", model.backupType()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-15T10:03:50Z"), model.completedTime()); + Assertions.assertEquals("j", model.source()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupListResultTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupListResultTests.java index ace97346ede5d..3a4db45003ee7 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupListResultTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupListResultTests.java @@ -15,34 +15,28 @@ public final class ServerBackupListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ServerBackupListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"backupType\":\"t\",\"completedTime\":\"2021-02-24T11:34:50Z\",\"source\":\"hmwhfpmrqo\"},\"id\":\"tu\",\"name\":\"knryrtihfxtij\",\"type\":\"pzvgnwzsymglzufc\"},{\"properties\":{\"backupType\":\"ohdbihanufh\",\"completedTime\":\"2021-01-11T10:02:32Z\",\"source\":\"y\"},\"id\":\"git\",\"name\":\"xqhabi\",\"type\":\"pikxwczbyscnpqxu\"},{\"properties\":{\"backupType\":\"y\",\"completedTime\":\"2021-06-17T16:29:35Z\",\"source\":\"b\"},\"id\":\"rkxvdum\",\"name\":\"grtfwvu\",\"type\":\"xgaudccs\"},{\"properties\":{\"backupType\":\"jcny\",\"completedTime\":\"2021-04-04T05:13:51Z\",\"source\":\"ryhtnapczwlokjy\"},\"id\":\"kkvnipjox\",\"name\":\"jnchgej\",\"type\":\"podmailzydehojwy\"}],\"nextLink\":\"uxinpmqnjaq\"}") + "{\"value\":[{\"properties\":{\"backupType\":\"peqfpjkjl\",\"completedTime\":\"2021-11-24T18:52:18Z\",\"source\":\"dvhpfxxypininm\"},\"id\":\"huyb\",\"name\":\"kpode\",\"type\":\"ooginuvamih\"},{\"properties\":{\"backupType\":\"narxzxtheotus\",\"completedTime\":\"2021-05-22T18:50:21Z\",\"source\":\"v\"},\"id\":\"iqihn\",\"name\":\"un\",\"type\":\"bwjzr\"}],\"nextLink\":\"ygxgispemvtz\"}") .toObject(ServerBackupListResult.class); - Assertions.assertEquals("t", model.value().get(0).backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-24T11:34:50Z"), model.value().get(0).completedTime()); - Assertions.assertEquals("hmwhfpmrqo", model.value().get(0).source()); - Assertions.assertEquals("uxinpmqnjaq", model.nextLink()); + Assertions.assertEquals("peqfpjkjl", model.value().get(0).backupType()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-24T18:52:18Z"), model.value().get(0).completedTime()); + Assertions.assertEquals("dvhpfxxypininm", model.value().get(0).source()); + Assertions.assertEquals("ygxgispemvtz", model.nextLink()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ServerBackupListResult model = new ServerBackupListResult().withValue(Arrays.asList( - new ServerBackupInner().withBackupType("t") - .withCompletedTime(OffsetDateTime.parse("2021-02-24T11:34:50Z")) - .withSource("hmwhfpmrqo"), - new ServerBackupInner().withBackupType("ohdbihanufh") - .withCompletedTime(OffsetDateTime.parse("2021-01-11T10:02:32Z")) - .withSource("y"), - new ServerBackupInner().withBackupType("y") - .withCompletedTime(OffsetDateTime.parse("2021-06-17T16:29:35Z")) - .withSource("b"), - new ServerBackupInner().withBackupType("jcny") - .withCompletedTime(OffsetDateTime.parse("2021-04-04T05:13:51Z")) - .withSource("ryhtnapczwlokjy"))) - .withNextLink("uxinpmqnjaq"); + new ServerBackupInner().withBackupType("peqfpjkjl") + .withCompletedTime(OffsetDateTime.parse("2021-11-24T18:52:18Z")) + .withSource("dvhpfxxypininm"), + new ServerBackupInner().withBackupType("narxzxtheotus") + .withCompletedTime(OffsetDateTime.parse("2021-05-22T18:50:21Z")) + .withSource("v"))) + .withNextLink("ygxgispemvtz"); model = BinaryData.fromObject(model).toObject(ServerBackupListResult.class); - Assertions.assertEquals("t", model.value().get(0).backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-24T11:34:50Z"), model.value().get(0).completedTime()); - Assertions.assertEquals("hmwhfpmrqo", model.value().get(0).source()); - Assertions.assertEquals("uxinpmqnjaq", model.nextLink()); + Assertions.assertEquals("peqfpjkjl", model.value().get(0).backupType()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-24T18:52:18Z"), model.value().get(0).completedTime()); + Assertions.assertEquals("dvhpfxxypininm", model.value().get(0).source()); + Assertions.assertEquals("ygxgispemvtz", model.nextLink()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupPropertiesTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupPropertiesTests.java index a38a1940c916f..976582df54bfb 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupPropertiesTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupPropertiesTests.java @@ -12,23 +12,22 @@ public final class ServerBackupPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ServerBackupProperties model = BinaryData - .fromString( - "{\"backupType\":\"ekuksjtx\",\"completedTime\":\"2021-01-21T08:28Z\",\"source\":\"mparcryuanzw\"}") + ServerBackupProperties model = BinaryData.fromString( + "{\"backupType\":\"qtrgqjbpfzfsinzg\",\"completedTime\":\"2021-07-30T11:45:35Z\",\"source\":\"rwzoxxjtfelluwf\"}") .toObject(ServerBackupProperties.class); - Assertions.assertEquals("ekuksjtx", model.backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-21T08:28Z"), model.completedTime()); - Assertions.assertEquals("mparcryuanzw", model.source()); + Assertions.assertEquals("qtrgqjbpfzfsinzg", model.backupType()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-30T11:45:35Z"), model.completedTime()); + Assertions.assertEquals("rwzoxxjtfelluwf", model.source()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ServerBackupProperties model = new ServerBackupProperties().withBackupType("ekuksjtx") - .withCompletedTime(OffsetDateTime.parse("2021-01-21T08:28Z")) - .withSource("mparcryuanzw"); + ServerBackupProperties model = new ServerBackupProperties().withBackupType("qtrgqjbpfzfsinzg") + .withCompletedTime(OffsetDateTime.parse("2021-07-30T11:45:35Z")) + .withSource("rwzoxxjtfelluwf"); model = BinaryData.fromObject(model).toObject(ServerBackupProperties.class); - Assertions.assertEquals("ekuksjtx", model.backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-21T08:28Z"), model.completedTime()); - Assertions.assertEquals("mparcryuanzw", model.source()); + Assertions.assertEquals("qtrgqjbpfzfsinzg", model.backupType()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-30T11:45:35Z"), model.completedTime()); + Assertions.assertEquals("rwzoxxjtfelluwf", model.source()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupPropertiesV2Tests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupPropertiesV2Tests.java deleted file mode 100644 index 7835b4248a076..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupPropertiesV2Tests.java +++ /dev/null @@ -1,37 +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.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerBackupPropertiesV2; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupType; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class ServerBackupPropertiesV2Tests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServerBackupPropertiesV2 model = BinaryData.fromString( - "{\"backupNameV2\":\"fziton\",\"backupType\":\"FULL\",\"completedTime\":\"2021-10-07T16:40:01Z\",\"source\":\"kjlxofpdvhpf\",\"provisioningState\":\"Canceled\"}") - .toObject(ServerBackupPropertiesV2.class); - Assertions.assertEquals("fziton", model.backupNameV2()); - Assertions.assertEquals(BackupType.FULL, model.backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-07T16:40:01Z"), model.completedTime()); - Assertions.assertEquals("kjlxofpdvhpf", model.source()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServerBackupPropertiesV2 model = new ServerBackupPropertiesV2().withBackupNameV2("fziton") - .withBackupType(BackupType.FULL) - .withCompletedTime(OffsetDateTime.parse("2021-10-07T16:40:01Z")) - .withSource("kjlxofpdvhpf"); - model = BinaryData.fromObject(model).toObject(ServerBackupPropertiesV2.class); - Assertions.assertEquals("fziton", model.backupNameV2()); - Assertions.assertEquals(BackupType.FULL, model.backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-07T16:40:01Z"), model.completedTime()); - Assertions.assertEquals("kjlxofpdvhpf", model.source()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupV2InnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupV2InnerTests.java deleted file mode 100644 index d9e60b84b397c..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupV2InnerTests.java +++ /dev/null @@ -1,37 +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.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerBackupV2Inner; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupType; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class ServerBackupV2InnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServerBackupV2Inner model = BinaryData.fromString( - "{\"properties\":{\"backupNameV2\":\"hmsbzjhcrzevdp\",\"backupType\":\"FULL\",\"completedTime\":\"2021-05-28T12:04:46Z\",\"source\":\"thqt\",\"provisioningState\":\"Failed\"},\"id\":\"bpf\",\"name\":\"fsinzgvfcjrwzoxx\",\"type\":\"tfell\"}") - .toObject(ServerBackupV2Inner.class); - Assertions.assertEquals("hmsbzjhcrzevdp", model.backupNameV2()); - Assertions.assertEquals(BackupType.FULL, model.backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-28T12:04:46Z"), model.completedTime()); - Assertions.assertEquals("thqt", model.source()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServerBackupV2Inner model = new ServerBackupV2Inner().withBackupNameV2("hmsbzjhcrzevdp") - .withBackupType(BackupType.FULL) - .withCompletedTime(OffsetDateTime.parse("2021-05-28T12:04:46Z")) - .withSource("thqt"); - model = BinaryData.fromObject(model).toObject(ServerBackupV2Inner.class); - Assertions.assertEquals("hmsbzjhcrzevdp", model.backupNameV2()); - Assertions.assertEquals(BackupType.FULL, model.backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-28T12:04:46Z"), model.completedTime()); - Assertions.assertEquals("thqt", model.source()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupV2ListResultTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupV2ListResultTests.java deleted file mode 100644 index 8026d3de1a5a3..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerBackupV2ListResultTests.java +++ /dev/null @@ -1,47 +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.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ServerBackupV2Inner; -import com.azure.resourcemanager.mysqlflexibleserver.models.BackupType; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerBackupV2ListResult; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ServerBackupV2ListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServerBackupV2ListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"backupNameV2\":\"nmayhuybb\",\"backupType\":\"FULL\",\"completedTime\":\"2021-04-30T05:44:17Z\",\"source\":\"ooginuvamih\",\"provisioningState\":\"Creating\"},\"id\":\"arxzxtheot\",\"name\":\"si\",\"type\":\"yevc\"},{\"properties\":{\"backupNameV2\":\"ihnhun\",\"backupType\":\"FULL\",\"completedTime\":\"2021-09-21T17:58:39Z\",\"source\":\"nfygxgispemvtz\",\"provisioningState\":\"Canceled\"},\"id\":\"ubljofxqe\",\"name\":\"fjaeq\",\"type\":\"hqjbasvmsmj\"}],\"nextLink\":\"lngsntnbybkzgcwr\"}") - .toObject(ServerBackupV2ListResult.class); - Assertions.assertEquals("nmayhuybb", model.value().get(0).backupNameV2()); - Assertions.assertEquals(BackupType.FULL, model.value().get(0).backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-30T05:44:17Z"), model.value().get(0).completedTime()); - Assertions.assertEquals("ooginuvamih", model.value().get(0).source()); - Assertions.assertEquals("lngsntnbybkzgcwr", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServerBackupV2ListResult model = new ServerBackupV2ListResult().withValue(Arrays.asList( - new ServerBackupV2Inner().withBackupNameV2("nmayhuybb") - .withBackupType(BackupType.FULL) - .withCompletedTime(OffsetDateTime.parse("2021-04-30T05:44:17Z")) - .withSource("ooginuvamih"), - new ServerBackupV2Inner().withBackupNameV2("ihnhun") - .withBackupType(BackupType.FULL) - .withCompletedTime(OffsetDateTime.parse("2021-09-21T17:58:39Z")) - .withSource("nfygxgispemvtz"))) - .withNextLink("lngsntnbybkzgcwr"); - model = BinaryData.fromObject(model).toObject(ServerBackupV2ListResult.class); - Assertions.assertEquals("nmayhuybb", model.value().get(0).backupNameV2()); - Assertions.assertEquals(BackupType.FULL, model.value().get(0).backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-30T05:44:17Z"), model.value().get(0).completedTime()); - Assertions.assertEquals("ooginuvamih", model.value().get(0).source()); - Assertions.assertEquals("lngsntnbybkzgcwr", model.nextLink()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerEditionCapabilityTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerEditionCapabilityTests.java index 3cfc864f707a4..921678ccd5a39 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerEditionCapabilityTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerEditionCapabilityTests.java @@ -11,7 +11,7 @@ public final class ServerEditionCapabilityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ServerEditionCapability model = BinaryData.fromString( - "{\"name\":\"b\",\"supportedStorageEditions\":[{\"name\":\"hxw\",\"minStorageSize\":3296324353264584274,\"maxStorageSize\":979982585731968609,\"minBackupRetentionDays\":8355520612424913730,\"maxBackupRetentionDays\":8923409732995177095,\"minBackupIntervalHours\":2179964929777678685,\"maxBackupIntervalHours\":3734794049628665607}],\"supportedServerVersions\":[{\"name\":\"gu\",\"supportedSkus\":[{\"name\":\"kfssxqukkf\",\"vCores\":4186813659074842761,\"supportedIops\":7460763687758835204,\"supportedMemoryPerVCoreMB\":2314945362863508149},{\"name\":\"kde\",\"vCores\":7346144282347512658,\"supportedIops\":3908057410560236537,\"supportedMemoryPerVCoreMB\":681890883846800256},{\"name\":\"ghxpkdw\",\"vCores\":5027473446907598737,\"supportedIops\":3085775452141512212,\"supportedMemoryPerVCoreMB\":574738342939177032}]},{\"name\":\"nyqupedeojnabck\",\"supportedSkus\":[{\"name\":\"xpsiebtfhvpes\",\"vCores\":465204548122910973,\"supportedIops\":3931920039433301426,\"supportedMemoryPerVCoreMB\":8579688850362175791},{\"name\":\"dhtldwkyz\",\"vCores\":5735733954229084765,\"supportedIops\":5199326091751618415,\"supportedMemoryPerVCoreMB\":5760355452079192141},{\"name\":\"svlxotogtwrup\",\"vCores\":5490136749692372798,\"supportedIops\":5861004465019005032,\"supportedMemoryPerVCoreMB\":1442555394211709568}]},{\"name\":\"ceoveilovno\",\"supportedSkus\":[{\"name\":\"fcnj\",\"vCores\":2295075824007541561,\"supportedIops\":4077961902359285386,\"supportedMemoryPerVCoreMB\":9006034643564809106}]},{\"name\":\"phywpnvj\",\"supportedSkus\":[{\"name\":\"ermclfplphoxuscr\",\"vCores\":8751195016646991326,\"supportedIops\":1457030135916183053,\"supportedMemoryPerVCoreMB\":6300383751543557162},{\"name\":\"azqugxywpmueefj\",\"vCores\":6619797185475635506,\"supportedIops\":833817548931918464,\"supportedMemoryPerVCoreMB\":2752624738826273376},{\"name\":\"uyonobglaoc\",\"vCores\":3198824190275494463,\"supportedIops\":7428332481829076684,\"supportedMemoryPerVCoreMB\":2435462499036948101},{\"name\":\"ytlmoyrxvwfud\",\"vCores\":7047535531175801519,\"supportedIops\":6478150774243714531,\"supportedMemoryPerVCoreMB\":7345023164643375975}]}]}") + "{\"name\":\"nfnbacfionlebxe\",\"supportedStorageEditions\":[{\"name\":\"zxdpnqbqqw\",\"minStorageSize\":2526678259667108543,\"maxStorageSize\":1458668924048164836,\"minBackupRetentionDays\":383995801038376266,\"maxBackupRetentionDays\":4205827179798225737},{\"name\":\"snjampmng\",\"minStorageSize\":4715477742922953233,\"maxStorageSize\":2627336539557135356,\"minBackupRetentionDays\":4377641915122156936,\"maxBackupRetentionDays\":4315101559151768255}],\"supportedServerVersions\":[{\"name\":\"qvpkvlrxnjeaseip\",\"supportedSkus\":[{\"name\":\"lokeyy\",\"vCores\":1523460255580500378,\"supportedIops\":1246859219124083387,\"supportedMemoryPerVCoreMB\":5538754849059417919},{\"name\":\"hpdjpjumasxa\",\"vCores\":5415411474349090758,\"supportedIops\":791832081608242916,\"supportedMemoryPerVCoreMB\":5443053800820392121}]}]}") .toObject(ServerEditionCapability.class); } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerEditionCapabilityV2Tests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerEditionCapabilityV2Tests.java deleted file mode 100644 index dd0511a813df6..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerEditionCapabilityV2Tests.java +++ /dev/null @@ -1,23 +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.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerEditionCapabilityV2; - -public final class ServerEditionCapabilityV2Tests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServerEditionCapabilityV2 model = BinaryData.fromString( - "{\"name\":\"ynt\",\"defaultSku\":\"zihleosjswsr\",\"defaultStorageSize\":2109654936,\"supportedStorageEditions\":[{\"name\":\"pzbchck\",\"minStorageSize\":2854774053179599895,\"maxStorageSize\":1485781333279221800,\"minBackupRetentionDays\":5253901469218234433,\"maxBackupRetentionDays\":7391788456233994805,\"minBackupIntervalHours\":9110638911765212224,\"maxBackupIntervalHours\":8875618774585763329},{\"name\":\"atrwyhqmibzyh\",\"minStorageSize\":3835671102059625578,\"maxStorageSize\":5859643880021118717,\"minBackupRetentionDays\":8514747756397866832,\"maxBackupRetentionDays\":4085302065865673737,\"minBackupIntervalHours\":6601309306098358089,\"maxBackupIntervalHours\":4756010311347922527}],\"supportedSkus\":[{\"name\":\"nmabik\",\"vCores\":1884314669361039477,\"supportedIops\":6435795103188177139,\"supportedMemoryPerVCoreMB\":7362187105220240358,\"supportedZones\":[\"lwwrl\",\"dmtnc\"],\"supportedHAMode\":[\"otllxdyhgsyo\"]}]}") - .toObject(ServerEditionCapabilityV2.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServerEditionCapabilityV2 model = new ServerEditionCapabilityV2(); - model = BinaryData.fromObject(model).toObject(ServerEditionCapabilityV2.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerGtidSetParameterTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerGtidSetParameterTests.java deleted file mode 100644 index d37e93e19acaf..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerGtidSetParameterTests.java +++ /dev/null @@ -1,25 +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.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerGtidSetParameter; -import org.junit.jupiter.api.Assertions; - -public final class ServerGtidSetParameterTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServerGtidSetParameter model - = BinaryData.fromString("{\"gtidSet\":\"csonpclhoco\"}").toObject(ServerGtidSetParameter.class); - Assertions.assertEquals("csonpclhoco", model.gtidSet()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServerGtidSetParameter model = new ServerGtidSetParameter().withGtidSet("csonpclhoco"); - model = BinaryData.fromObject(model).toObject(ServerGtidSetParameter.class); - Assertions.assertEquals("csonpclhoco", model.gtidSet()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerRestartParameterTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerRestartParameterTests.java index 823842c874748..8f137360d1467 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerRestartParameterTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerRestartParameterTests.java @@ -13,18 +13,18 @@ public final class ServerRestartParameterTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ServerRestartParameter model - = BinaryData.fromString("{\"restartWithFailover\":\"Disabled\",\"maxFailoverSeconds\":28529322}") + = BinaryData.fromString("{\"restartWithFailover\":\"Disabled\",\"maxFailoverSeconds\":127605943}") .toObject(ServerRestartParameter.class); Assertions.assertEquals(EnableStatusEnum.DISABLED, model.restartWithFailover()); - Assertions.assertEquals(28529322, model.maxFailoverSeconds()); + Assertions.assertEquals(127605943, model.maxFailoverSeconds()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ServerRestartParameter model = new ServerRestartParameter().withRestartWithFailover(EnableStatusEnum.DISABLED) - .withMaxFailoverSeconds(28529322); + .withMaxFailoverSeconds(127605943); model = BinaryData.fromObject(model).toObject(ServerRestartParameter.class); Assertions.assertEquals(EnableStatusEnum.DISABLED, model.restartWithFailover()); - Assertions.assertEquals(28529322, model.maxFailoverSeconds()); + Assertions.assertEquals(127605943, model.maxFailoverSeconds()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerVersionCapabilityTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerVersionCapabilityTests.java index 09f050651a8fc..7c69190f0e17d 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerVersionCapabilityTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerVersionCapabilityTests.java @@ -11,7 +11,7 @@ public final class ServerVersionCapabilityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ServerVersionCapability model = BinaryData.fromString( - "{\"name\":\"fkuwbcrnwbmehhse\",\"supportedSkus\":[{\"name\":\"srtslhspkdeem\",\"vCores\":1895836308961796190,\"supportedIops\":1461011233299690621,\"supportedMemoryPerVCoreMB\":1611861407793999607},{\"name\":\"elmqk\",\"vCores\":1137087157004223817,\"supportedIops\":3537949876650802706,\"supportedMemoryPerVCoreMB\":6307575147417814600},{\"name\":\"quhcdhmduala\",\"vCores\":2370990403210221685,\"supportedIops\":6851389169185127110,\"supportedMemoryPerVCoreMB\":4668891538540973425}]}") + "{\"name\":\"dslfhotwmcy\",\"supportedSkus\":[{\"name\":\"bjnpg\",\"vCores\":4922956716051761075,\"supportedIops\":6035975843137126951,\"supportedMemoryPerVCoreMB\":3248442344635598539},{\"name\":\"tyfsoppusuesn\",\"vCores\":7855206837791929967,\"supportedIops\":3766133720110583726,\"supportedMemoryPerVCoreMB\":7285729349641498197},{\"name\":\"zdmohctbqvu\",\"vCores\":2681919302417118526,\"supportedIops\":6410833982728127894,\"supportedMemoryPerVCoreMB\":9105261119317264049},{\"name\":\"ujjugwdkcglh\",\"vCores\":8375339089906225801,\"supportedIops\":5666209214569048838,\"supportedMemoryPerVCoreMB\":8619828940500740984}]}") .toObject(ServerVersionCapability.class); } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerVersionCapabilityV2Tests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerVersionCapabilityV2Tests.java deleted file mode 100644 index 2b5259f2febb3..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServerVersionCapabilityV2Tests.java +++ /dev/null @@ -1,22 +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.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerVersionCapabilityV2; - -public final class ServerVersionCapabilityV2Tests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServerVersionCapabilityV2 model - = BinaryData.fromString("{\"name\":\"v\"}").toObject(ServerVersionCapabilityV2.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServerVersionCapabilityV2 model = new ServerVersionCapabilityV2(); - model = BinaryData.fromObject(model).toObject(ServerVersionCapabilityV2.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersDeleteMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersDeleteMockTests.java index bdf6b4195e589..4a7bdb9f85b1b 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersDeleteMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersDeleteMockTests.java @@ -27,7 +27,7 @@ public void testDelete() throws Exception { .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureEnvironment.AZURE)); - manager.servers().delete("otcubi", "p", com.azure.core.util.Context.NONE); + manager.servers().delete("osvexcsonpclhoc", "hslkevleggzf", com.azure.core.util.Context.NONE); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersFailoverMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersFailoverMockTests.java index ebafe83479be0..5a4e52dc82b37 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersFailoverMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersFailoverMockTests.java @@ -27,7 +27,7 @@ public void testFailover() throws Exception { .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureEnvironment.AZURE)); - manager.servers().failover("kgkxn", "edabgyvudtjue", com.azure.core.util.Context.NONE); + manager.servers().failover("ypewrmjmwvvjekt", "xsenhwlr", com.azure.core.util.Context.NONE); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersResetGtidMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersResetGtidMockTests.java deleted file mode 100644 index e21499cdce306..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersResetGtidMockTests.java +++ /dev/null @@ -1,36 +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.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.models.ServerGtidSetParameter; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ServersResetGtidMockTests { - @Test - public void testResetGtid() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MySqlManager manager = MySqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.servers() - .resetGtid("vsjcswsmystuluqy", "fcvlerch", new ServerGtidSetParameter().withGtidSet("bm"), - com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersRestartMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersRestartMockTests.java index 32caa1d25d3c8..be3a17211608d 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersRestartMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersRestartMockTests.java @@ -30,8 +30,10 @@ public void testRestart() throws Exception { new AzureProfile("", "", AzureEnvironment.AZURE)); manager.servers() - .restart("n", "ntfpmvmemfnc", new ServerRestartParameter().withRestartWithFailover(EnableStatusEnum.ENABLED) - .withMaxFailoverSeconds(97692731), com.azure.core.util.Context.NONE); + .restart("ffrzpwvlqdqgbiqy", "ihkaetcktvfc", + new ServerRestartParameter().withRestartWithFailover(EnableStatusEnum.DISABLED) + .withMaxFailoverSeconds(1960016252), + com.azure.core.util.Context.NONE); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersStartMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersStartMockTests.java index 49ea40ebaf077..6b012c3414e8a 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersStartMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersStartMockTests.java @@ -27,7 +27,7 @@ public void testStart() throws Exception { .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureEnvironment.AZURE)); - manager.servers().start("b", "lxlllchpo", com.azure.core.util.Context.NONE); + manager.servers().start("kymuctqhjfbebr", "cxerf", com.azure.core.util.Context.NONE); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersStopMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersStopMockTests.java index 095850bede03c..fd74fd39d1f9c 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersStopMockTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersStopMockTests.java @@ -27,7 +27,7 @@ public void testStop() throws Exception { .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureEnvironment.AZURE)); - manager.servers().stop("bzevwrd", "hfuk", com.azure.core.util.Context.NONE); + manager.servers().stop("wutttxfvjrbi", "phxepcyvahf", com.azure.core.util.Context.NONE); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersValidateEstimateHighAvailabilityWithResponseMockTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersValidateEstimateHighAvailabilityWithResponseMockTests.java deleted file mode 100644 index 757039b7ad1f2..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ServersValidateEstimateHighAvailabilityWithResponseMockTests.java +++ /dev/null @@ -1,44 +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.mysqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.mysqlflexibleserver.MySqlManager; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.HighAvailabilityValidationEstimationInner; -import com.azure.resourcemanager.mysqlflexibleserver.models.HighAvailabilityValidationEstimation; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ServersValidateEstimateHighAvailabilityWithResponseMockTests { - @Test - public void testValidateEstimateHighAvailabilityWithResponse() throws Exception { - String responseStr - = "{\"estimatedDowntime\":895396019,\"scheduledStandbyAvailabilityZone\":\"rkdbdgiogsjkmnwq\",\"expectedStandbyAvailabilityZone\":\"obaiyhddviaceg\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MySqlManager manager = MySqlManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - HighAvailabilityValidationEstimation response - = manager.servers() - .validateEstimateHighAvailabilityWithResponse("bcihxuuwhc", "yxccyb", - new HighAvailabilityValidationEstimationInner() - .withExpectedStandbyAvailabilityZone("xgwjplmagstcyoh"), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("obaiyhddviaceg", response.expectedStandbyAvailabilityZone()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/SkuCapabilityTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/SkuCapabilityTests.java index 6ea53e6d9f5b9..12dcb21991f11 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/SkuCapabilityTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/SkuCapabilityTests.java @@ -11,7 +11,7 @@ public final class SkuCapabilityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SkuCapability model = BinaryData.fromString( - "{\"name\":\"rcrgvx\",\"vCores\":3807328350452563665,\"supportedIops\":7205793596406177755,\"supportedMemoryPerVCoreMB\":8511094552590420060}") + "{\"name\":\"jixhbk\",\"vCores\":2989333129531555970,\"supportedIops\":833770082997190597,\"supportedMemoryPerVCoreMB\":8440294910944943050}") .toObject(SkuCapability.class); } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/SkuCapabilityV2Tests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/SkuCapabilityV2Tests.java deleted file mode 100644 index afd8ae4bda40b..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/SkuCapabilityV2Tests.java +++ /dev/null @@ -1,23 +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.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.models.SkuCapabilityV2; - -public final class SkuCapabilityV2Tests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SkuCapabilityV2 model = BinaryData.fromString( - "{\"name\":\"gjltdtbnnhado\",\"vCores\":3020486930690600862,\"supportedIops\":6607949081134989897,\"supportedMemoryPerVCoreMB\":1994212450158328847,\"supportedZones\":[\"amqgxqquezikyw\"],\"supportedHAMode\":[\"kallatmel\",\"uipiccjzk\"]}") - .toObject(SkuCapabilityV2.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SkuCapabilityV2 model = new SkuCapabilityV2(); - model = BinaryData.fromObject(model).toObject(SkuCapabilityV2.class); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/SkuTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/SkuTests.java new file mode 100644 index 0000000000000..e37325a0488da --- /dev/null +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/SkuTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mysqlflexibleserver.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.mysqlflexibleserver.models.Sku; +import com.azure.resourcemanager.mysqlflexibleserver.models.SkuTier; +import org.junit.jupiter.api.Assertions; + +public final class SkuTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + Sku model = BinaryData.fromString("{\"name\":\"ucmpoyfd\",\"tier\":\"GeneralPurpose\"}").toObject(Sku.class); + Assertions.assertEquals("ucmpoyfd", model.name()); + Assertions.assertEquals(SkuTier.GENERAL_PURPOSE, model.tier()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + Sku model = new Sku().withName("ucmpoyfd").withTier(SkuTier.GENERAL_PURPOSE); + model = BinaryData.fromObject(model).toObject(Sku.class); + Assertions.assertEquals("ucmpoyfd", model.name()); + Assertions.assertEquals(SkuTier.GENERAL_PURPOSE, model.tier()); + } +} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/StorageEditionCapabilityTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/StorageEditionCapabilityTests.java index a9f47f844ae9a..15861ebb64565 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/StorageEditionCapabilityTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/StorageEditionCapabilityTests.java @@ -11,7 +11,7 @@ public final class StorageEditionCapabilityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { StorageEditionCapability model = BinaryData.fromString( - "{\"name\":\"rqjbhckfrl\",\"minStorageSize\":1577557266863245679,\"maxStorageSize\":3255446735265573328,\"minBackupRetentionDays\":2043714136567231871,\"maxBackupRetentionDays\":5237668963644708788,\"minBackupIntervalHours\":458941391738986155,\"maxBackupIntervalHours\":3134416927851785351}") + "{\"name\":\"b\",\"minStorageSize\":4998269354671391171,\"maxStorageSize\":7180856606235016018,\"minBackupRetentionDays\":246259275856309822,\"maxBackupRetentionDays\":1303050182193014003}") .toObject(StorageEditionCapability.class); } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/StorageTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/StorageTests.java index 72c1d88d604d0..9d8b72a57eb0c 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/StorageTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/StorageTests.java @@ -12,28 +12,22 @@ public final class StorageTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - Storage model = BinaryData.fromString( - "{\"storageSizeGB\":873426494,\"iops\":303390013,\"autoGrow\":\"Disabled\",\"logOnDisk\":\"Enabled\",\"storageSku\":\"fhotw\",\"autoIoScaling\":\"Enabled\"}") + Storage model = BinaryData + .fromString( + "{\"storageSizeGB\":337855308,\"iops\":419341930,\"autoGrow\":\"Disabled\",\"storageSku\":\"k\"}") .toObject(Storage.class); - Assertions.assertEquals(873426494, model.storageSizeGB()); - Assertions.assertEquals(303390013, model.iops()); + Assertions.assertEquals(337855308, model.storageSizeGB()); + Assertions.assertEquals(419341930, model.iops()); Assertions.assertEquals(EnableStatusEnum.DISABLED, model.autoGrow()); - Assertions.assertEquals(EnableStatusEnum.ENABLED, model.logOnDisk()); - Assertions.assertEquals(EnableStatusEnum.ENABLED, model.autoIoScaling()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - Storage model = new Storage().withStorageSizeGB(873426494) - .withIops(303390013) - .withAutoGrow(EnableStatusEnum.DISABLED) - .withLogOnDisk(EnableStatusEnum.ENABLED) - .withAutoIoScaling(EnableStatusEnum.ENABLED); + Storage model + = new Storage().withStorageSizeGB(337855308).withIops(419341930).withAutoGrow(EnableStatusEnum.DISABLED); model = BinaryData.fromObject(model).toObject(Storage.class); - Assertions.assertEquals(873426494, model.storageSizeGB()); - Assertions.assertEquals(303390013, model.iops()); + Assertions.assertEquals(337855308, model.storageSizeGB()); + Assertions.assertEquals(419341930, model.iops()); Assertions.assertEquals(EnableStatusEnum.DISABLED, model.autoGrow()); - Assertions.assertEquals(EnableStatusEnum.ENABLED, model.logOnDisk()); - Assertions.assertEquals(EnableStatusEnum.ENABLED, model.autoIoScaling()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ValidateBackupResponseInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ValidateBackupResponseInnerTests.java deleted file mode 100644 index c86e84903de51..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ValidateBackupResponseInnerTests.java +++ /dev/null @@ -1,26 +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.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ValidateBackupResponseInner; -import org.junit.jupiter.api.Assertions; - -public final class ValidateBackupResponseInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ValidateBackupResponseInner model - = BinaryData.fromString("{\"properties\":{\"numberOfContainers\":1743197151}}") - .toObject(ValidateBackupResponseInner.class); - Assertions.assertEquals(1743197151, model.numberOfContainers()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ValidateBackupResponseInner model = new ValidateBackupResponseInner().withNumberOfContainers(1743197151); - model = BinaryData.fromObject(model).toObject(ValidateBackupResponseInner.class); - Assertions.assertEquals(1743197151, model.numberOfContainers()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ValidateBackupResponsePropertiesTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ValidateBackupResponsePropertiesTests.java deleted file mode 100644 index 7855853743bc3..0000000000000 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/ValidateBackupResponsePropertiesTests.java +++ /dev/null @@ -1,26 +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.mysqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ValidateBackupResponseProperties; -import org.junit.jupiter.api.Assertions; - -public final class ValidateBackupResponsePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ValidateBackupResponseProperties model = BinaryData.fromString("{\"numberOfContainers\":375105800}") - .toObject(ValidateBackupResponseProperties.class); - Assertions.assertEquals(375105800, model.numberOfContainers()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ValidateBackupResponseProperties model - = new ValidateBackupResponseProperties().withNumberOfContainers(375105800); - model = BinaryData.fromObject(model).toObject(ValidateBackupResponseProperties.class); - Assertions.assertEquals(375105800, model.numberOfContainers()); - } -} diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/VirtualNetworkSubnetUsageParameterTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/VirtualNetworkSubnetUsageParameterTests.java index ff637eef77fb0..9121a347ffce7 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/VirtualNetworkSubnetUsageParameterTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/VirtualNetworkSubnetUsageParameterTests.java @@ -11,16 +11,16 @@ public final class VirtualNetworkSubnetUsageParameterTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - VirtualNetworkSubnetUsageParameter model = BinaryData.fromString("{\"virtualNetworkResourceId\":\"vc\"}") + VirtualNetworkSubnetUsageParameter model = BinaryData.fromString("{\"virtualNetworkResourceId\":\"n\"}") .toObject(VirtualNetworkSubnetUsageParameter.class); - Assertions.assertEquals("vc", model.virtualNetworkResourceId()); + Assertions.assertEquals("n", model.virtualNetworkResourceId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { VirtualNetworkSubnetUsageParameter model - = new VirtualNetworkSubnetUsageParameter().withVirtualNetworkResourceId("vc"); + = new VirtualNetworkSubnetUsageParameter().withVirtualNetworkResourceId("n"); model = BinaryData.fromObject(model).toObject(VirtualNetworkSubnetUsageParameter.class); - Assertions.assertEquals("vc", model.virtualNetworkResourceId()); + Assertions.assertEquals("n", model.virtualNetworkResourceId()); } } diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/VirtualNetworkSubnetUsageResultInnerTests.java b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/VirtualNetworkSubnetUsageResultInnerTests.java index dea610b5af239..590c9ece63f37 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/VirtualNetworkSubnetUsageResultInnerTests.java +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/src/test/java/com/azure/resourcemanager/mysqlflexibleserver/generated/VirtualNetworkSubnetUsageResultInnerTests.java @@ -11,7 +11,7 @@ public final class VirtualNetworkSubnetUsageResultInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { VirtualNetworkSubnetUsageResultInner model = BinaryData.fromString( - "{\"location\":\"y\",\"subscriptionId\":\"yrnxxmueedn\",\"delegatedSubnetsUsage\":[{\"subnetName\":\"stkwqqtch\",\"usage\":416295343158305691},{\"subnetName\":\"mtdaa\",\"usage\":8743531212516395266}]}") + "{\"location\":\"fyexfwhy\",\"subscriptionId\":\"i\",\"delegatedSubnetsUsage\":[{\"subnetName\":\"dcsi\",\"usage\":8188348657353643150},{\"subnetName\":\"amdecte\",\"usage\":485478669807006997},{\"subnetName\":\"cj\",\"usage\":5437486908155623563}]}") .toObject(VirtualNetworkSubnetUsageResultInner.class); } diff --git a/sdk/oracledatabase/azure-resourcemanager-oracledatabase/src/main/java/module-info.java b/sdk/oracledatabase/azure-resourcemanager-oracledatabase/src/main/java/module-info.java index d35342edd17ac..706a3550bd691 100644 --- a/sdk/oracledatabase/azure-resourcemanager-oracledatabase/src/main/java/module-info.java +++ b/sdk/oracledatabase/azure-resourcemanager-oracledatabase/src/main/java/module-info.java @@ -10,6 +10,6 @@ exports com.azure.resourcemanager.oracledatabase.fluent.models; exports com.azure.resourcemanager.oracledatabase.models; - opens com.azure.resourcemanager.oracledatabase.fluent.models to com.azure.core, com.fasterxml.jackson.databind; - opens com.azure.resourcemanager.oracledatabase.models to com.azure.core, com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.oracledatabase.fluent.models to com.azure.core; + opens com.azure.resourcemanager.oracledatabase.models to com.azure.core; } diff --git a/sdk/parents/clientcore-parent/pom.xml b/sdk/parents/clientcore-parent/pom.xml index ce7163ba39b0b..4aaf0c56279e4 100644 --- a/sdk/parents/clientcore-parent/pom.xml +++ b/sdk/parents/clientcore-parent/pom.xml @@ -625,36 +625,6 @@ - - - org.codehaus.mojo - build-helper-maven-plugin - 3.6.0 - - - attach-artifacts - package - - attach-artifact - - - - - ${basedir}/README.md - md - readme - - - ${basedir}/CHANGELOG.md - md - changelog - - - - - - - org.revapi @@ -1517,5 +1487,47 @@ spotbugs-exclude.xml + + + add-changelog-and-readme + + + src + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.6.0 + + + attach-artifacts + package + + attach-artifact + + + + + ${basedir}/README.md + md + readme + + + ${basedir}/CHANGELOG.md + md + changelog + + + + + + + + + diff --git a/sdk/relay/azure-resourcemanager-relay/CHANGELOG.md b/sdk/relay/azure-resourcemanager-relay/CHANGELOG.md index 1821f57b88158..3b5feab88f887 100644 --- a/sdk/relay/azure-resourcemanager-relay/CHANGELOG.md +++ b/sdk/relay/azure-resourcemanager-relay/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 1.0.0-beta.4 (Unreleased) +## 1.1.0-beta.1 (Unreleased) ### Features Added @@ -10,6 +10,16 @@ ### Other Changes +## 1.0.0 (2024-12-20) + +- Azure Resource Manager Relay client library for Java. This package contains Microsoft Azure SDK for Relay Management SDK. Use these API to manage Azure Relay resources through Azure Resource Manager. Package tag package-2017-04. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +### Breaking Changes + +#### `models.Sku` was modified + +* `withName(java.lang.String)` was removed + ## 1.0.0-beta.3 (2024-10-10) - Azure Resource Manager Relay client library for Java. This package contains Microsoft Azure SDK for Relay Management SDK. Use these API to manage Azure Relay resources through Azure Resource Manager. Package tag package-2017-04. 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/relay/azure-resourcemanager-relay/README.md b/sdk/relay/azure-resourcemanager-relay/README.md index 8b7f8119c6c2d..1b77ae473131e 100644 --- a/sdk/relay/azure-resourcemanager-relay/README.md +++ b/sdk/relay/azure-resourcemanager-relay/README.md @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-relay - 1.0.0-beta.3 + 1.0.0 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/relay/azure-resourcemanager-relay/pom.xml b/sdk/relay/azure-resourcemanager-relay/pom.xml index c338772784058..94c4dafde5997 100644 --- a/sdk/relay/azure-resourcemanager-relay/pom.xml +++ b/sdk/relay/azure-resourcemanager-relay/pom.xml @@ -14,7 +14,7 @@ com.azure.resourcemanager azure-resourcemanager-relay - 1.0.0-beta.4 + 1.1.0-beta.1 jar Microsoft Azure SDK for Relay Management @@ -45,7 +45,7 @@ UTF-8 0 0 - true + false diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/RelayManager.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/RelayManager.java index e1b49b4832785..dd6f2154f63b3 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/RelayManager.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/RelayManager.java @@ -11,6 +11,7 @@ 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.BearerTokenAuthenticationPolicy; import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpLoggingPolicy; import com.azure.core.http.policy.HttpPipelinePolicy; @@ -19,7 +20,6 @@ import com.azure.core.http.policy.RetryOptions; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; import com.azure.core.util.logging.ClientLogger; @@ -217,7 +217,7 @@ public RelayManager authenticate(TokenCredential credential, AzureProfile profil .append("-") .append("com.azure.resourcemanager.relay") .append("/") - .append("1.0.0-beta.3"); + .append("1.0.0"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder.append(" (") .append(Configuration.getGlobalConfiguration().get("java.version")) @@ -250,7 +250,7 @@ public RelayManager authenticate(TokenCredential credential, AzureProfile profil HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new AddDatePolicy()); - policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + policies.add(new BearerTokenAuthenticationPolicy(credential, scopes.toArray(new String[0]))); policies.addAll(this.policies.stream() .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) .collect(Collectors.toList())); diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/Sku.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/Sku.java index b5730e3b2affe..6a202e22de094 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/Sku.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/Sku.java @@ -19,7 +19,7 @@ public final class Sku implements JsonSerializable { /* * Name of this SKU. */ - private String name = "Standard"; + private final String name = "Standard"; /* * The tier of this SKU. @@ -41,17 +41,6 @@ public String name() { return this.name; } - /** - * Set the name property: Name of this SKU. - * - * @param name the name value to set. - * @return the Sku object itself. - */ - public Sku withName(String name) { - this.name = name; - return this; - } - /** * Get the tier property: The tier of this SKU. * diff --git a/sdk/resourcemanager/azure-resourcemanager-appservice/pom.xml b/sdk/resourcemanager/azure-resourcemanager-appservice/pom.xml index ad4e397e0fed6..e436e856b4ac7 100644 --- a/sdk/resourcemanager/azure-resourcemanager-appservice/pom.xml +++ b/sdk/resourcemanager/azure-resourcemanager-appservice/pom.xml @@ -51,7 +51,6 @@ --add-opens com.azure.core/com.azure.core.implementation.util=ALL-UNNAMED - - diff --git a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/AppServiceManager.java b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/AppServiceManager.java index 09d6391c75ada..e74077530de36 100644 --- a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/AppServiceManager.java +++ b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/AppServiceManager.java @@ -112,27 +112,47 @@ private AppServiceManager(HttpPipeline httpPipeline, AzureProfile profile) { dnsZoneManager = DnsZoneManager.authenticate(httpPipeline, profile); } - /** @return the authorization manager instance. */ + /** + * Gets the authorization manager instance. + * + * @return the authorization manager instance. + */ public AuthorizationManager authorizationManager() { return authorizationManager; } - /** @return the key vault manager instance. */ + /** + * Gets the key vault manager instance. + * + * @return the key vault manager instance. + */ public KeyVaultManager keyVaultManager() { return keyVaultManager; } - /** @return the storage manager instance. */ + /** + * Gets the storage manager instance. + * + * @return the storage manager instance. + */ public StorageManager storageManager() { return storageManager; } - /** @return the DNS zone manager instance. */ + /** + * Gets the DNS zone manager instance. + * + * @return the DNS zone manager instance. + */ public DnsZoneManager dnsZoneManager() { return dnsZoneManager; } - /** @return the web app management API entry point */ + /** + * Gets the web app management API entry point. + * + * @return the web app management API entry point + */ public WebApps webApps() { if (webApps == null) { webApps = new WebAppsImpl(this); @@ -140,7 +160,11 @@ public WebApps webApps() { return webApps; } - /** @return the app service plan management API entry point */ + /** + * Gets the app service plan management API entry point. + * + * @return the app service plan management API entry point + */ public AppServicePlans appServicePlans() { if (appServicePlans == null) { appServicePlans = new AppServicePlansImpl(this); @@ -148,7 +172,11 @@ public AppServicePlans appServicePlans() { return appServicePlans; } - /** @return the certificate order management API entry point */ + /** + * Gets the certificate order management API entry point. + * + * @return the certificate order management API entry point + */ public AppServiceCertificateOrders certificateOrders() { if (appServiceCertificateOrders == null) { appServiceCertificateOrders = new AppServiceCertificateOrdersImpl(this); @@ -156,7 +184,11 @@ public AppServiceCertificateOrders certificateOrders() { return appServiceCertificateOrders; } - /** @return the certificate management API entry point */ + /** + * Gets the certificate management API entry point. + * + * @return the certificate management API entry point + */ public AppServiceCertificates certificates() { if (appServiceCertificates == null) { appServiceCertificates = new AppServiceCertificatesImpl(this); @@ -164,7 +196,11 @@ public AppServiceCertificates certificates() { return appServiceCertificates; } - /** @return the app service plan management API entry point */ + /** + * Gets the app service plan management API entry point. + * + * @return the app service plan management API entry point + */ public AppServiceDomains domains() { if (appServiceDomains == null) { appServiceDomains = new AppServiceDomainsImpl(this); @@ -172,7 +208,11 @@ public AppServiceDomains domains() { return appServiceDomains; } - /** @return the web app management API entry point */ + /** + * Gets the web app management API entry point. + * + * @return the web app management API entry point + */ public FunctionApps functionApps() { if (functionApps == null) { functionApps = new FunctionAppsImpl(this); diff --git a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServiceCertificate.java b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServiceCertificate.java index 281dc78a6c690..a02b1999efea8 100644 --- a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServiceCertificate.java +++ b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServiceCertificate.java @@ -17,49 +17,109 @@ @Fluent public interface AppServiceCertificate extends GroupableResource, Refreshable { - /** @return the friendly name of the certificate */ + /** + * Gets the friendly name of the certificate. + * + * @return the friendly name of the certificate + */ String friendlyName(); - /** @return the subject name of the certificate */ + /** + * Gets the subject name of the certificate. + * + * @return the subject name of the certificate + */ String subjectName(); - /** @return the host names the certificate applies to */ + /** + * Gets the host names the certificate applies to. + * + * @return the host names the certificate applies to + */ List hostNames(); - /** @return the pfx blob */ + /** + * Gets the pfx blob. + * + * @return the pfx blob + */ byte[] pfxBlob(); - /** @return the app name */ + /** + * Gets the app name. + * + * @return the app name + */ String siteName(); - /** @return the self link */ + /** + * Gets the self link. + * + * @return the self link + */ String selfLink(); - /** @return the certificate issuer */ + /** + * Gets the certificate issuer. + * + * @return the certificate issuer + */ String issuer(); - /** @return the certificate issue Date */ + /** + * Gets the certificate issue Date. + * + * @return the certificate issue Date + */ OffsetDateTime issueDate(); - /** @return the certificate expriration date */ + /** + * Gets the certificate expriration date . + * + * @return the certificate expriration date + */ OffsetDateTime expirationDate(); - /** @return the certificate password */ + /** + * Gets the certificate password. + * + * @return the certificate password + */ String password(); - /** @return the certificate thumbprint */ + /** + * Gets the certificate thumbprint. + * + * @return the certificate thumbprint + */ String thumbprint(); - /** @return if the certificate valid */ + /** + * Check whether the certificate valid. + * + * @return if the certificate valid + */ Boolean valid(); - /** @return the raw bytes of .cer file */ + /** + * Gets the raw bytes of .cer file. + * + * @return the raw bytes of .cer file + */ byte[] certificateBlob(); - /** @return the public key hash */ + /** + * Gets the public key hash. + * + * @return the public key hash + */ String publicKeyHash(); - /** @return the specification for the App Service Environment to use for the certificate */ + /** + * Gets the specification for the App Service Environment to use for the certificate. + * + * @return the specification for the App Service Environment to use for the certificate + */ HostingEnvironmentProfile hostingEnvironmentProfile(); /** Container interface for all the definitions that need to be implemented. */ diff --git a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServiceCertificateKeyVaultBinding.java b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServiceCertificateKeyVaultBinding.java index 524a87e0d0113..4c6f44e398deb 100644 --- a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServiceCertificateKeyVaultBinding.java +++ b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServiceCertificateKeyVaultBinding.java @@ -12,12 +12,24 @@ @Fluent public interface AppServiceCertificateKeyVaultBinding extends IndependentChildResource { - /** @return the key vault resource Id */ + /** + * Gets the key vault resource Id. + * + * @return the key vault resource Id + */ String keyVaultId(); - /** @return the key vault secret name */ + /** + * Gets the key vault secret name. + * + * @return the key vault secret name + */ String keyVaultSecretName(); - /** @return the status of the Key Vault secret */ + /** + * Gets the status of the Key Vault secret. + * + * @return the status of the Key Vault secret + */ KeyVaultSecretStatus provisioningState(); } diff --git a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServiceCertificateOrder.java b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServiceCertificateOrder.java index 38b47ff736a68..c2c1ae0982ae2 100644 --- a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServiceCertificateOrder.java +++ b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServiceCertificateOrder.java @@ -22,46 +22,102 @@ public interface AppServiceCertificateOrder extends GroupableResource, Refreshable, Updatable { - /** @return certificate's distinguished name */ + /** + * Gets certificate's distinguished name. + * + * @return certificate's distinguished name + */ String distinguishedName(); - /** @return the domain verification token */ + /** + * Gets the domain verification token. + * + * @return the domain verification token + */ String domainVerificationToken(); - /** @return duration in years (must be between 1 and 3) */ + /** + * Gets duration in years. + * + * @return duration in years (must be between 1 and 3) + */ int validityInYears(); - /** @return the certificate key size */ + /** + * Gets the certificate key size. + * + * @return the certificate key size + */ int keySize(); - /** @return the certificate product type */ + /** + * Gets the certificate product type. + * + * @return the certificate product type + */ CertificateProductType productType(); - /** @return if the certificate should be automatically renewed upon expiration */ + /** + * Check whether the certificate will renewed automatically. + * + * @return if the certificate should be automatically renewed upon expiration + */ boolean autoRenew(); - /** @return current order status */ + /** + * Gets current order status. + * + * @return current order status + */ CertificateOrderStatus status(); - /** @return the signed certificate */ + /** + * Gets the signed certificate. + * + * @return the signed certificate + */ CertificateDetails signedCertificate(); - /** @return last certificate signing request that was created for this order */ + /** + * Gets last certificate signing request that was created for this order. + * + * @return last certificate signing request that was created for this order + */ String certificateSigningRequest(); - /** @return the intermediate certificate */ + /** + * Gets the intermediate certificate. + * + * @return the intermediate certificate + */ CertificateDetails intermediate(); - /** @return the root certificate */ + /** + * Gets the root certificate. + * + * @return the root certificate + */ CertificateDetails root(); - /** @return current serial number of the certificate */ + /** + * Gets the current serial number of the certificate. + * + * @return current serial number of the certificate + */ String serialNumber(); - /** @return last issuance time */ + /** + * Gets the last issuance time. + * + * @return last issuance time + */ OffsetDateTime lastCertificateIssuanceTime(); - /** @return expiration time */ + /** + * Gets the expiration time. + * + * @return expiration time + */ OffsetDateTime expirationTime(); /** @@ -82,10 +138,18 @@ public interface AppServiceCertificateOrder */ Mono createKeyVaultBindingAsync(String certificateName, Vault vault); - /** @return the state of the Key Vault secret */ + /** + * Gets the state of the Key Vault secret. + * + * @return the state of the Key Vault secret + */ AppServiceCertificateKeyVaultBinding getKeyVaultBinding(); - /** @return the state of the Key Vault secret */ + /** + * Gets the state of the Key Vault secret. + * + * @return the state of the Key Vault secret + */ Mono getKeyVaultBindingAsync(); /** diff --git a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServiceDomain.java b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServiceDomain.java index b38c813258552..6081be88c0148 100644 --- a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServiceDomain.java +++ b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServiceDomain.java @@ -28,57 +28,114 @@ public interface AppServiceDomain extends GroupableResource, HasName, Refreshable, Updatable { - /** @return admin contact information */ + /** + * Gets admin contact information. + * + * @return admin contact information + */ Contact adminContact(); - /** @return billing contact information */ + /** + * Gets billing contact information. + * + * @return billing contact information + */ Contact billingContact(); - /** @return registrant contact information */ + /** + * Gets registrant contact information + * + * @return registrant contact information + */ Contact registrantContact(); - /** @return technical contact information */ + /** + * Gets technical contact information + * + * @return technical contact information + */ Contact techContact(); - /** @return domain registration status */ + /** + * Gets domain registration status. + * + * @return domain registration status + */ DomainStatus registrationStatus(); - /** @return name servers */ + /** + * Gets name servers. + * + * @return name servers + */ List nameServers(); - /** @return true if domain privacy is enabled for this domain */ + /** + * Check whether domain privacy is enabled for this domain. + * + * @return true if domain privacy is enabled for this domain + */ boolean privacy(); - /** @return domain creation timestamp. */ + /** + * Gets domain creation timestamp. + * + * @return domain creation timestamp. + */ OffsetDateTime createdTime(); - /** @return domain expiration timestamp. */ + /** + * Gets domain expiration timestamp. + * + * @return domain expiration timestamp. + */ OffsetDateTime expirationTime(); - /** @return timestamp when the domain was renewed last time */ + /** + * Gets timestamp when the domain was renewed last time. + * + * @return timestamp when the domain was renewed last time + */ OffsetDateTime lastRenewedTime(); - /** @return true if domain will renewed automatically */ + /** + * Check whether domain will renewed automatically. + * + * @return true if domain will renewed automatically */ boolean autoRenew(); /** + * Check whether Azure can assign this domain to Web Apps. + * * @return true if Azure can assign this domain to Web Apps. This value will be true if domain registration status * is active and it is hosted on name servers Azure has programmatic access to. */ boolean readyForDnsRecordManagement(); - /** @return all hostnames derived from the domain and assigned to Azure resources */ + /** + * Gets all hostnames derived from the domain and assigned to Azure resources. + * + * @return all hostnames derived from the domain and assigned to Azure resources + */ Map managedHostNames(); - /** @return legal agreement consent. */ + /** + * Gets legal agreement consent. + * + * @return legal agreement consent. + */ DomainPurchaseConsent consent(); /** + * Gets the type of DNS. + * * @return the type of DNS */ DnsType dnsType(); /** + * Gets Azure DNS zone id. + * * @return Azure DNS zone id */ String dnsZoneId(); diff --git a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServicePlan.java b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServicePlan.java index 56733a6d9720a..e2470d6b931c8 100644 --- a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServicePlan.java +++ b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServicePlan.java @@ -17,22 +17,44 @@ @Fluent public interface AppServicePlan extends GroupableResource, HasName, Refreshable, Updatable { - /** @return maximum number of instances that can be assigned */ + /** + * Gets maximum number of instances that can be assigned. + * + * @return maximum number of instances that can be assigned + */ int maxInstances(); - /** @return maximum number of instances that can be assigned */ + /** + * Gets maximum number of instances that can be assigned. + * + * @return maximum number of instances that can be assigned */ int capacity(); - /** @return if apps assigned to this App Service Plan can be scaled independently */ + /** + * Check whether apps assigned to this App Service Plan can be scaled independently. + * + * @return if apps assigned to this App Service Plan can be scaled independently */ boolean perSiteScaling(); - /** @return number of web apps assigned to this App Service Plan */ + /** + * Gets number of web apps assigned to this App Service Plan. + * + * @return number of web apps assigned to this App Service Plan + */ int numberOfWebApps(); - /** @return the pricing tier information of the App Service Plan */ + /** + * Gets the pricing tier information of the App Service Plan + * + * @return the pricing tier information of the App Service Plan + */ PricingTier pricingTier(); - /** @return the operating system the web app is running on */ + /** + * Gets the operating system the web app is running on. + * + * @return the operating system the web app is running on + */ OperatingSystem operatingSystem(); /************************************************************** diff --git a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppSetting.java b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppSetting.java index 204f967ee327e..b27740659e600 100644 --- a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppSetting.java +++ b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppSetting.java @@ -8,12 +8,24 @@ /** An immutable client-side representation of an app setting on a web app. */ @Fluent public interface AppSetting { - /** @return the key of the setting */ + /** + * Gets the key of the setting. + * + * @return the key of the setting + */ String key(); - /** @return the value of the setting */ + /** + * Gets the value of the setting. + * + * @return the value of the setting + */ String value(); - /** @return if the setting sticks to the slot during a swap */ + /** + * Check whether the setting sticks to the slot during a swap. + * + * @return if the setting sticks to the slot during a swap + */ boolean sticky(); } diff --git a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ConnectionString.java b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ConnectionString.java index 226228074da55..f4d55d6ed83c9 100644 --- a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ConnectionString.java +++ b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/ConnectionString.java @@ -8,15 +8,31 @@ /** An immutable client-side representation of a connection string on a web app. */ @Fluent public interface ConnectionString { - /** @return the key of the setting */ + /** + * Gets the key of the setting. + * + * @return the key of the setting + */ String name(); - /** @return the value of the connection string */ + /** + * Gets the value of the connection string. + * + * @return the value of the connection string + */ String value(); - /** @return the type of the connection string */ + /** + * Gets the type of the connection string. + * + * @return the type of the connection string + */ ConnectionStringType type(); - /** @return if the connection string sticks to the slot during a swap */ + /** + * Check whether the connection string sticks to the slot during a swap. + * + * @return if the connection string sticks to the slot during a swap + */ boolean sticky(); } diff --git a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DeployOptions.java b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DeployOptions.java index 0cc294b9ec244..5096066fbf31e 100644 --- a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DeployOptions.java +++ b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DeployOptions.java @@ -14,6 +14,14 @@ public class DeployOptions { private Boolean trackDeployment; /** + * Creates a new instance of DeployOptions. + */ + public DeployOptions() { + } + + /** + * Gets the path for deploy. + * * @return the path for deploy */ public String path() { @@ -32,6 +40,8 @@ public DeployOptions withPath(String path) { } /** + * Check whether to restart site after deployment. + * * @return whether to restart site after deployment */ public Boolean restartSite() { @@ -52,6 +62,8 @@ public DeployOptions withRestartSite(Boolean restartSite) { } /** + * Check whether to perform clean deployment. + * * @return whether to perform clean deployment */ public Boolean cleanDeployment() { @@ -75,6 +87,8 @@ public DeployOptions withCleanDeployment(Boolean cleanDeployment) { } /** + * Check whether to track deployment progress. + * * @return whether to track deployment progress */ public Boolean trackDeployment() { diff --git a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DeployType.java b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DeployType.java index 39ddd5208d36e..82cc0c45237ae 100644 --- a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DeployType.java +++ b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DeployType.java @@ -77,6 +77,8 @@ public static DeployType fromString(String name) { } /** + * Gets known DeployType type values. + * * @return known DeployType type values */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DeploymentSlotBase.java b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DeploymentSlotBase.java index 79342b4a5e199..28e4361ad445f 100644 --- a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DeploymentSlotBase.java +++ b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DeploymentSlotBase.java @@ -19,6 +19,8 @@ public interface DeploymentSlotBase extends WebAppBase, Updatable the type of the resource */ interface WithRuntimeVersion { /** @@ -44,6 +46,8 @@ interface WithRuntimeVersion { /** * A deployment slot update allowing docker image source to be specified. + * + * @param the type of the resource */ interface WithDockerContainerImage { /** @@ -71,6 +75,8 @@ interface WithDockerContainerImage { /** * A deployment slot update allowing docker hub credentials to be set. + * + * @param the type of the resource */ interface WithCredentials { /** @@ -85,6 +91,8 @@ interface WithCredentials { /** * A deployment slot update allowing docker startup command to be specified. * This will replace the "CMD" section in the Dockerfile. + * + * @param the type of the resource */ interface WithStartUpCommand { /** @@ -97,7 +105,11 @@ interface WithStartUpCommand { } } - /** The template for a web app update operation, containing all the settings that can be modified. */ + /** + * The template for a web app update operation, containing all the settings that can be modified. + * + * @param the type of the resource + */ interface Update extends Appliable, WebAppBase.Update, UpdateStages.WithRuntimeVersion, UpdateStages.WithDockerContainerImage, UpdateStages.WithStartUpCommand, UpdateStages.WithCredentials { diff --git a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DomainContact.java b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DomainContact.java index dc0df44d07515..0566b7af95551 100644 --- a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DomainContact.java +++ b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DomainContact.java @@ -13,31 +13,67 @@ @Fluent public interface DomainContact extends HasInnerModel, ChildResource { - /** @return contact's mailing address */ + /** + * Gets contact's mailing address. + * + * @return contact's mailing address + */ Address addressMailing(); - /** @return contact's email address */ + /** + * Gets contact's email address. + * + * @return contact's email address + */ String email(); - /** @return contact's fax number */ + /** + * Gets contact's fax number. + * + * @return contact's fax number + */ String fax(); - /** @return contact's job title */ + /** + * Gets contact's job title. + * + * @return contact's job title + */ String jobTitle(); - /** @return contact's first name */ + /** + * Gets contact's first name. + * + * @return contact's first name + */ String firstName(); - /** @return contact's last name */ + /** + * Gets contact's last name. + * + * @return contact's last name + */ String lastName(); - /** @return contact's middle name */ + /** + * Gets contact's middle name. + * + * @return contact's middle name + */ String middleName(); - /** @return contact's organization */ + /** + * Gets contact's organization. + * + * @return contact's organization + */ String organization(); - /** @return contact's phone number */ + /** + * Gets contact's phone number. + * + * @return contact's phone number + */ String phone(); /** @@ -301,6 +337,8 @@ interface WithAttach extends Attachable.InDefinition, DefinitionStages.WithOrganization, DefinitionStages.WithJobTitle, DefinitionStages.WithFaxNumber { /** + * Builds a contact instance. + * * @return the contact */ Contact build(); diff --git a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DomainLegalAgreement.java b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DomainLegalAgreement.java index 2c29e43380203..f13d024cf9f0d 100644 --- a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DomainLegalAgreement.java +++ b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DomainLegalAgreement.java @@ -10,15 +10,30 @@ /** An immutable client-side representation of an Azure domain legal agreement. */ @Fluent public interface DomainLegalAgreement extends HasInnerModel { - /** @return unique identifier for the agreement */ + /** + * Gets unique identifier for the agreement. + * + * @return unique identifier for the agreement + */ String agreementKey(); - /** @return agreement title */ + /** + * Gets agreement title. + * + * @return agreement title + */ String title(); - /** @return agreement details */ + /** + * Gets agreement details. + * + * @return agreement details + */ String content(); - /** @return url where a copy of the agreement details is hosted */ + /** + * Gets url where a copy of the agreement details is hosted. + * + * @return url where a copy of the agreement details is hosted */ String url(); } diff --git a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/FunctionApp.java b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/FunctionApp.java index 52aecf1a9a21e..d5513d0095544 100644 --- a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/FunctionApp.java +++ b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/FunctionApp.java @@ -24,16 +24,32 @@ public interface FunctionApp extends FunctionAppBasic, WebAppBase, Updatable, SupportsListingPrivateLinkResource, SupportsListingPrivateEndpointConnection, SupportsUpdatingPrivateEndpointConnection, SupportsOneDeploy { - /** @return the entry point to deployment slot management API under the function app */ + /** + * Gets the entry point to deployment slot management API under the function app. + * + * @return the entry point to deployment slot management API under the function app + */ FunctionDeploymentSlots deploymentSlots(); - /** @return the storage account associated with the function app */ + /** + * Gets the storage account associated with the function app. + * + * @return the storage account associated with the function app + */ StorageAccount storageAccount(); - /** @return the master key for the function app */ + /** + * Gets the master key for the function app. + * + * @return the master key for the function app + */ String getMasterKey(); - /** @return the master key for the function app */ + /** + * Gets the master key for the function app. + * + * @return the master key for the function app + */ Mono getMasterKeyAsync(); /** diff --git a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/FunctionDeploymentSlot.java b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/FunctionDeploymentSlot.java index 186accd11d028..35cd73c3f8715 100644 --- a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/FunctionDeploymentSlot.java +++ b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/FunctionDeploymentSlot.java @@ -18,10 +18,18 @@ public interface FunctionDeploymentSlot extends IndependentChildResource, Updatable>, HasParent, SupportsOneDeploy { - /** @return the master key for the function app */ + /** + * Gets the master key for the function app. + * + * @return the master key for the function app + */ String getMasterKey(); - /** @return the master key for the function app */ + /** + * Gets the master key for the function app. + * + * @return the master key for the function app + */ Mono getMasterKeyAsync(); /************************************************************** diff --git a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/FunctionEnvelope.java b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/FunctionEnvelope.java index dd9fe9fd1cfa6..8e5c88ce04888 100644 --- a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/FunctionEnvelope.java +++ b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/FunctionEnvelope.java @@ -10,30 +10,66 @@ /** An immutable representation of function Information. */ public interface FunctionEnvelope extends HasInnerModel { - /** @return the functionAppId value */ + /** + * Gets the functionAppId value. + * + * @return the functionAppId value + */ String functionAppId(); - /** @return the scriptRootPathHref value */ + /** + * Gets the scriptRootPathHref value. + * + * @return the scriptRootPathHref value + */ String scriptRootPathHref(); - /** @return the scriptHref value */ + /** + * Gets the scriptHref value. + * + * @return the scriptHref value + */ String scriptHref(); - /** @return the configHref value */ + /** + * Gets the configHref value. + * + * @return the configHref value + */ String configHref(); - /** @return the secretsFileHref value */ + /** + * Gets the secretsFileHref value. + * + * @return the secretsFileHref value + */ String secretsFileHref(); - /** @return the href value */ + /** + * Gets the href value. + * + * @return the href value + */ String href(); - /** @return the config value */ + /** + * Gets the config value. + * + * @return the config value + */ Object config(); - /** @return the files value */ + /** + * Gets the files value. + * + * @return the files value + */ Map files(); - /** @return the testData value */ + /** + * Gets the testData value. + * + * @return the testData value + */ String testData(); } diff --git a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/FunctionRuntimeStack.java b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/FunctionRuntimeStack.java index db28712384e32..482bc77471668 100644 --- a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/FunctionRuntimeStack.java +++ b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/FunctionRuntimeStack.java @@ -38,12 +38,20 @@ public FunctionRuntimeStack(String runtime, String version, String linuxFxVersio this.linuxFxVersion = Objects.requireNonNull(linuxFxVersion); } - /** @return the name of the language runtime */ + /** + * Gets the name of the language runtime. + * + * @return the name of the language runtime + */ public String runtime() { return runtime; } - /** @return the version of the Language runtime */ + /** + * Gets the version of the Language runtime. + * + * @return the version of the Language runtime + */ public String version() { return version; } diff --git a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/HostnameBinding.java b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/HostnameBinding.java index 75bffa7160942..578dba89621f9 100644 --- a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/HostnameBinding.java +++ b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/HostnameBinding.java @@ -14,22 +14,46 @@ @Fluent public interface HostnameBinding extends HasInnerModel, ExternalChildResource, Resource { - /** @return the web app name */ + /** + * Gets the web app name. + * + * @return the web app name + */ String webAppName(); - /** @return the fully qualified ARM domain resource URI */ + /** + * Gets the fully qualified ARM domain resource URI. + * + * @return the fully qualified ARM domain resource URI + */ String domainId(); - /** @return Azure resource name to bind to */ + /** + * Gets Azure resource name to bind to. + * + * @return Azure resource name to bind to + */ String azureResourceName(); - /** @return Azure resource type */ + /** + * Gets Azure resource type. + * + * @return Azure resource type + */ AzureResourceType azureResourceType(); - /** @return custom DNS record type */ + /** + * Gets custom DNS record type. + * + * @return custom DNS record type + */ CustomHostnameDnsRecordType dnsRecordType(); - /** @return the host name type */ + /** + * Gets the host name type. + * + * @return the host name type + */ HostnameType hostnameType(); /** diff --git a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/HostnameSslBinding.java b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/HostnameSslBinding.java index 40b26d02ff7a8..59c487fefd67d 100644 --- a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/HostnameSslBinding.java +++ b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/HostnameSslBinding.java @@ -12,13 +12,24 @@ /** An immutable representation of an host name SSL binding. */ @Fluent public interface HostnameSslBinding extends HasInnerModel, ChildResource { - /** @return the SSL type */ + /** + * Gets the SSL type. + * + * @return the SSL type + */ SslState sslState(); - /** @return the virtual IP address assigned to the host name if IP based SSL is enabled */ + /** + * Gets the virtual IP address assigned to the host name. + * + * @return the virtual IP address assigned to the host name if IP based SSL is enabled */ String virtualIp(); - /** @return the SSL cert thumbprint. */ + /** + * Gets the SSL cert thumbprint. + * + * @return the SSL cert thumbprint. + */ String thumbprint(); /** diff --git a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/JavaVersion.java b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/JavaVersion.java index 96cb82d07cc18..5f0434cfa0cc6 100644 --- a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/JavaVersion.java +++ b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/JavaVersion.java @@ -75,6 +75,15 @@ public final class JavaVersion extends ExpandableStringEnum { /** Static value Zulu 11.0.2_ZULU for JavaVersion. */ public static final JavaVersion JAVA_ZULU_11_0_2 = fromString("11.0.2_ZULU"); + /** + * Creates a new instance of JavaVersion value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public JavaVersion() { + } + /** * Finds or creates a Java version value based on the provided name. * @@ -85,7 +94,10 @@ public static JavaVersion fromString(String name) { return fromString(name, JavaVersion.class); } - /** @return known Java versions */ + /** + * Gets known Java versions. + * + * @return known Java versions */ public static Collection values() { return values(JavaVersion.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/KuduDeploymentResult.java b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/KuduDeploymentResult.java index 9f69a0cc85506..cc7e6f8030df3 100644 --- a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/KuduDeploymentResult.java +++ b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/KuduDeploymentResult.java @@ -20,6 +20,8 @@ public KuduDeploymentResult(String deploymentId) { } /** + * Gets the deployment ID. + * * @return the deployment ID. It can be {@code null} if tracking deployment is disabled. */ public String deploymentId() { diff --git a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/NetFrameworkVersion.java b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/NetFrameworkVersion.java index 6339485453092..4ebe61d3bd305 100644 --- a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/NetFrameworkVersion.java +++ b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/NetFrameworkVersion.java @@ -15,6 +15,15 @@ public final class NetFrameworkVersion extends ExpandableStringEnum values() { return values(NetFrameworkVersion.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/PhpVersion.java b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/PhpVersion.java index dd1aaf952aec2..95e509f931814 100644 --- a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/PhpVersion.java +++ b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/PhpVersion.java @@ -24,6 +24,15 @@ public final class PhpVersion extends ExpandableStringEnum { /** Static value 7.1 for PhpVersion. */ public static final PhpVersion PHP7_1 = PhpVersion.fromString("7.1"); + /** + * Creates a new instance of PhpVersion value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PhpVersion() { + } + /** * Finds or creates a PHP version based on the specified name. * @@ -34,7 +43,11 @@ public static PhpVersion fromString(String name) { return fromString(name, PhpVersion.class); } - /** @return known PHP versions */ + /** + * Gets known PHP versions. + * + * @return known PHP versions + */ public static Collection values() { return values(PhpVersion.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/PricingTier.java b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/PricingTier.java index 1fc15e92034ce..d9ee7f8d492bb 100644 --- a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/PricingTier.java +++ b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/PricingTier.java @@ -111,7 +111,11 @@ public String toString() { return skuDescription.tier() + "_" + skuDescription.size(); } - /** @return the underneath sku description */ + /** + * Gets the underneath sku description. + * + * @return the underneath sku description + */ public SkuDescription toSkuDescription() { return this.skuDescription; } diff --git a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/PublishingProfile.java b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/PublishingProfile.java index db88f89291486..2ce0c5d311226 100644 --- a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/PublishingProfile.java +++ b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/PublishingProfile.java @@ -7,21 +7,45 @@ /** Endpoints and credentials for publishing to a web app. */ @Fluent public interface PublishingProfile { - /** @return the url for FTP publishing, with ftp:// and the root folder. E.g. ftp://ftp.contoso.com/site/wwwroot */ + /** + * Gets the URL for FTP publishing. + * + * @return the URL for FTP publishing, with ftp:// and the root folder. E.g. ftp://ftp.contoso.com/site/wwwroot + */ String ftpUrl(); - /** @return the username used for FTP publishing */ + /** + * Gets the username used for FTP publishing + * + * @return the username used for FTP publishing + */ String ftpUsername(); - /** @return the password used for FTP publishing */ + /** + * Gets the password used for FTP publishing. + * + * @return the password used for FTP publishing + */ String ftpPassword(); - /** @return the url for FTP publishing, with https:// upfront. E.g. https://contoso.com:443/myRepo.git */ + /** + * Gets the URL for FTP publishing. + * + * @return the URL for FTP publishing, with https:// upfront. E.g. https://contoso.com:443/myRepo.git + */ String gitUrl(); - /** @return the username used for Git publishing */ + /** + * Gets the username used for Git publishing. + * + * @return the username used for Git publishing + */ String gitUsername(); - /** @return the password used for Git publishing */ + /** + * Gets the password used for Git publishing. + * + * @return the password used for Git publishing + */ String gitPassword(); } diff --git a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/PythonVersion.java b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/PythonVersion.java index e62b5075f3332..c687c7b4b2360 100644 --- a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/PythonVersion.java +++ b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/PythonVersion.java @@ -18,6 +18,15 @@ public final class PythonVersion extends ExpandableStringEnum { /** Static value 3.4 for PythonVersion. */ public static final PythonVersion PYTHON_34 = PythonVersion.fromString("3.4"); + /** + * Creates a new instance of PythonVersion value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PythonVersion() { + } + /** * Finds or creates a Python version based on the specified name. * @@ -28,7 +37,11 @@ public static PythonVersion fromString(String name) { return fromString(name, PythonVersion.class); } - /** @return known Python versions */ + /** + * Gets known Python versions. + * + * @return known Python versions + */ public static Collection values() { return values(PythonVersion.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/RemoteVisualStudioVersion.java b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/RemoteVisualStudioVersion.java index f333859292662..fb233ec962b87 100644 --- a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/RemoteVisualStudioVersion.java +++ b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/RemoteVisualStudioVersion.java @@ -15,6 +15,15 @@ public final class RemoteVisualStudioVersion extends ExpandableStringEnum values() { return values(RemoteVisualStudioVersion.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/RuntimeStack.java b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/RuntimeStack.java index 75368ddaf630b..4e05dd5db8612 100644 --- a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/RuntimeStack.java +++ b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/RuntimeStack.java @@ -126,12 +126,20 @@ public RuntimeStack(String stack, String version) { this.version = version; } - /** @return the name of the language runtime stack */ + /** + * Gets the name of the language runtime stack. + * + * @return the name of the language runtime stack + */ public String stack() { return stack; } - /** @return the version of the runtime stack */ + /** + * Gets the version of the runtime stack. + * + * @return the version of the runtime stack + */ public String version() { return version; } diff --git a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebApp.java b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebApp.java index 2e7a2c266ddd1..71413cd5f6dde 100644 --- a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebApp.java +++ b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebApp.java @@ -22,7 +22,11 @@ public interface WebApp extends WebAppBasic, SupportsOneDeploy, WebAppBase, Updatable, SupportsListingPrivateLinkResource, SupportsListingPrivateEndpointConnection, SupportsUpdatingPrivateEndpointConnection { - /** @return the entry point to deployment slot management API under the web app */ + /** + * Gets the entry point to deployment slot management API under the web app. + * + * @return the entry point to deployment slot management API under the web app + */ DeploymentSlots deploymentSlots(); /** diff --git a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebAppBase.java b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebAppBase.java index f5524b70ee1d8..11bf25700771c 100644 --- a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebAppBase.java +++ b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebAppBase.java @@ -25,133 +25,294 @@ @Fluent public interface WebAppBase extends HasName, GroupableResource, WebSiteBase { - /** @return the default documents */ + /** + * Gets the default documents. + * + * @return the default documents + */ List defaultDocuments(); - /** @return the .NET Framework version */ + /** + * Gets the .NET Framework version. + * + * @return the .NET Framework version + */ NetFrameworkVersion netFrameworkVersion(); - /** @return the version of PHP */ + /** + * Gets the version of PHP. + * + * @return the version of PHP + */ PhpVersion phpVersion(); - /** @return the version of Python */ + /** + * Gets the version of Python. + * + * @return the version of Python + */ PythonVersion pythonVersion(); - /** @return the version of Node.JS */ + /** + * Gets the version of Node.JS. + * + * @return the version of Node.JS + */ String nodeVersion(); - /** @return if the remote eebugging is enabled */ + /** + * Check whether the remote eebugging is enabled. + * + * @return if the remote eebugging is enabled + */ boolean remoteDebuggingEnabled(); - /** @return the remote debugging version */ + /** + * Gets the remote debugging version. + * + * @return the remote debugging version + */ RemoteVisualStudioVersion remoteDebuggingVersion(); - /** @return if web socket is enabled */ + /** + * Check whether web socket is enabled. + * + * @return if web socket is enabled + */ boolean webSocketsEnabled(); - /** @return if the web app is always on */ + /** + * Check whether the web app is always on. + * + * @return if the web app is always on + */ boolean alwaysOn(); - /** @return Java version */ + /** + * Gets Java version. + * + * @return Java version + */ JavaVersion javaVersion(); - /** @return Java container */ + /** + * Gets Java container. + * + * @return Java container + */ String javaContainer(); - /** @return Java container version */ + /** + * Gets Java container version. + * + * @return Java container version + */ String javaContainerVersion(); - /** @return managed pipeline mode */ + /** + * Gets managed pipeline mode. + * + * @return managed pipeline mode + */ ManagedPipelineMode managedPipelineMode(); - /** @return the auto swap slot name */ + /** + * Gets the auto swap slot name. + * + * @return the auto swap slot name + */ String autoSwapSlotName(); - /** @return the state of FTP / FTPS service */ + /** + * Gets the state of FTP / FTPS service. + * + * @return the state of FTP / FTPS service + */ FtpsState ftpsState(); - /** @return the virtual applications and their virtual directories in this web app */ + /** + * Gets the virtual applications and their virtual directories in this web app. + * + * @return the virtual applications and their virtual directories in this web app + */ List virtualApplications(); - /** @return whether to allow clients to connect over http2.0 */ + /** + * Check whether to allow clients to connect over HTTP/2. + * + * @return whether to allow clients to connect over HTTP/2 + */ boolean http20Enabled(); - /** @return the minimum version of TLS required for SSL requests. */ + /** + * Gets the minimum version of TLS required for SSL requests. + * + * @return the minimum version of TLS required for SSL requests. + */ SupportedTlsVersions minTlsVersion(); - /** @return whether local MySQL is enabled */ + /** + * Check whether local MySQL is enabled. + * + * @return whether local MySQL is enabled */ boolean localMySqlEnabled(); - /** @return the SCM configuration for the web app */ + /** + * Gets the SCM configuration for the web app. + * + * @return the SCM configuration for the web app + */ ScmType scmType(); - /** @return the root directory for the web app */ + /** + * Gets the root directory for the web app. + * + * @return the root directory for the web app + */ String documentRoot(); /** + * Gets the System Assigned (Local) Managed Service Identity specific Active Directory tenant ID assigned to the + * web app. + * * @return the System Assigned (Local) Managed Service Identity specific Active Directory tenant ID assigned to the * web app. */ String systemAssignedManagedServiceIdentityTenantId(); /** + * Gets the System Assigned (Local) Managed Service Identity specific Active Directory service principal ID + * assigned to the web app. + * * @return the System Assigned (Local) Managed Service Identity specific Active Directory service principal ID * assigned to the web app. */ String systemAssignedManagedServiceIdentityPrincipalId(); - /** @return The ids of the user assigned identities */ + /** + * Gets the ids of the user assigned identities . + * + * @return The ids of the user assigned identities + */ Set userAssignedManagedServiceIdentityIds(); - /** @return the app settings defined on the web app */ + /** + * Gets the app settings defined on the web app + * + * @return the app settings defined on the web app + */ Map getAppSettings(); - /** @return the app settings defined on the web app */ + /** + * Gets the app settings defined on the web app. + * + * @return the app settings defined on the web app + */ Mono> getAppSettingsAsync(); - /** @return the connection strings defined on the web app */ + /** + * Gets the connection strings defined on the web app. + * + * @return the connection strings defined on the web app + */ Map getConnectionStrings(); - /** @return the connection strings defined on the web app */ + /** + * Gets the connection strings defined on the web app. + * + * @return the connection strings defined on the web app + */ Mono> getConnectionStringsAsync(); - /** @return the authentication configuration defined on the web app */ + /** + * Gets the authentication configuration defined on the web app. + * + * @return the authentication configuration defined on the web app + */ WebAppAuthentication getAuthenticationConfig(); - /** @return the authentication configuration defined on the web app */ + /** + * Gets the authentication configuration defined on the web app. + * + * @return the authentication configuration defined on the web app + */ Mono getAuthenticationConfigAsync(); - /** @return the architecture of the platform, either 32 bit (x86) or 64 bit (x64). */ + /** + * Gets the architecture of the platform. + * + * @return the architecture of the platform, either 32 bit (x86) or 64 bit (x64). + */ PlatformArchitecture platformArchitecture(); - /** @return the Linux app framework and version if this is a Linux web app. */ + /** + * Gets the Linux app framework and version if this is a Linux web app. + * + * @return the Linux app framework and version if this is a Linux web app. + */ String linuxFxVersion(); - /** @return the Windows app framework and version if this is a Windows web app. */ + /** + * Gets the Windows app framework and version if this is a Windows web app. + * + * @return the Windows app framework and version if this is a Windows web app. + */ String windowsFxVersion(); - /** @return the list of ip security rules. */ + /** + * Gets the list of ip security rules. + * + * @return the list of ip security rules. + */ List ipSecurityRules(); - /** @return the diagnostic logs configuration */ + /** + * Gets the diagnostic logs configuration. + * + * @return the diagnostic logs configuration + */ WebAppDiagnosticLogs diagnosticLogsConfig(); - /** @return the mapping from host names and the host name bindings */ + /** + * Gets the mapping from host names and the host name bindings. + * + * @return the mapping from host names and the host name bindings + */ Map getHostnameBindings(); - /** @return the mapping from host names and the host name bindings */ + /** + * Gets the mapping from host names and the host name bindings. + * + * @return the mapping from host names and the host name bindings + */ Mono> getHostnameBindingsAsync(); - /** @return the URL and credentials for publishing through FTP or Git */ + /** + * Gets the URL and credentials for publishing through FTP or Git. + * + * @return the URL and credentials for publishing through FTP or Git + */ PublishingProfile getPublishingProfile(); - /** @return the URL and credentials for publishing through FTP or Git */ + /** + * Gets the URL and credentials for publishing through FTP or Git. + * + * @return the URL and credentials for publishing through FTP or Git + */ Mono getPublishingProfileAsync(); - /** @return the source control information for the web app */ + /** + * Gets the source control information for the web app. + * + * @return the source control information for the web app + */ WebAppSourceControl getSourceControl(); - /** @return the source control information for the web app */ + /** + * Gets the source control information for the web app. + * + * @return the source control information for the web app + */ Mono getSourceControlAsync(); /** @@ -161,46 +322,102 @@ public interface WebAppBase extends HasName, GroupableResource getContainerLogsAsync(); - /** @return the zipped archive of docker logs for a Linux web app */ + /** + * Gets the zipped archive of docker logs for a Linux web app. + * + * @return the zipped archive of docker logs for a Linux web app + */ byte[] getContainerLogsZip(); - /** @return the zipped archive of docker logs for a Linux web app */ + /** + * Gets the zipped archive of docker logs for a Linux web app. + * + * @return the zipped archive of docker logs for a Linux web app + */ Mono getContainerLogsZipAsync(); - /** @return a open stream to the application logs */ + /** + * Gets a open stream to the application logs. + * + * @return a open stream to the application logs + */ InputStream streamApplicationLogs(); - /** @return a open stream to the HTTP logs */ + /** + * Gets a open stream to the HTTP logs. + * + * @return a open stream to the HTTP logs + */ InputStream streamHttpLogs(); - /** @return a open stream to the trace logs */ + /** + * Gets a open stream to the trace logs. + * + * @return a open stream to the trace logs + */ InputStream streamTraceLogs(); - /** @return a open stream to the deployment logs */ + /** + * Gets a open stream to the deployment logs. + * + * @return a open stream to the deployment logs + */ InputStream streamDeploymentLogs(); - /** @return a open stream to all logs */ + /** + * Gets an open stream to all logs. + * + * @return an open stream to all logs + */ InputStream streamAllLogs(); - /** @return an Observable streaming application logs */ + /** + * Gets an Observable streaming application logs. + * + * @return an Observable streaming application logs + */ Flux streamApplicationLogsAsync(); - /** @return an Observable streaming HTTP logs */ + /** + * Gets an Observable streaming HTTP logs + * + * @return an Observable streaming HTTP logs + */ Flux streamHttpLogsAsync(); - /** @return an Observable streaming trace logs */ + /** + * Gets an Observable streaming trace logs. + * + * @return an Observable streaming trace logs + */ Flux streamTraceLogsAsync(); - /** @return an Observable streaming deployment logs */ + /** + * Gets an Observable streaming deployment logs. + * + * @return an Observable streaming deployment logs + */ Flux streamDeploymentLogsAsync(); - /** @return an Observable streaming all logs */ + /** + * Gets an Observable streaming all logs. + * + * @return an Observable streaming all logs + */ Flux streamAllLogsAsync(); /** @@ -874,7 +1091,11 @@ interface WithSystemAssignedIdentityBasedAccessOrCreate extends WithCre withSystemAssignedIdentityBasedAccessToCurrentResourceGroup(String roleDefinitionId); } - /** The stage of the web app definition allowing to add User Assigned (External) Managed Service Identities. */ + /** + * The stage of the web app definition allowing to add User Assigned (External) Managed Service Identities. + * + * @param the type of the resource + */ interface WithUserAssignedManagedServiceIdentityBasedAccessOrCreate extends WithCreate { /** * Specifies the definition of a not-yet-created user assigned identity to be associated with the web app. @@ -903,7 +1124,11 @@ interface WithUserAssignedManagedServiceIdentityBasedAccessOrCreate ext Update withoutUserAssignedManagedServiceIdentity(String identityId); } - /** The stage of web app definition allowing to configure network access settings. */ + /** + * The stage of web app definition allowing to configure network access settings. + * + * @param the type of the resource + */ interface WithNetworkAccess { /** * Specifies that access to the web app from the specific virtual network subnet should be allowed. @@ -954,7 +1179,11 @@ interface WithNetworkAccess { WithCreate disablePublicNetworkAccess(); } - /** The stage of web app definition allowing to configure container size. */ + /** + * The stage of web app definition allowing to configure container size. + * + * @param the type of the resource + */ interface WithContainerSize { /** * Specifies the the amount of memory allocated to each instance of the function app, measured in mebibytes. @@ -1565,7 +1794,11 @@ interface WithSystemAssignedIdentityBasedAccess { Update withSystemAssignedIdentityBasedAccessToCurrentResourceGroup(String roleDefinitionId); } - /** The stage of the web app update allowing to add User Assigned (External) Managed Service Identities. */ + /** + * The stage of the web app update allowing to add User Assigned (External) Managed Service Identities. + * + * @param the type of the resource + */ interface WithUserAssignedManagedServiceIdentityBasedAccess { /** * Specifies the definition of a not-yet-created user assigned identity to be associated with the web app. @@ -1584,7 +1817,11 @@ interface WithUserAssignedManagedServiceIdentityBasedAccess { Update withExistingUserAssignedManagedServiceIdentity(Identity identity); } - /** The stage of web app update allowing to configure network access. */ + /** + * The stage of web app update allowing to configure network access. + * + * @param the type of the resource + */ interface WithNetworkAccess { /** * Specifies that access to web app should be allowed from all networks. @@ -1683,7 +1920,11 @@ interface WithNetworkAccess { Update disablePublicNetworkAccess(); } - /** The stage of web app update allowing to configure container size. */ + /** + * The stage of web app update allowing to configure container size. + * + * @param the type of the resource + */ interface WithContainerSize { /** * Specifies the the amount of memory allocated to each instance of the function app, measured in mebibytes. diff --git a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebAppDiagnosticLogs.java b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebAppDiagnosticLogs.java index 06466ba144070..7aeb2a8509c26 100644 --- a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebAppDiagnosticLogs.java +++ b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebAppDiagnosticLogs.java @@ -14,34 +14,74 @@ /** A web app diagnostic log configuration in a web app. */ @Fluent public interface WebAppDiagnosticLogs extends HasInnerModel, Indexable, HasParent { - /** @return application log level on file system */ + /** + * Gets application log level on file system. + * + * @return application log level on file system + */ LogLevel applicationLoggingFileSystemLogLevel(); - /** @return Azure Storage Blob container URL for storing application logs */ + /** + * Gets Azure Storage Blob container URL for storing application logs. + * + * @return Azure Storage Blob container URL for storing application logs + */ String applicationLoggingStorageBlobContainer(); - /** @return application log level on Azure Storage Blob */ + /** + * Gets application log level on Azure Storage Blob. + * + * @return application log level on Azure Storage Blob + */ LogLevel applicationLoggingStorageBlobLogLevel(); - /** @return application log retention days on Azure Storage Blob */ + /** + * Gets application log retention days on Azure Storage Blob. + * + * @return application log retention days on Azure Storage Blob + */ int applicationLoggingStorageBlobRetentionDays(); - /** @return web server quota in MB on file system */ + /** + * Gets web server quota in MB on file system. + * + * @return web server quota in MB on file system + */ int webServerLoggingFileSystemQuotaInMB(); - /** @return web server log retention days on file system */ + /** + * Gets web server log retention days on file system. + * + * @return web server log retention days on file system + */ int webServerLoggingFileSystemRetentionDays(); - /** @return web server log retention days on Azure Storage Blob */ + /** + * Gets web server log retention days on Azure Storage Blob. + * + * @return web server log retention days on Azure Storage Blob + */ int webServerLoggingStorageBlobRetentionDays(); - /** @return Azure Storage Blob container URL for storing web server logs */ + /** + * Gets Azure Storage Blob container URL for storing web server logs. + * + * @return Azure Storage Blob container URL for storing web server logs + */ String webServerLoggingStorageBlobContainer(); - /** @return if diagnostic information on failed requests should be gathered */ + /** + * Check whether diagnostic information on failed requests should be gathered. + * + * @return if diagnostic information on failed requests should be gathered + */ boolean failedRequestsTracing(); - /** @return if detailed error messages should be gathered */ + /** + * Check whether detailed error messages should be gathered. + * + * @return if detailed error messages should be gathered + */ boolean detailedErrorMessages(); /** diff --git a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebAppRuntimeStack.java b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebAppRuntimeStack.java index f6b3fd5010e17..4d269be703442 100644 --- a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebAppRuntimeStack.java +++ b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebAppRuntimeStack.java @@ -36,7 +36,11 @@ public WebAppRuntimeStack(String runtime) { this.runtime = Objects.requireNonNull(runtime); } - /** @return the name of the language runtime */ + /** + * Gets the name of the language runtime. + * + * @return the name of the language runtime + */ public String runtime() { return runtime; } diff --git a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebAppSourceControl.java b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebAppSourceControl.java index 4da3f33ba2fda..e5d98cab223be 100644 --- a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebAppSourceControl.java +++ b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebAppSourceControl.java @@ -11,19 +11,39 @@ /** An immutable representation of a web app source control configuration in a web app. */ @Fluent public interface WebAppSourceControl extends HasInnerModel, ChildResource { - /** @return the repository or source control url */ + /** + * Gets the repository or source control url. + * + * @return the repository or source control url + */ String repositoryUrl(); - /** @return the name of the branch to use for deployment */ + /** + * Gets the name of the branch to use for deployment. + * + * @return the name of the branch to use for deployment + */ String branch(); - /** @return whether to do manual or continuous integration */ + /** + * Check whether to do manual or continuous integration. + * + * @return whether to do manual or continuous integration + */ boolean isManualIntegration(); - /** @return whether deployment rollback is enabled */ + /** + * Check whether deployment rollback is enabled. + * + * @return whether deployment rollback is enabled + */ boolean deploymentRollbackEnabled(); - /** @return mercurial or Git repository type */ + /** + * Gets mercurial or Git repository type. + * + * @return mercurial or Git repository type + */ RepositoryType repositoryType(); /** diff --git a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebContainer.java b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebContainer.java index e1f6d7eea9804..82b54324deb84 100644 --- a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebContainer.java +++ b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebContainer.java @@ -72,6 +72,15 @@ public final class WebContainer extends ExpandableStringEnum { /** Static value java 8 for WebContainer. */ public static final WebContainer JAVA_8 = WebContainer.fromString("java 8"); + /** + * Creates a new instance of WebContainer value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public WebContainer() { + } + /** * Finds or creates a Web container based on the specified name. * @@ -82,7 +91,11 @@ public static WebContainer fromString(String name) { return fromString(name, WebContainer.class); } - /** @return known Web container types */ + /** + * Gets known Web container types. + * + * @return known Web container types + */ public static Collection values() { return values(WebContainer.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebDeployment.java b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebDeployment.java index 0f8f67b3c10b5..1719425bc51ee 100644 --- a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebDeployment.java +++ b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebDeployment.java @@ -10,16 +10,32 @@ /** A client-side representation allowing user to deploy to a web app through web deployment (MSDeploy). */ @Fluent public interface WebDeployment extends Executable, HasParent { - /** @return username of the deployer */ + /** + * Gets username of the deployer. + * + * @return username of the deployer + */ String deployer(); - /** @return the start time of the deploy operation */ + /** + * Gets the start time of the deploy operation. + * + * @return the start time of the deploy operation + */ OffsetDateTime startTime(); - /** @return the end time of the deploy operation */ + /** + * Gest the end time of the deploy operation. + * + * @return the end time of the deploy operation + */ OffsetDateTime endTime(); - /** @return whether the deployment operation has completed */ + /** + * Check whether the deployment operation has completed. + * + * @return whether the deployment operation has completed + */ boolean complete(); /** The entirety of web deployment parameters definition. */ diff --git a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebSiteBase.java b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebSiteBase.java index 9d96f2620c987..22ce10a258fbe 100644 --- a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebSiteBase.java +++ b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebSiteBase.java @@ -17,78 +17,160 @@ */ public interface WebSiteBase extends Resource, HasResourceGroup, HasInnerModel { - /** @return state of the web app */ + /** + * Gets state of the web app. + * + * @return state of the web app + */ String state(); - /** @return hostnames associated with web app */ + /** + * Gets hostnames associated with web app. + * + * @return hostnames associated with web app + */ Set hostnames(); - /** @return name of repository site */ + /** + * Gets name of repository site. + * + * @return name of repository site + */ String repositorySiteName(); - /** @return state indicating whether web app has exceeded its quota usage */ + /** + * Gets state indicating whether web app has exceeded its quota usage. + * + * @return state indicating whether web app has exceeded its quota usage + */ UsageState usageState(); - /** @return true if the site is enabled; otherwise, false */ + /** + * Check whether the site is enabled. + * + * @return true if the site is enabled; otherwise, false + */ boolean enabled(); - /** @return host names for the web app that are enabled */ + /** + * Gets host names for the web app that are enabled. + * + * @return host names for the web app that are enabled + */ Set enabledHostNames(); - /** @return management information availability state for the web app */ + /** + * Gets management information availability state for the web app. + * + * @return management information availability state for the web app + */ SiteAvailabilityState availabilityState(); - /** @return list of SSL states used to manage the SSL bindings for site's hostnames */ + /** + * Gets list of SSL states used to manage the SSL bindings for site's hostnames. + * + * @return list of SSL states used to manage the SSL bindings for site's hostnames + */ Map hostnameSslStates(); - /** @return Last time web app was modified in UTC */ + /** + * Gets last time web app was modified in UTC. + * + * @return Last time web app was modified in UTC + */ OffsetDateTime lastModifiedTime(); - /** @return list of Azure Traffic manager host names associated with web app */ + /** + * Gets list of Azure Traffic manager host names associated with web app. + * + * @return list of Azure Traffic manager host names associated with web app + */ Set trafficManagerHostNames(); - /** @return whether to stop SCM (KUDU) site when the web app is stopped. Default is false. */ + /** + * Check whether to stop SCM (KUDU) site when the web app is stopped. + * + * @return whether to stop SCM (KUDU) site when the web app is stopped. Default is false. + */ boolean scmSiteAlsoStopped(); - /** @return which slot this app will swap into */ + /** + * Gets which slot this app will swap into. + * + * @return which slot this app will swap into + */ String targetSwapSlot(); /** + * Check whether the client affinity is enabled when load balancing http request for multiple instances of the web app. + * * @return if the client affinity is enabled when load balancing http request for multiple instances of the web app */ boolean clientAffinityEnabled(); - /** @return if the client certificate is enabled for the web app */ + /** + * Check whether the client certificate is enabled for the web app. + * + * @return if the client certificate is enabled for the web app + */ boolean clientCertEnabled(); /** + * Check whether the public hostnames are disabled for the web app. + * * @return if the public hostnames are disabled the web app. If set to true the app is only accessible via API * Management process. */ boolean hostnamesDisabled(); /** + * Gets list of IP addresses that this web app uses for outbound connections. + * * @return list of IP addresses that this web app uses for outbound connections. Those can be used when configuring * firewall rules for databases accessed by this web app. */ Set outboundIPAddresses(); - /** @return size of a function container */ + /** + * Gets size of a function container. + * + * @return size of a function container + */ int containerSize(); - /** @return information about whether the web app is cloned from another */ + /** + * Gets information about whether the web app is cloned from another. + * + * @return information about whether the web app is cloned from another + */ CloningInfo cloningInfo(); - /** @return site is a default container */ + /** + * Check whether site is a default container. + * + * @return site is a default container + */ boolean isDefaultContainer(); - /** @return default hostname of the web app */ + /** + * Gets default hostname of the web app. + * + * @return default hostname of the web app + */ String defaultHostname(); - /** @return true if the web app is configured to accept only HTTPS requests. HTTP requests will be redirected. */ + /** + * Check whether the web app is configured to accept only HTTPS requests. + * + * @return true if the web app is configured to accept only HTTPS requests. HTTP requests will be redirected. + */ boolean httpsOnly(); - /** @return The resource ID of the app service plan */ + /** + * Gets the resource ID of the app service plan. + * + * @return The resource ID of the app service plan + */ String appServicePlanId(); /** @@ -162,6 +244,10 @@ public interface WebSiteBase extends Resource, HasResourceGroup, HasInnerModel com.azure.json,com.azure.core.*,*.fluent:,*.fluent*: - - diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/AuthorizationManager.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/AuthorizationManager.java index 159adef60b86b..c2e2f9e2c80e7 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/AuthorizationManager.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/AuthorizationManager.java @@ -128,6 +128,8 @@ private AuthorizationManager(HttpPipeline httpPipeline, AzureProfile profile) { } /** + * Gets wrapped inner authorization client. + * * @return wrapped inner authorization client providing direct access to auto-generated API implementation, based on * Azure REST API */ @@ -135,17 +137,29 @@ public AuthorizationManagementClient roleServiceClient() { return authorizationManagementClient; } - /** @return the tenant ID the graph client is associated with */ + /** + * Gets the tenant ID the graph client is associated with. + * + * @return the tenant ID the graph client is associated with + */ public String tenantId() { return tenantId; } - /** @return the environment the graph client is associated with */ + /** + * Gets the environment the graph client is associated with. + * + * @return the environment the graph client is associated with + */ public AzureEnvironment environment() { return environment; } - /** @return the {@link ResourceManagerUtils.InternalRuntimeContext} associated with this manager */ + /** + * Gets the {@link ResourceManagerUtils.InternalRuntimeContext} associated with this manager. + * + * @return the {@link ResourceManagerUtils.InternalRuntimeContext} associated with this manager + */ public ResourceManagerUtils.InternalRuntimeContext internalContext() { if (internalContext == null) { internalContext = new ResourceManagerUtils.InternalRuntimeContext(); @@ -153,7 +167,11 @@ public ResourceManagerUtils.InternalRuntimeContext internalContext() { return internalContext; } - /** @return the Active Directory user management API entry point */ + /** + * Gets the Active Directory user management API entry point. + * + * @return the Active Directory user management API entry point + */ public ActiveDirectoryUsers users() { if (activeDirectoryUsers == null) { activeDirectoryUsers = new ActiveDirectoryUsersImpl(this); @@ -161,7 +179,11 @@ public ActiveDirectoryUsers users() { return activeDirectoryUsers; } - /** @return the Active Directory group management API entry point */ + /** + * Gets the Active Directory group management API entry point. + * + * @return the Active Directory group management API entry point + */ public ActiveDirectoryGroups groups() { if (activeDirectoryGroups == null) { activeDirectoryGroups = new ActiveDirectoryGroupsImpl(this); @@ -169,7 +191,11 @@ public ActiveDirectoryGroups groups() { return activeDirectoryGroups; } - /** @return the service principal management API entry point */ + /** + * Gets the service principal management API entry point. + * + * @return the service principal management API entry point + */ public ServicePrincipals servicePrincipals() { if (servicePrincipals == null) { servicePrincipals = new ServicePrincipalsImpl(this); @@ -177,7 +203,11 @@ public ServicePrincipals servicePrincipals() { return servicePrincipals; } - /** @return the application management API entry point */ + /** + * Gets the application management API entry point. + * + * @return the application management API entry point + */ public ActiveDirectoryApplications applications() { if (applications == null) { applications = new ActiveDirectoryApplicationsImpl(this); @@ -185,7 +215,11 @@ public ActiveDirectoryApplications applications() { return applications; } - /** @return the role assignment management API entry point */ + /** + * Gets the role assignment management API entry point. + * + * @return the role assignment management API entry point + */ public RoleAssignments roleAssignments() { if (roleAssignments == null) { roleAssignments = new RoleAssignmentsImpl(this); @@ -193,7 +227,11 @@ public RoleAssignments roleAssignments() { return roleAssignments; } - /** @return the role definition management API entry point */ + /** + * Gets the role definition management API entry point. + * + * @return the role definition management API entry point + */ public RoleDefinitions roleDefinitions() { if (roleDefinitions == null) { roleDefinitions = new RoleDefinitionsImpl(this); diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ActiveDirectoryApplication.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ActiveDirectoryApplication.java index cc9041e7b6380..b1386a7e7765f 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ActiveDirectoryApplication.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ActiveDirectoryApplication.java @@ -18,7 +18,11 @@ @Fluent public interface ActiveDirectoryApplication extends ActiveDirectoryObject, HasInnerModel, Updatable { - /** @return the application ID */ + /** + * Gets the application ID. + * + * @return the application ID + */ String applicationId(); /** @@ -29,23 +33,45 @@ public interface ActiveDirectoryApplication extends ActiveDirectoryObject, boolean availableToOtherTenants(); /** + * Gets the application account type. + * * @return the application account type */ ApplicationAccountType accountType(); - /** @return a collection of URIs for the application */ + /** + * Gets a collection of URIs for the application. + * + * @return a collection of URIs for the application + */ Set identifierUris(); - /** @return a collection of reply URLs for the application */ + /** + * Gets a collection of reply URLs for the application. + * + * @return a collection of reply URLs for the application + */ Set replyUrls(); - /** @return the home page of the application */ + /** + * Gets the home page of the application. + * + * @return the home page of the application + */ URL signOnUrl(); - /** @return the mapping of password credentials from their names */ + /** + * Gets the mapping of password credentials from their names. + * + * @return the mapping of password credentials from their names + */ Map passwordCredentials(); - /** @return the mapping of certificate credentials from their names */ + /** + * Gets the mapping of certificate credentials from their names. + * + * @return the mapping of certificate credentials from their names + */ Map certificateCredentials(); /************************************************************** diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ActiveDirectoryGroup.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ActiveDirectoryGroup.java index 9054f488c2cd9..363c431fc123a 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ActiveDirectoryGroup.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ActiveDirectoryGroup.java @@ -17,10 +17,18 @@ @Fluent public interface ActiveDirectoryGroup extends ActiveDirectoryObject, HasInnerModel, Updatable { - /** @return security enabled field. */ + /** + * Check whether security enabled field. + * + * @return security enabled field. + */ boolean securityEnabled(); - /** @return mail field. */ + /** + * Gets mail field. + * + * @return mail field. + */ String mail(); /** diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ActiveDirectoryUser.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ActiveDirectoryUser.java index 9e293c1b3e7da..7c47069848810 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ActiveDirectoryUser.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ActiveDirectoryUser.java @@ -15,16 +15,32 @@ @Fluent public interface ActiveDirectoryUser extends ActiveDirectoryObject, HasInnerModel, Updatable { - /** @return user principal name */ + /** + * Gets user principal name. + * + * @return user principal name + */ String userPrincipalName(); - /** @return user mail */ + /** + * Gets user mail. + * + * @return user mail + */ String mail(); - /** @return the mail alias for the user */ + /** + * Gets the mail alias for the user. + * + * @return the mail alias for the user + */ String mailNickname(); - /** @return the usage location of the user */ + /** + * Gets the usage location of the user. + * + * @return the usage location of the user + */ CountryIsoCode usageLocation(); /************************************************************** diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ApplicationAccountType.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ApplicationAccountType.java index d1c0e87ee15d3..bc6f5daf7e7f5 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ApplicationAccountType.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ApplicationAccountType.java @@ -23,6 +23,15 @@ public final class ApplicationAccountType extends ExpandableStringEnum values() { return values(ApplicationAccountType.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/BuiltInRole.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/BuiltInRole.java index 9c643490675df..1cd5f670b61c7 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/BuiltInRole.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/BuiltInRole.java @@ -234,6 +234,15 @@ public final class BuiltInRole extends ExpandableStringEnum { /** Read and create quota requests, get quota request status, and create support tickets. */ public static final BuiltInRole QUOTA_REQUEST_OPERATOR = BuiltInRole.fromString("Quota Request Operator"); + /** + * Creates a new instance of BuiltInRole value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public BuiltInRole() { + } + /** * Finds or creates a role instance based on the specified name. * @@ -244,7 +253,10 @@ public static BuiltInRole fromString(String name) { return fromString(name, BuiltInRole.class); } - /** @return known roles */ + /** + * Gets known roles. + * + * @return known roles */ public static Collection values() { return values(BuiltInRole.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/CertificateCredential.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/CertificateCredential.java index b59fbe3a6337d..d732a6239ba77 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/CertificateCredential.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/CertificateCredential.java @@ -122,7 +122,11 @@ interface WithDuration { WithAttach withDuration(Duration duration); } - /** A credential definition stage allowing exporting the auth file for the service principal. */ + /** + * A credential definition stage allowing exporting the auth file for the service principal. + * + * @param the stage of the parent definition to return to after attaching this definition + */ interface WithAuthFile { /** * Export the information of this service principal into an auth file. @@ -135,7 +139,10 @@ interface WithAuthFile { WithAuthFileCertificate withAuthFileToExport(OutputStream outputStream); } - /** A credential definition stage allowing specifying the private key for exporting an auth file. */ + /** A credential definition stage allowing specifying the private key for exporting an auth file. + * + * @param the stage of the parent definition to return to after attaching this definition + */ interface WithAuthFileCertificate { /** * Export the information of this service principal into an auth file. @@ -149,6 +156,8 @@ interface WithAuthFileCertificate { /** * A credential definition stage allowing specifying the password for the private key for exporting an auth * file. + * + * @param the stage of the parent definition to return to after attaching this definition */ interface WithAuthFileCertificatePassword { /** diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/CertificateType.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/CertificateType.java index 49d0317f13641..ff7ea8b1eec40 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/CertificateType.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/CertificateType.java @@ -15,6 +15,15 @@ public final class CertificateType extends ExpandableStringEnum /** Static value Symmetric for CertificateType. */ public static final CertificateType SYMMETRIC = CertificateType.fromString("Symmetric"); + /** + * Creates a new instance of CertificateType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CertificateType() { + } + /** * Finds or creates a certificate type instance based on the specified name. * @@ -25,7 +34,11 @@ public static CertificateType fromString(String name) { return fromString(name, CertificateType.class); } - /** @return known certificate types */ + /** + * Gets known certificate types. + * + * @return known certificate types + */ public static Collection values() { return values(CertificateType.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/Credential.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/Credential.java index ca1af02ceddd1..fa735558850c4 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/Credential.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/Credential.java @@ -12,12 +12,24 @@ /** An immutable client-side representation of an Azure AD credential. */ @Fluent public interface Credential extends Indexable, HasId, HasName { - /** @return start date. */ + /** + * Gets start date. + * + * @return start date. + */ OffsetDateTime startDate(); - /** @return end date. */ + /** + * Gets end date. + * + * @return end date. + */ OffsetDateTime endDate(); - /** @return key value. */ + /** + * Gets key value. + * + * @return key value. + */ String value(); } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/Permission.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/Permission.java index 4d8bba5fa3b26..41670b5a0f6ca 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/Permission.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/Permission.java @@ -9,15 +9,31 @@ /** An immutable client-side representation of a permission. */ public interface Permission extends HasInnerModel { - /** @return allowed actions */ + /** + * Gets allowed actions. + * + * @return allowed actions + */ List actions(); - /** @return denied actions */ + /** + * Gets denied actions. + * + * @return denied actions + */ List notActions(); - /** @return allowed Data actions */ + /** + * Gets allowed Data actions. + * + * @return allowed Data actions + */ List dataActions(); - /** @return denied Data actions */ + /** + * Gets denied Data actions. + * + * @return denied Data actions + */ List notDataActions(); } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/RoleAssignment.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/RoleAssignment.java index a281b7e96a5d7..e7f824c2eae9b 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/RoleAssignment.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/RoleAssignment.java @@ -19,13 +19,25 @@ @Fluent public interface RoleAssignment extends Indexable, HasInnerModel, HasId, HasName, HasManager { - /** @return the role assignment scope */ + /** + * Gets the role assignment scope. + * + * @return the role assignment scope + */ String scope(); - /** @return the role definition ID */ + /** + * Gets the role definition ID. + * + * @return the role definition ID + */ String roleDefinitionId(); - /** @return the principal ID */ + /** + * Gets the principal ID. + * + * @return the principal ID + */ String principalId(); /** diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/RoleDefinition.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/RoleDefinition.java index 3d93b872a71ef..626f7b0089324 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/RoleDefinition.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/RoleDefinition.java @@ -16,18 +16,38 @@ @Fluent public interface RoleDefinition extends HasInnerModel, HasId, HasName, HasManager { - /** @return the role name */ + /** + * Gets the role name. + * + * @return the role name + */ String roleName(); - /** @return the role definition description */ + /** + * Gets the role definition description. + * + * @return the role definition description + */ String description(); - /** @return the role type */ + /** + * Gets the role type. + * + * @return the role type + */ String type(); - /** @return role definition permissions */ + /** + * Gets role definition permissions + * + * @return role definition permissions + */ Set permissions(); - /** @return role definition assignable scopes */ + /** + * Gets role definition assignable scopes + * + * @return role definition assignable scopes + */ Set assignableScopes(); } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ServicePrincipal.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ServicePrincipal.java index 99db96377d33f..db1975315cfa1 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ServicePrincipal.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/models/ServicePrincipal.java @@ -19,19 +19,39 @@ @Fluent public interface ServicePrincipal extends ActiveDirectoryObject, HasInnerModel, Updatable { - /** @return app id. */ + /** + * Gets app id. + * + * @return app id. + */ String applicationId(); - /** @return the list of names. */ + /** + * Gets the list of names. + * + * @return the list of names. + */ List servicePrincipalNames(); - /** @return the mapping of password credentials from their names */ + /** + * Gets the mapping of password credentials from their names. + * + * @return the mapping of password credentials from their names + */ Map passwordCredentials(); - /** @return the mapping of certificate credentials from their names */ + /** + * Gets the mapping of certificate credentials from their names. + * + * @return the mapping of certificate credentials from their names + */ Map certificateCredentials(); - /** @return the mapping from scopes to role assignments */ + /** + * Gets the mapping from scopes to role assignments. + * + * @return the mapping from scopes to role assignments + */ Set roleAssignments(); /************************************************************** diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/utils/RoleAssignmentHelper.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/utils/RoleAssignmentHelper.java index d3902e459d7f3..249739011fd7b 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/utils/RoleAssignmentHelper.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/utils/RoleAssignmentHelper.java @@ -28,10 +28,18 @@ public class RoleAssignmentHelper { * assignments needs to be done. */ public interface IdProvider { - /** @return the service principal id (object id) */ + /** + * Gets the service principal id (object id). + * + * @return the service principal id (object id) + */ String principalId(); - /** @return ARM resource id of the resource */ + /** + * Gets ARM resource id of the resource. + * + * @return ARM resource id of the resource + */ String resourceId(); } diff --git a/sdk/resourcemanager/azure-resourcemanager-cdn/pom.xml b/sdk/resourcemanager/azure-resourcemanager-cdn/pom.xml index f077e51b3eef9..75d9a6a164668 100644 --- a/sdk/resourcemanager/azure-resourcemanager-cdn/pom.xml +++ b/sdk/resourcemanager/azure-resourcemanager-cdn/pom.xml @@ -45,7 +45,6 @@ --add-opens com.azure.core/com.azure.core.implementation.util=ALL-UNNAMED - - diff --git a/sdk/resourcemanager/azure-resourcemanager-cdn/src/main/java/com/azure/resourcemanager/cdn/CdnManager.java b/sdk/resourcemanager/azure-resourcemanager-cdn/src/main/java/com/azure/resourcemanager/cdn/CdnManager.java index c5830ffc26c2c..571010f462fc8 100644 --- a/sdk/resourcemanager/azure-resourcemanager-cdn/src/main/java/com/azure/resourcemanager/cdn/CdnManager.java +++ b/sdk/resourcemanager/azure-resourcemanager-cdn/src/main/java/com/azure/resourcemanager/cdn/CdnManager.java @@ -92,6 +92,8 @@ private CdnManager(HttpPipeline httpPipeline, AzureProfile profile) { } /** + * Gets entry point to CDN manager profile management. + * * @return entry point to CDN manager profile management */ public CdnProfiles profiles() { diff --git a/sdk/resourcemanager/azure-resourcemanager-cdn/src/main/java/com/azure/resourcemanager/cdn/models/AzureFirstPartyManagedCertificateParameters.java b/sdk/resourcemanager/azure-resourcemanager-cdn/src/main/java/com/azure/resourcemanager/cdn/models/AzureFirstPartyManagedCertificateParameters.java index 331cfd45a22ab..dc715e19c59b7 100644 --- a/sdk/resourcemanager/azure-resourcemanager-cdn/src/main/java/com/azure/resourcemanager/cdn/models/AzureFirstPartyManagedCertificateParameters.java +++ b/sdk/resourcemanager/azure-resourcemanager-cdn/src/main/java/com/azure/resourcemanager/cdn/models/AzureFirstPartyManagedCertificateParameters.java @@ -23,10 +23,7 @@ public final class AzureFirstPartyManagedCertificateParameters extends SecretPar /* * Resource reference to the Azure Key Vault certificate. Expected to be in format of - * /subscriptions/{​​​​​​​​​subscriptionId}​​​​​​​​​/resourceGroups/{​​​​​​​​​resourceGroupName} - * ​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/providers/Microsoft.KeyVault/vaults/{vaultName} - * ​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/secrets/{certificateName} - * ​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​ + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/secrets/{certificateName} */ private ResourceReference secretSource; @@ -63,7 +60,7 @@ public AzureFirstPartyManagedCertificateParameters() { /** * Get the type property: The type of the secret resource. - * + * * @return the type value. */ @Override @@ -73,8 +70,8 @@ public SecretType type() { /** * Get the secretSource property: Resource reference to the Azure Key Vault certificate. Expected to be in format of - * /subscriptions/{​​​​​​​​​subscriptionId}​​​​​​​​​/resourceGroups/{​​​​​​​​​resourceGroupName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/providers/Microsoft.KeyVault/vaults/{vaultName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/secrets/{certificateName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​. - * + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/secrets/{certificateName}. + * * @return the secretSource value. */ public ResourceReference secretSource() { @@ -83,7 +80,7 @@ public ResourceReference secretSource() { /** * Get the subject property: Subject name in the certificate. - * + * * @return the subject value. */ public String subject() { @@ -92,7 +89,7 @@ public String subject() { /** * Get the expirationDate property: Certificate expiration date. - * + * * @return the expirationDate value. */ public String expirationDate() { @@ -101,7 +98,7 @@ public String expirationDate() { /** * Get the certificateAuthority property: Certificate issuing authority. - * + * * @return the certificateAuthority value. */ public String certificateAuthority() { @@ -110,7 +107,7 @@ public String certificateAuthority() { /** * Get the subjectAlternativeNames property: The list of SANs. - * + * * @return the subjectAlternativeNames value. */ public List subjectAlternativeNames() { @@ -119,7 +116,7 @@ public List subjectAlternativeNames() { /** * Set the subjectAlternativeNames property: The list of SANs. - * + * * @param subjectAlternativeNames the subjectAlternativeNames value to set. * @return the AzureFirstPartyManagedCertificateParameters object itself. */ @@ -131,7 +128,7 @@ public List subjectAlternativeNames() { /** * Get the thumbprint property: Certificate thumbprint. - * + * * @return the thumbprint value. */ public String thumbprint() { @@ -140,7 +137,7 @@ public String thumbprint() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -165,7 +162,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { /** * Reads an instance of AzureFirstPartyManagedCertificateParameters from the JsonReader. - * + * * @param jsonReader The JsonReader being read. * @return An instance of AzureFirstPartyManagedCertificateParameters if the JsonReader was pointing to an instance * of it, or null if it was pointing to JSON null. diff --git a/sdk/resourcemanager/azure-resourcemanager-cdn/src/main/java/com/azure/resourcemanager/cdn/models/CdnEndpoint.java b/sdk/resourcemanager/azure-resourcemanager-cdn/src/main/java/com/azure/resourcemanager/cdn/models/CdnEndpoint.java index 5c76cf56f585f..dcf513ae72933 100644 --- a/sdk/resourcemanager/azure-resourcemanager-cdn/src/main/java/com/azure/resourcemanager/cdn/models/CdnEndpoint.java +++ b/sdk/resourcemanager/azure-resourcemanager-cdn/src/main/java/com/azure/resourcemanager/cdn/models/CdnEndpoint.java @@ -23,81 +23,113 @@ public interface CdnEndpoint extends ExternalChildResource, HasInnerModel { /** + * Gets origin host header. + * * @return origin host header */ String originHostHeader(); /** + * Gets origin path. + * * @return origin path */ String originPath(); /** + * Gets content types to be compressed. + * * @return content types to be compressed */ Set contentTypesToCompress(); /** + * Check whether content compression is enabled. + * * @return true if content compression is enabled, otherwise false */ boolean isCompressionEnabled(); /** + * Check whether HTTP traffic is allowed. + * * @return true if HTTP traffic is allowed, otherwise false. */ boolean isHttpAllowed(); /** + * Check whether HTTPS traffic is allowed. + * * @return true if HTTPS traffic is allowed, otherwise false */ boolean isHttpsAllowed(); /** + * Gets query string caching behavior. + * * @return query string caching behavior */ QueryStringCachingBehavior queryStringCachingBehavior(); /** + * Gets optimization type. + * * @return optimization type */ String optimizationType(); /** + * Gets list of Geo filters. + * * @return list of Geo filters */ Collection geoFilters(); /** + * Gets endpoint host name. + * * @return endpoint host name */ String hostname(); /** + * Gets endpoint state. + * * @return endpoint state */ EndpointResourceState resourceState(); /** + * Gets endpoint provisioning state. + * * @return endpoint provisioning state */ String provisioningState(); /** + * Gets origin host nam. + * * @return origin host name */ String originHostName(); /** + * Gets HTTP port value. + * * @return HTTP port value */ int httpPort(); /** + * Gets HTTPS port value. + * * @return HTTPS port value */ int httpsPort(); /** + * Gets custom domains associated with this endpoint. + * * @return custom domains associated with this endpoint */ Set customDomains(); @@ -185,6 +217,8 @@ public interface CdnEndpoint extends ExternalChildResource listResourceUsage(); /** + * Gets the map of the Standard rules engine rules. + * * @return the map of the Standard rules engine rules, indexed by rule name * (note: this is only available for Standard Microsoft CDN Sku endpoints) */ diff --git a/sdk/resourcemanager/azure-resourcemanager-cdn/src/main/java/com/azure/resourcemanager/cdn/models/CdnProfile.java b/sdk/resourcemanager/azure-resourcemanager-cdn/src/main/java/com/azure/resourcemanager/cdn/models/CdnProfile.java index b9fd103d0dad9..64c7c5555785c 100644 --- a/sdk/resourcemanager/azure-resourcemanager-cdn/src/main/java/com/azure/resourcemanager/cdn/models/CdnProfile.java +++ b/sdk/resourcemanager/azure-resourcemanager-cdn/src/main/java/com/azure/resourcemanager/cdn/models/CdnProfile.java @@ -26,11 +26,15 @@ public interface CdnProfile extends GroupableResource, Refreshable, Updatable { /** + * Gets the SKU of the CDN profile. + * * @return the SKU of the CDN profile */ Sku sku(); /** + * Gets CDN profile state. + * * @return CDN profile state */ String resourceState(); @@ -161,11 +165,15 @@ public interface CdnProfile Mono checkEndpointNameAvailabilityAsync(String name); /** + * Check whether this CDN profile's SKU is of Premium Verizon. + * * @return true if this CDN profile's SKU is of Premium Verizon, else false. */ boolean isPremiumVerizon(); /** + * Gets quotas and actual usages of endpoints under the current CDN profile. + * * @return quotas and actual usages of endpoints under the current CDN profile */ PagedIterable listResourceUsage(); diff --git a/sdk/resourcemanager/azure-resourcemanager-cdn/src/main/java/com/azure/resourcemanager/cdn/models/CustomerCertificate.java b/sdk/resourcemanager/azure-resourcemanager-cdn/src/main/java/com/azure/resourcemanager/cdn/models/CustomerCertificate.java index 29f96b5eb6be6..8bb4afc3c74c4 100644 --- a/sdk/resourcemanager/azure-resourcemanager-cdn/src/main/java/com/azure/resourcemanager/cdn/models/CustomerCertificate.java +++ b/sdk/resourcemanager/azure-resourcemanager-cdn/src/main/java/com/azure/resourcemanager/cdn/models/CustomerCertificate.java @@ -18,10 +18,7 @@ public final class CustomerCertificate extends Certificate { /* * Resource reference to the Azure Key Vault certificate. Expected to be in format of - * /subscriptions/{​​​​​​​​​subscriptionId}​​​​​​​​​/resourceGroups/{​​​​​​​​​resourceGroupName} - * ​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/providers/Microsoft.KeyVault/vaults/{vaultName} - * ​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/secrets/{certificateName} - * ​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​ + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/secrets/{certificateName} */ private ResourceReference secretSource; @@ -68,8 +65,8 @@ public CustomerCertificate() { /** * Get the secretSource property: Resource reference to the Azure Key Vault certificate. Expected to be in format of - * /subscriptions/{​​​​​​​​​subscriptionId}​​​​​​​​​/resourceGroups/{​​​​​​​​​resourceGroupName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/providers/Microsoft.KeyVault/vaults/{vaultName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/secrets/{certificateName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​. - * + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/secrets/{certificateName}. + * * @return the secretSource value. */ public ResourceReference secretSource() { @@ -78,8 +75,8 @@ public ResourceReference secretSource() { /** * Set the secretSource property: Resource reference to the Azure Key Vault certificate. Expected to be in format of - * /subscriptions/{​​​​​​​​​subscriptionId}​​​​​​​​​/resourceGroups/{​​​​​​​​​resourceGroupName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/providers/Microsoft.KeyVault/vaults/{vaultName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/secrets/{certificateName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​. - * + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/secrets/{certificateName}. + * * @param secretSource the secretSource value to set. * @return the CustomerCertificate object itself. */ @@ -90,7 +87,7 @@ public CustomerCertificate withSecretSource(ResourceReference secretSource) { /** * Get the secretVersion property: Certificate version. - * + * * @return the secretVersion value. */ public String secretVersion() { @@ -99,7 +96,7 @@ public String secretVersion() { /** * Set the secretVersion property: Certificate version. - * + * * @param secretVersion the secretVersion value to set. * @return the CustomerCertificate object itself. */ @@ -110,7 +107,7 @@ public CustomerCertificate withSecretVersion(String secretVersion) { /** * Get the certificateAuthority property: Certificate issuing authority. - * + * * @return the certificateAuthority value. */ public String certificateAuthority() { @@ -119,7 +116,7 @@ public String certificateAuthority() { /** * Get the useLatestVersion property: Whether to use the latest version for the certificate. - * + * * @return the useLatestVersion value. */ public Boolean useLatestVersion() { @@ -128,7 +125,7 @@ public Boolean useLatestVersion() { /** * Set the useLatestVersion property: Whether to use the latest version for the certificate. - * + * * @param useLatestVersion the useLatestVersion value to set. * @return the CustomerCertificate object itself. */ @@ -139,7 +136,7 @@ public CustomerCertificate withUseLatestVersion(Boolean useLatestVersion) { /** * Get the subjectAlternativeNames property: The list of SANs. - * + * * @return the subjectAlternativeNames value. */ public List subjectAlternativeNames() { @@ -148,7 +145,7 @@ public List subjectAlternativeNames() { /** * Set the subjectAlternativeNames property: The list of SANs. - * + * * @param subjectAlternativeNames the subjectAlternativeNames value to set. * @return the CustomerCertificate object itself. */ @@ -159,7 +156,7 @@ public CustomerCertificate withSubjectAlternativeNames(List subjectAlter /** * Get the thumbprint property: Certificate thumbprint. - * + * * @return the thumbprint value. */ public String thumbprint() { @@ -168,7 +165,7 @@ public String thumbprint() { /** * Get the expirationDate property: Certificate expiration date. - * + * * @return the expirationDate value. */ @Override @@ -178,7 +175,7 @@ public String expirationDate() { /** * Get the subject property: Subject name in the certificate. - * + * * @return the subject value. */ @Override @@ -197,7 +194,7 @@ public CustomerCertificate withType(SecretType type) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -225,7 +222,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { /** * Reads an instance of CustomerCertificate from the JsonReader. - * + * * @param jsonReader The JsonReader being read. * @return An instance of CustomerCertificate if the JsonReader was pointing to an instance of it, or null if it was * pointing to JSON null. diff --git a/sdk/resourcemanager/azure-resourcemanager-cdn/src/main/java/com/azure/resourcemanager/cdn/models/CustomerCertificateParameters.java b/sdk/resourcemanager/azure-resourcemanager-cdn/src/main/java/com/azure/resourcemanager/cdn/models/CustomerCertificateParameters.java index 0c140bf807d9c..8257c96605e42 100644 --- a/sdk/resourcemanager/azure-resourcemanager-cdn/src/main/java/com/azure/resourcemanager/cdn/models/CustomerCertificateParameters.java +++ b/sdk/resourcemanager/azure-resourcemanager-cdn/src/main/java/com/azure/resourcemanager/cdn/models/CustomerCertificateParameters.java @@ -24,10 +24,7 @@ public final class CustomerCertificateParameters extends SecretParameters { /* * Resource reference to the Azure Key Vault certificate. Expected to be in format of - * /subscriptions/{​​​​​​​​​subscriptionId}​​​​​​​​​/resourceGroups/{​​​​​​​​​resourceGroupName} - * ​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/providers/Microsoft.KeyVault/vaults/{vaultName} - * ​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/secrets/{certificateName} - * ​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​ + * /subscriptions/{subscriptionId}/resourceGroups/{sourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/secrets/{certificateName} */ private ResourceReference secretSource; @@ -74,7 +71,7 @@ public CustomerCertificateParameters() { /** * Get the type property: The type of the secret resource. - * + * * @return the type value. */ @Override @@ -84,8 +81,8 @@ public SecretType type() { /** * Get the secretSource property: Resource reference to the Azure Key Vault certificate. Expected to be in format of - * /subscriptions/{​​​​​​​​​subscriptionId}​​​​​​​​​/resourceGroups/{​​​​​​​​​resourceGroupName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/providers/Microsoft.KeyVault/vaults/{vaultName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/secrets/{certificateName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​. - * + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/secrets/{certificateName}. + * * @return the secretSource value. */ public ResourceReference secretSource() { @@ -94,8 +91,8 @@ public ResourceReference secretSource() { /** * Set the secretSource property: Resource reference to the Azure Key Vault certificate. Expected to be in format of - * /subscriptions/{​​​​​​​​​subscriptionId}​​​​​​​​​/resourceGroups/{​​​​​​​​​resourceGroupName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/providers/Microsoft.KeyVault/vaults/{vaultName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/secrets/{certificateName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​. - * + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/secrets/{certificateName}. + * * @param secretSource the secretSource value to set. * @return the CustomerCertificateParameters object itself. */ @@ -106,7 +103,7 @@ public CustomerCertificateParameters withSecretSource(ResourceReference secretSo /** * Get the secretVersion property: Version of the secret to be used. - * + * * @return the secretVersion value. */ public String secretVersion() { @@ -115,7 +112,7 @@ public String secretVersion() { /** * Set the secretVersion property: Version of the secret to be used. - * + * * @param secretVersion the secretVersion value to set. * @return the CustomerCertificateParameters object itself. */ @@ -126,7 +123,7 @@ public CustomerCertificateParameters withSecretVersion(String secretVersion) { /** * Get the useLatestVersion property: Whether to use the latest version for the certificate. - * + * * @return the useLatestVersion value. */ public Boolean useLatestVersion() { @@ -135,7 +132,7 @@ public Boolean useLatestVersion() { /** * Set the useLatestVersion property: Whether to use the latest version for the certificate. - * + * * @param useLatestVersion the useLatestVersion value to set. * @return the CustomerCertificateParameters object itself. */ @@ -146,7 +143,7 @@ public CustomerCertificateParameters withUseLatestVersion(Boolean useLatestVersi /** * Get the subject property: Subject name in the certificate. - * + * * @return the subject value. */ public String subject() { @@ -155,7 +152,7 @@ public String subject() { /** * Get the expirationDate property: Certificate expiration date. - * + * * @return the expirationDate value. */ public String expirationDate() { @@ -164,7 +161,7 @@ public String expirationDate() { /** * Get the certificateAuthority property: Certificate issuing authority. - * + * * @return the certificateAuthority value. */ public String certificateAuthority() { @@ -173,7 +170,7 @@ public String certificateAuthority() { /** * Get the subjectAlternativeNames property: The list of SANs. - * + * * @return the subjectAlternativeNames value. */ public List subjectAlternativeNames() { @@ -182,7 +179,7 @@ public List subjectAlternativeNames() { /** * Set the subjectAlternativeNames property: The list of SANs. - * + * * @param subjectAlternativeNames the subjectAlternativeNames value to set. * @return the CustomerCertificateParameters object itself. */ @@ -193,7 +190,7 @@ public CustomerCertificateParameters withSubjectAlternativeNames(List su /** * Get the thumbprint property: Certificate thumbprint. - * + * * @return the thumbprint value. */ public String thumbprint() { @@ -202,7 +199,7 @@ public String thumbprint() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -236,7 +233,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { /** * Reads an instance of CustomerCertificateParameters from the JsonReader. - * + * * @param jsonReader The JsonReader being read. * @return An instance of CustomerCertificateParameters if the JsonReader was pointing to an instance of it, or null * if it was pointing to JSON null. diff --git a/sdk/resourcemanager/azure-resourcemanager-cdn/src/main/java/com/azure/resourcemanager/cdn/models/UrlSigningKeyParameters.java b/sdk/resourcemanager/azure-resourcemanager-cdn/src/main/java/com/azure/resourcemanager/cdn/models/UrlSigningKeyParameters.java index d05c287db7051..e679f58dae7cd 100644 --- a/sdk/resourcemanager/azure-resourcemanager-cdn/src/main/java/com/azure/resourcemanager/cdn/models/UrlSigningKeyParameters.java +++ b/sdk/resourcemanager/azure-resourcemanager-cdn/src/main/java/com/azure/resourcemanager/cdn/models/UrlSigningKeyParameters.java @@ -29,10 +29,10 @@ public final class UrlSigningKeyParameters extends SecretParameters { /* * Resource reference to the Azure Key Vault secret. Expected to be in format of - * /subscriptions/{​​​​​​​​​subscriptionId}​​​​​​​​​/resourceGroups/{​​​​​​​​​resourceGroupName} - * ​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/providers/Microsoft.KeyVault/vaults/{vaultName} - * ​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/secrets/{secretName} - * ​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​ + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName} + * /providers/Microsoft.KeyVault/vaults/{vaultName} + * /secrets/{secretName} + * */ private ResourceReference secretSource; @@ -49,7 +49,7 @@ public UrlSigningKeyParameters() { /** * Get the type property: The type of the secret resource. - * + * * @return the type value. */ @Override @@ -60,7 +60,7 @@ public SecretType type() { /** * Get the keyId property: Defines the customer defined key Id. This id will exist in the incoming request to * indicate the key used to form the hash. - * + * * @return the keyId value. */ public String keyId() { @@ -70,7 +70,7 @@ public String keyId() { /** * Set the keyId property: Defines the customer defined key Id. This id will exist in the incoming request to * indicate the key used to form the hash. - * + * * @param keyId the keyId value to set. * @return the UrlSigningKeyParameters object itself. */ @@ -81,8 +81,8 @@ public UrlSigningKeyParameters withKeyId(String keyId) { /** * Get the secretSource property: Resource reference to the Azure Key Vault secret. Expected to be in format of - * /subscriptions/{​​​​​​​​​subscriptionId}​​​​​​​​​/resourceGroups/{​​​​​​​​​resourceGroupName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/providers/Microsoft.KeyVault/vaults/{vaultName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/secrets/{secretName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​. - * + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/secrets/{secretName}. + * * @return the secretSource value. */ public ResourceReference secretSource() { @@ -91,8 +91,8 @@ public ResourceReference secretSource() { /** * Set the secretSource property: Resource reference to the Azure Key Vault secret. Expected to be in format of - * /subscriptions/{​​​​​​​​​subscriptionId}​​​​​​​​​/resourceGroups/{​​​​​​​​​resourceGroupName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/providers/Microsoft.KeyVault/vaults/{vaultName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/secrets/{secretName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​. - * + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/secrets/{secretName}. + * * @param secretSource the secretSource value to set. * @return the UrlSigningKeyParameters object itself. */ @@ -103,7 +103,7 @@ public UrlSigningKeyParameters withSecretSource(ResourceReference secretSource) /** * Get the secretVersion property: Version of the secret to be used. - * + * * @return the secretVersion value. */ public String secretVersion() { @@ -112,7 +112,7 @@ public String secretVersion() { /** * Set the secretVersion property: Version of the secret to be used. - * + * * @param secretVersion the secretVersion value to set. * @return the UrlSigningKeyParameters object itself. */ @@ -123,7 +123,7 @@ public UrlSigningKeyParameters withSecretVersion(String secretVersion) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -159,7 +159,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { /** * Reads an instance of UrlSigningKeyParameters from the JsonReader. - * + * * @param jsonReader The JsonReader being read. * @return An instance of UrlSigningKeyParameters if the JsonReader was pointing to an instance of it, or null if it * was pointing to JSON null. diff --git a/sdk/resourcemanager/azure-resourcemanager-cdn/src/main/java/com/azure/resourcemanager/cdn/models/ValidateSecretInput.java b/sdk/resourcemanager/azure-resourcemanager-cdn/src/main/java/com/azure/resourcemanager/cdn/models/ValidateSecretInput.java index d19da3d910bf5..ff94eb67eeacd 100644 --- a/sdk/resourcemanager/azure-resourcemanager-cdn/src/main/java/com/azure/resourcemanager/cdn/models/ValidateSecretInput.java +++ b/sdk/resourcemanager/azure-resourcemanager-cdn/src/main/java/com/azure/resourcemanager/cdn/models/ValidateSecretInput.java @@ -24,10 +24,10 @@ public final class ValidateSecretInput implements JsonSerializable - - diff --git a/sdk/resourcemanager/azure-resourcemanager-containerinstance/src/main/java/com/azure/resourcemanager/containerinstance/ContainerInstanceManager.java b/sdk/resourcemanager/azure-resourcemanager-containerinstance/src/main/java/com/azure/resourcemanager/containerinstance/ContainerInstanceManager.java index 1d7d1adc194f8..ecdc81ca4e595 100644 --- a/sdk/resourcemanager/azure-resourcemanager-containerinstance/src/main/java/com/azure/resourcemanager/containerinstance/ContainerInstanceManager.java +++ b/sdk/resourcemanager/azure-resourcemanager-containerinstance/src/main/java/com/azure/resourcemanager/containerinstance/ContainerInstanceManager.java @@ -96,22 +96,38 @@ private ContainerInstanceManager(HttpPipeline httpPipeline, AzureProfile profile this.networkManager = NetworkManager.authenticate(httpPipeline, profile); } - /** @return the storage manager in container instance manager */ + /** + * Gets the storage manager in container instance manager. + * + * @return the storage manager in container instance manager + */ public StorageManager storageManager() { return storageManager; } - /** @return the authorization manager in container instance manager */ + /** + * Gets the authorization manager in container instance manager. + * + * @return the authorization manager in container instance manager + */ public AuthorizationManager authorizationManager() { return authorizationManager; } - /** @return the network manager in container instance manager */ + /** + * Gets the network manager in container instance manager. + * + * @return the network manager in container instance manager + */ public NetworkManager networkManager() { return networkManager; } - /** @return the resource management API entry point */ + /** + * Gets the resource management API entry point. + * + * @return the resource management API entry point + */ public ContainerGroups containerGroups() { if (this.containerGroups == null) { this.containerGroups = new ContainerGroupsImpl(this); diff --git a/sdk/resourcemanager/azure-resourcemanager-containerinstance/src/main/java/com/azure/resourcemanager/containerinstance/models/ContainerGroup.java b/sdk/resourcemanager/azure-resourcemanager-containerinstance/src/main/java/com/azure/resourcemanager/containerinstance/models/ContainerGroup.java index 9da226fdf674c..6ef32535b82c5 100644 --- a/sdk/resourcemanager/azure-resourcemanager-containerinstance/src/main/java/com/azure/resourcemanager/containerinstance/models/ContainerGroup.java +++ b/sdk/resourcemanager/azure-resourcemanager-containerinstance/src/main/java/com/azure/resourcemanager/containerinstance/models/ContainerGroup.java @@ -33,55 +33,123 @@ public interface ContainerGroup extends GroupableResource containers(); - /** @return all the ports publicly exposed for this container group */ + /** + * Gets all the ports publicly exposed for this container group. + * + * @return all the ports publicly exposed for this container group + */ Set externalPorts(); - /** @return the TCP ports publicly exposed for this container group */ + /** + * Gets the TCP ports publicly exposed for this container group. + * + * @return the TCP ports publicly exposed for this container group + */ int[] externalTcpPorts(); - /** @return the UDP ports publicly exposed for this container group */ + /** + * Gets the UDP ports publicly exposed for this container group. + * + * @return the UDP ports publicly exposed for this container group + */ int[] externalUdpPorts(); - /** @return the volumes for this container group */ + /** + * Gets the volumes for this container group. + * + * @return the volumes for this container group + */ Map volumes(); - /** @return the Docker image registry servers by which the container group is created from */ + /** + * Gets the Docker image registry servers by which the container group is created from. + * + * @return the Docker image registry servers by which the container group is created from + */ Collection imageRegistryServers(); - /** @return the container group restart policy */ + /** + * Gets the container group restart policy. + * + * @return the container group restart policy + */ ContainerGroupRestartPolicy restartPolicy(); - /** @return the DNS prefix which was specified at creation time */ + /** + * Gets the DNS prefix which was specified at creation time. + * + * @return the DNS prefix which was specified at creation time + */ String dnsPrefix(); - /** @return the FQDN for the container group */ + /** + * Gets the FQDN for the container group. + * + * @return the FQDN for the container group + */ String fqdn(); - /** @return the IP address */ + /** + * Gets the IP address. + * + * @return the IP address + */ String ipAddress(); - /** @return true if IP address is public */ + /** + * Checks whether IP address is public. + * + * @return true if IP address is public + */ boolean isIPAddressPublic(); - /** @return true if IP address is private */ + /** + * Checks whether IP address is private. + * + * @return true if IP address is private + */ boolean isIPAddressPrivate(); - /** @return the base level OS type required by the containers in the group */ + /** + * Gets the base level OS type required by the containers in the group. + * + * @return the base level OS type required by the containers in the group + */ OperatingSystemTypes osType(); - /** @return the state of the container group; only valid in response */ + /** + * Gets the state of the container group; only valid in response. + * + * @return the state of the container group; only valid in response + */ String state(); - /** @return the provisioningState of the container group */ + /** + * Gets the provisioningState of the container group. + * + * @return the provisioningState of the container group + */ String provisioningState(); - /** @return the container group events */ + /** + * Gets the container group events. + * + * @return the container group events + */ Set events(); - /** @return the DNS configuration for the container group */ + /** + * Gets the DNS configuration for the container group. + * + * @return the DNS configuration for the container group + */ DnsConfiguration dnsConfig(); /** @@ -92,32 +160,54 @@ public interface ContainerGroup extends GroupableResource subnetIds(); - /** @return whether managed service identity is enabled for the container group */ + /** + * Checks whether managed service identity is enabled for the container group. + * + * @return whether managed service identity is enabled for the container group + */ boolean isManagedServiceIdentityEnabled(); /** + * Gets the tenant id of the system assigned managed service identity. + * * @return the tenant id of the system assigned managed service identity. Null if managed service identity is not * configured. */ String systemAssignedManagedServiceIdentityTenantId(); /** + * Gets the principal id of the system assigned managed service identity. + * * @return the principal id of the system assigned managed service identity. Null if managed service identity is not * configured. */ String systemAssignedManagedServiceIdentityPrincipalId(); - /** @return whether managed service identity is system assigned, user assigned, both, or neither */ + /** + * Checks whether managed service identity is system assigned, user assigned, both, or neither. + * + * @return whether managed service identity is system assigned, user assigned, both, or neither + */ ResourceIdentityType managedServiceIdentityType(); - /** @return the ids of the user assigned managed service identities. Returns an empty set if no MSIs are set. */ + /** + * Gets the ids of the user assigned managed service identities. + * + * @return the ids of the user assigned managed service identities. Returns an empty set if no MSIs are set. + */ Set userAssignedManagedServiceIdentityIds(); - /** @return the log analytics information of the container group. */ + /** + * Gets the log analytics information of the container group. + * + * @return the log analytics information of the container group. + */ LogAnalytics logAnalytics(); /*********************************************************** @@ -507,7 +597,11 @@ interface WithGitRevision extends WithVolumeAttach { interface WithVolumeAttach extends Attachable.InDefinition { } - /** Grouping of the container group's volume definition stages. */ + /** + * Grouping of the container group's volume definition stages. + * + * @param the stage of the parent definition to return to after attaching this definition + */ interface VolumeDefinition extends VolumeDefinitionBlank, WithAzureFileShare, WithStorageAccountName, WithStorageAccountKey, WithSecretsMap, WithGitUrl, @@ -1077,7 +1171,11 @@ interface WithContainerInstanceAttach WithLivenessProbe, WithReadinessProbe, Attachable.InDefinition { } - /** Grouping of the container group's volume definition stages. */ + /** + * Grouping of the container group's volume definition stages. + * + * @param the stage of the parent definition to return to after attaching this definition + */ interface ContainerInstanceDefinition extends ContainerInstanceDefinitionBlank, WithImage, WithOrWithoutPorts, WithPortsOrContainerInstanceAttach, WithContainerInstanceAttach { diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/module-info.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/module-info.java index 714656dd4e5de..de7be3e620aaa 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/module-info.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/module-info.java @@ -10,6 +10,6 @@ exports com.azure.resourcemanager.scvmm.fluent.models; exports com.azure.resourcemanager.scvmm.models; - opens com.azure.resourcemanager.scvmm.fluent.models to com.azure.core, com.fasterxml.jackson.databind; - opens com.azure.resourcemanager.scvmm.models to com.azure.core, com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.scvmm.fluent.models to com.azure.core; + opens com.azure.resourcemanager.scvmm.models to com.azure.core; } diff --git a/sdk/selfhelp/azure-resourcemanager-selfhelp/src/main/java/module-info.java b/sdk/selfhelp/azure-resourcemanager-selfhelp/src/main/java/module-info.java index 30b4c6fcb8b4d..e2b1334247638 100644 --- a/sdk/selfhelp/azure-resourcemanager-selfhelp/src/main/java/module-info.java +++ b/sdk/selfhelp/azure-resourcemanager-selfhelp/src/main/java/module-info.java @@ -10,6 +10,6 @@ exports com.azure.resourcemanager.selfhelp.fluent.models; exports com.azure.resourcemanager.selfhelp.models; - opens com.azure.resourcemanager.selfhelp.fluent.models to com.azure.core, com.fasterxml.jackson.databind; - opens com.azure.resourcemanager.selfhelp.models to com.azure.core, com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.selfhelp.fluent.models to com.azure.core; + opens com.azure.resourcemanager.selfhelp.models to com.azure.core; }